Subtitles synced to timecode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Subtitles synced to timecode

Kasper Folman @ flipper
Hey.

I’ve been working my brain to figure out this, googling for hours. Hopefully there’s some clever heads in here, that can help me.

So, my problem is, that i need to burn in timecode to a movie file. Easy peasy:
ffmpeg -loglevel verbose -i <inputfile> -c:v libx264 -pix_fmt yuv420p -profile:v high -level 5.0 -b:v 8000k -filter_complex "[0:0]  subtitles=‘<subtitlefile>' [vOut]" -map "[vOut]" -c:a aac -b:a 128k -ac 2 -y -strict -2 <output>

And this works great, as long as the movie and .srt file are synced with start TC 00:00:00:00.

However, I have a clip, whose timescode starts at 14:15:34:20, and subtitles are not burned in to this one, even tough the srt file are synced to that timecode. (First subtitle is at 14:15:35).

How do i make ffmpeg understand, that it needs to use the timecode from the clip, to sync the subtitles, and not a timecode starting at 00:00:00:00?

Hope someone can help.

Thanks!

Kasper
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Subtitles synced to timecode

Gyan
On Tue, May 9, 2017 at 1:15 AM, Kasper Folman @ flipper <
[hidden email]> wrote:

>
> However, I have a clip, whose timescode starts at 14:15:34:20, and
> subtitles are not burned in to this one, even tough the srt file are synced
> to that timecode. (First subtitle is at 14:15:35).
>
>
That timecode is almost certainly a data track encoding the start time
label of the asset's original medium, primarily of use in editing apps. and
not the starting timestamp of the video stream in the file.

Assuming the video stream's STARTPTS is 0 (usually the case with containers
other than transport streams TS, MTS..etc), you can use the following
workaround:

-filter_complex
"[0:0]setpts=PTS-STARTPTS+51334.83/TB,subtitles=‘<subtitlefile>',setpts=PTS-51334.83/TB[vOut]"

where 51334.83 is the starting timecode expressed in (fractional) seconds.
I've assumed a 24 fps video stream.

To my knowledge, ffmpeg cannot directly make use of the timecode value, so
you will to have run ffprobe beforehand, extract the value if present,
convert and then form the filtergraph string.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".