User Tools

Site Tools


doc:appunti:linux:video:ffmpeg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
doc:appunti:linux:video:ffmpeg [2020/06/17 12:35] niccolodoc:appunti:linux:video:ffmpeg [2020/12/07 17:26] – [Deinterlace] niccolo
Line 469: Line 469:
         -x264-params 'force-cfr=1:keyint=8:bframes=0:ref=1' \         -x264-params 'force-cfr=1:keyint=8:bframes=0:ref=1' \
         output-video.mkv         output-video.mkv
 +</code>
 +
 +====== Problem in MKV Remux ======
 +
 +It seems there is a bug in ffmpeg **[[https://trac.ffmpeg.org/ticket/6037|#6037 mkv muxing not broken]]**: muxing two working files into a mkv produces a broken file: seeking around can break (mute) audio. I experienced this bug (with ffmpeg 4.1.6) trying to mux one mkv file containing one audio and one subtitle streams to another mkv file conaining video and audio. The resulting file did not play good in mplayer: seeking into the file caused audio or vido to stop playing.
 +
 +This was the first try command line:
 +
 +<code>
 +# The resulting video is broken.
 +ffmpeg -i input_file1.mkv -i input_file2.mkv \
 +    -map '0:v:0' -map '0:a:0' \
 +    -map '1:a:0' -map '1:s:0' \
 +    -codec:v copy -codec:a copy -codec:s copy \
 +    output_file.mkv
 +</code>
 +
 +The workaround was to extract each individual stream, and mux then together:
 +
 +<code>
 +ffmpeg -i input_file1.mkv -map 0:v:0 -codec:v copy input-v_env.mkv
 +ffmpeg -i input_file1.mkv -map 0:a:0 -codec:a copy input-a_ita.mkv
 +ffmpeg -i input_file2.mkv -map 0:a:0 -codec:a copy input-a_eng.mkv
 +ffmpeg -i input_file2.mkv -map 0:s:0 -codec:s copy input-s_eng.mkv
 +ffmpeg \
 +    -i input-v_env.mkv \
 +    -i input-a_ita.mkv \
 +    -i input-a_eng.mkv \
 +    -i input-s_eng.mkv \
 +    -codec:v copy -codec:a copy -codec:s copy \
 +    -map '0' -map '1' -map '2' -map '3' \
 +    output_file.mkv
 </code> </code>
  
doc/appunti/linux/video/ffmpeg.txt · Last modified: 2023/11/13 11:24 by niccolo