Custom FFMPEG: Timecode Burn-In

Questions and answers on how to get the most out of FFAStrans
Post Reply
filmeschneider
Posts: 2
Joined: Mon Jan 23, 2023 3:28 pm

Custom FFMPEG: Timecode Burn-In

Post by filmeschneider »

Hi all,


I'm trying to create using the Custom FFMPEG. (I got it to work via A/V Media -> Timecode -> H.264, but the Custom FFMPEG runs at 8-10x realtime, while this chain runs at 1.8x RT and time is a factor.)

My current Custom FFMPEG line is:

Code: Select all

-filter_complex "[0:1][0:2] amerge" -preset ultrafast -vf scale=960:540:in_range=tv:out_range=pc,"drawtext=\timecode='00\:00\:00\:00':timecode_rate=25:x=(w-tw)/2:y=h-(2*lh):fontcolor=white@1:fontsize=30:box=1:boxcolor=black@0.6" -c:v libx264 -pix_fmt yuv420p -crf 27 -c:a aac -ar 48000 -b:a 128k
This of course starts the Burn-In at 00:00:00:00, but I'd rather insert the file's TC:

Code: Select all

Other #1
ID                                       : 1-Material
Type                                     : Time code
Format                                   : MXF TC
Frame rate                               : 25.000 FPS
Time code of first frame                 : 10:00:00:00
Time code of last frame                  : 10:02:34:20
Time code settings                       : Material Package
Time code, stripped                      : Yes
Title                                    : Timecode

Other #2
ID                                       : 0-Source
Type                                     : Time code
Format                                   : MXF TC
Frame rate                               : 25.000 FPS
Time code of first frame                 : 10:00:00:00
Time code of last frame                  : 10:02:34:20
Time code settings                       : Source Package
Time code, stripped                      : Yes

Other #3
Type                                     : Time code
Format                                   : SMPTE TC
Muxing mode                              : SDTI
Frame rate                               : 25.000 FPS
Time code of first frame                 : 10:00:00:00
I have not found a way to make FFMPEG read the TC and use it for the Burn-In. Do any of you guys know how to accomplish this?

Thanks and sorry if this question is not valid on this forum (it's more FFMPEG than FFASTrans really). Feel free to delete this post.


Regards
Christian
ThomasM
Site Admin
Posts: 224
Joined: Wed Feb 22, 2017 6:36 am

Re: Custom FFMPEG: Timecode Burn-In

Post by ThomasM »

Hi Christian,

welcome to the forum and thanks for using FFAStrans!

You can make use of the MediaProperties-Variables:

Code: Select all

timecode='%i_stc_hh%\:%i_stc_mm%\:%i_stc_ss%\:%i_stc_ff%'
Also have a look at the documentation: https://ffastrans.com/wiki/doku.php?id= ... _variables

cheers,
Thomas
emcodem
Posts: 1646
Joined: Wed Sep 19, 2018 8:11 am

Re: Custom FFMPEG: Timecode Burn-In

Post by emcodem »

Hey filmeschneider,

wilkommen im forum und danke dass du FFAStrans verwendest :D
If i remember correctly and nothing yet changed, ffmpeg does not have an inbuilt option for this. Users have to analyze the timecode first and then use the values for the drawtext timecode filter.

Luckily, ffastrans has easy access inbuilt variables ready to use for us:

Code: Select all

-filter_complex "[0:1][0:2] amerge" -preset ultrafast -vf scale=960:540:in_range=tv:out_range=pc,"drawtext=\timecode='%i_stc_hh%\:%i_stc_mm%\:%i_stc_ss%\:%i_stc_ff%':timecode_rate=25:x=(w-tw)/2:y=h-(2*lh):fontcolor=white@1:fontsize=30:box=1:boxcolor=black@0.6" -c:v libx264 -pix_fmt yuv420p -crf 27 -c:a aac -ar 48000 -b:a 128k
emcodem, wrapping since 2009 you got the rhyme?
emcodem
Posts: 1646
Joined: Wed Sep 19, 2018 8:11 am

Re: Custom FFMPEG: Timecode Burn-In

Post by emcodem »

omg, 1 thread, 3 germans... :D
emcodem, wrapping since 2009 you got the rhyme?
filmeschneider
Posts: 2
Joined: Mon Jan 23, 2023 3:28 pm

Re: Custom FFMPEG: Timecode Burn-In

Post by filmeschneider »

It works! Awesome! Thanks everyone, vielen, vielen Dank :)

FFAStrans never ceases to amaze me.


Best
Christian
Post Reply