[FFmpeg-user] Add subtitles and chapter metadata in one pass?

George Welch george at grwelch.com
Tue Oct 13 19:30:21 EEST 2020


Thank you John.  Your command works.

And actually, I now see that my command (which was functionally 
identical to yours) is also working, so I apologize to the list for 
adding the noise.

The reason that I thought the command was failing is because of the way 
ffmpeg logs it progress to the terminal.  While it is running, one gets 
an updating line such as:

frame=21239 fps=101 q=30.0 size=  274914kB time=00:11:49.14 
bitrate=3175.8kbits/s speed=3.36x

In my experience, this line was constantly updating about once per 
second and you can watch the "time=..." part increase as the encoding 
progresses.  However, with the inclusion of subtitles this line behaves 
differently.  The "frame=" part still increases about once per second, 
but the "time=" part only increments at the next subtitle.  I had seen 
that freeze and assumed ffmpeg stopped working.

It is very weird that this informational line behaves the way it does, 
but since ffmpeg is working away I'm not bothered by it.

Thanks all!

--George


On 10/12/20 3:20 PM, John Finlay via ffmpeg-user wrote:
> I have used a command like the below with success in the past:
>
> $ ffmpeg -i avfile.mkv -i srtfile.srt -i metadata.txt \
>      -map 0:0 -map 0:1 -map 1 -map_metadata 2 \
>          -c:v libx264 [ various options ] \
>          -c:a copy \
>          -c:s srt \
>          -c:d copy \
>             out.mkv
>
> Maybe something like that will work for you.
>
> John
>
>
> On 10/12/2020 12:29 PM, George Welch wrote:
>> Howdy,
>>
>> I need to start with a movie file that has audio and video, and to
>> reencode the video and add subtitles and chapter markers.
>>
>> I can add the chapters in a first pass, and then add the subtitles in a
>> second pass, and that works fine.  But I can't seem to find the right
>> command to add subtitles and chapters in one pass.
>>
>> For example, here is a sequence that does work:
>>
>> $ ffmpeg -i avfile.mkv -i metadata.txt \
>>       -map 0:v -map 0:a -map_metadata 1 \
>>           -c:v libx264 [ various options ] \
>>           -c:a copy \
>>               temp.mkv
>> $ ffmpeg -i temp.mkv -i srtfile.srt \
>>       -map 0:v -map 0:a -map 1:s \
>>           -c:v copy \
>>           -c:a copy \
>>           -c:s srt \
>>               out.mkv
>>
>> However, I would like to skip the intermediate file.  Here is the
>> command I am trying which does *not* work:
>>
>> $ ffmpeg -i avfile.mkv -i srtfile.srt -i metadata.txt \
>>       -map 0:v -map 0:a -map 1:s -map_metadata 2 \
>>           -c:v libx264 [ various options ] \
>>           -c:a copy \
>>           -c:s srt \
>>               out.mkv
>>
>> Can anyone tell me a command that will work, and hopefully explain what
>> I have wrong?
>>
>> Thanks!
>>
>> --George
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list