/srv/irclogs.ubuntu.com/2020/04/15/#ubuntu-bd.txt

zakipavlushka, ffmpeg -find_stream_info -i test.mkv -map 0 -codec copy -codec:s mov_text test.mp415:58
zakia need to do a automation with this. which will find all the mkv in directory and convert to mp4 and remove the original or merge 15:59
zakiremonshai, any idea? 16:00
pavlushkazaki: use && find -exec delete kind of16:01
remonshaisorry.. 16:01
pavlushkazaki: && find . -name "name" -type f -exec rm -r "{}" \;16:03
pavlushkazaki: && find . -name "*.mkv" -type f -exec rm -r "{}" \;16:03
remonshaiWhy do you need this?16:05
remonshaiI means converting.16:05
zakipavlushka, yes16:06
zakicause mkv is not supported on many platform 16:06
zakiI can't play mkv on browser 16:07
zakiany browser on unix16:07
zakiIOS 16:07
zakisometime it works on windows chrome browser 16:07
zakidepends on the codec 16:08
zakiI tried changing mime on the Nginx16:08
pavlushkai know16:08
remonshaioh ;/16:08
zakiso I have two option use a real time transcoder16:08
zakior php-ffmpeg module with my php script 16:09
zakiemby use transcoder and keep the transcoded file in a temporary directory so it works on all device 16:10
zakigives output based on client device 16:10
zakibt I have another PHP script for movie server, which says it support mkv but it is not 16:11
pavlushkaaha16:13
zakiso I'm facing issue like if there is 40000 file 60% of its mkv or avi 16:13
zaki ffmpeg -find_stream_info -i test.mkv -map 0 -codec copy -codec:s mov_text test.mp4 its works without losing any quality 16:14
zakipavlushka, for f in *.mkv; do ffmpeg -i "$f" -c:v libx264 -preset medium -c:a aac -c:s mov_text "${f%.mkv}.mp4"; done17:51
pavlushkazaki: wow, I don't know bash scripting17:52
zakipavlushka, H.264 AAC is the best format and preset medium is for the quality , it takes time to convert with medium preset , you can set it to slower or faster 17:55
zakifaster will convert the file faster but quality will be worse 17:55
zakislower preset will take much time but quality good 17:55
zakinow I put this script on folders and run sh 17:57
pavlushkacool18:01
zakioh I need to remove the original after 18:05
pavlushkazaki:  find . -name "*.mkv" -type f -exec rm -r "{}" \;18:49
zaki&& rm *.mkv after the bash script ?18:50
pavlushkawill do18:51
pavlushkathat was for subdirectories included18:51
zakiwill run this per directory 18:53
pavlushkathat appears18:53
zakipavlushka, got another 18:56
zakirm -f -- "$f" below previous script ,18:57
zakiit delete file after conversion done. 18:57
zakiI mean if you have to mkv in the folder it convert 1st one then delete the 1st one source then start the 2nd one 18:58
zakiah19:00
zakigreat 19:00
zakijust tested 19:00
zakiso my whole script is19:00
zaki#!/bin/bash19:01
zakifor f in *.mkv; 19:01
zakido ffmpeg -i "$f" -c:v libx264 -preset medium -c:a aac -c:s mov_text "${f%.mkv}.mp4"; 19:01
zakirm -f -- "$f"19:01
zakidone19:01
zakipavlushka, ^19:01
zakiif you have two mkv*19:02
zaki@pavlushka,  I think I can speed up the process by detecting the codec using ffmpeg before converting and inside mkv container if it found that the codec is already H.264 & AAC it will just copy the codec instead of encoding again and convert to mp4 and if it found other codec inside mkv it will encode to H264 AAC19:09
pavlushkazaki: wow19:12
zakidon't know how to search this on google :P 19:12
pavlushkazaki: you can filter that with mediatype19:13
zakiwhere ?19:14
pavlushkazaki: https://askubuntu.com/questions/781408/how-can-i-find-media-files-not-encoded-with-a-specific-codec19:14
u-la-la[ video - How can I find media files not encoded with a specific codec? - Ask Ubuntu ] - askubuntu.com ( https://tinyurl.com/skvz82j )19:14
pavlushkazaki: sorry mediainfo19:15
zakipavlushka, https://superuser.com/questions/1180108/conditionally-encode-or-copy-audio-stream-using-ffmpeg19:16
u-la-la[ linux - Conditionally encode or copy audio stream using FFMpeg - Super User ] - superuser.com ( https://tinyurl.com/t8k8kav )19:16
zakithis is better I think 19:17
pavlushkame too19:17
pavlushkanight night20:00

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!