[15:58] pavlushka, ffmpeg -find_stream_info -i test.mkv -map 0 -codec copy -codec:s mov_text test.mp4 [15:59] a 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 [16:00] remonshai, any idea? [16:01] zaki: use && find -exec delete kind of [16:01] sorry.. [16:03] zaki: && find . -name "name" -type f -exec rm -r "{}" \; [16:03] zaki: && find . -name "*.mkv" -type f -exec rm -r "{}" \; [16:05] Why do you need this? [16:05] I means converting. [16:06] pavlushka, yes [16:06] cause mkv is not supported on many platform [16:07] I can't play mkv on browser [16:07] any browser on unix [16:07] IOS [16:07] sometime it works on windows chrome browser [16:08] depends on the codec [16:08] I tried changing mime on the Nginx [16:08] i know [16:08] oh ;/ [16:08] so I have two option use a real time transcoder [16:09] or php-ffmpeg module with my php script [16:10] emby use transcoder and keep the transcoded file in a temporary directory so it works on all device [16:10] gives output based on client device [16:11] bt I have another PHP script for movie server, which says it support mkv but it is not [16:13] aha [16:13] so I'm facing issue like if there is 40000 file 60% of its mkv or avi [16:14] ffmpeg -find_stream_info -i test.mkv -map 0 -codec copy -codec:s mov_text test.mp4 its works without losing any quality [17:51] pavlushka, for f in *.mkv; do ffmpeg -i "$f" -c:v libx264 -preset medium -c:a aac -c:s mov_text "${f%.mkv}.mp4"; done [17:52] zaki: wow, I don't know bash scripting [17:55] pavlushka, 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] faster will convert the file faster but quality will be worse [17:55] slower preset will take much time but quality good [17:57] now I put this script on folders and run sh [18:01] cool [18:05] oh I need to remove the original after [18:49] zaki: find . -name "*.mkv" -type f -exec rm -r "{}" \; [18:50] && rm *.mkv after the bash script ? [18:51] will do [18:51] that was for subdirectories included [18:53] will run this per directory [18:53] that appears [18:56] pavlushka, got another [18:57] rm -f -- "$f" below previous script , [18:57] it delete file after conversion done. [18:58] I mean if you have to mkv in the folder it convert 1st one then delete the 1st one source then start the 2nd one [19:00] ah [19:00] great [19:00] just tested [19:00] so my whole script is [19:01] #!/bin/bash [19:01] for f in *.mkv; [19:01] do ffmpeg -i "$f" -c:v libx264 -preset medium -c:a aac -c:s mov_text "${f%.mkv}.mp4"; [19:01] rm -f -- "$f" [19:01] done [19:01] pavlushka, ^ [19:02] if you have two mkv* [19:09] @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 AAC [19:12] zaki: wow [19:12] don't know how to search this on google :P [19:13] zaki: you can filter that with mediatype [19:14] where ? [19:14] zaki: https://askubuntu.com/questions/781408/how-can-i-find-media-files-not-encoded-with-a-specific-codec [19:14] [ video - How can I find media files not encoded with a specific codec? - Ask Ubuntu ] - askubuntu.com ( https://tinyurl.com/skvz82j ) [19:15] zaki: sorry mediainfo [19:16] pavlushka, https://superuser.com/questions/1180108/conditionally-encode-or-copy-audio-stream-using-ffmpeg [19:16] [ linux - Conditionally encode or copy audio stream using FFMpeg - Super User ] - superuser.com ( https://tinyurl.com/t8k8kav ) [19:17] this is better I think [19:17] me too [20:00] night night