Quote:
I need a command that can transfer all files inside this folder from mkv to mp4 (along with hard sub for embed subtitle)
|
Copy audio and video to output with change in container.
Code:
ffmpeg -i file.mkv -c:a copy -c:v copy file.mp4
Loop through all .mkv files in directory.
Code:
for i in *.mkv; do
echo $i
done
As for subs there are several ways to do it. Look at
man ffmpeg
Hard subs in the video itself? You'll need to specify the sub file and then overlay it onto the video.
Example: Overlay dvd_subs onto video (1st vid stream, 2nd audio stream, 2nd sub stream)
Code:
ffmpeg -probesize 1000000000 -analyzeduration 100000000 -i movie.vob -filter_complex "[0:0][0:4]overlay[0]" -map [0] -map 0:2 -c:a copy -c:v libx264 -b:v 2500k movie.avi
If you already have sub files along with the .mkv files, then read the man page for a while and understand how to do what you want.
If you will do a search for this on LQ there are lots of questions on this answered.