VideoHelp Forum



Support our site by donate $5 directly to us Thanks!!!

Try StreamFab Downloader and download streaming video from Netflix, Amazon!



+ Reply to Thread
Results 1 to 9 of 9
  1. I have this ffmpeg sentence:

    Code:
    ffmpeg -f lavfi -i 'testsrc=size=1280x720:rate=24' -f lavfi -i "sine=frequency=1000:sample_rate=44100,volume=0:enable='gt(t-trunc(t),0.25)'" -filter_complex "format=yuv420p, drawtext=fontcolor=white: fontsize=60: fontfile=/usr/share/fonts/truetype/LiberationMono-Bold.ttf: box=1:boxcolor=black@0.3: shadowcolor=black: shadowx=1: shadowy=1: x=(w-text_w-10):y=(h-text_h-5): text=${localtime}: timecode='01\:00\:00\;00': rate=30000/1001"  -c:v libx264 -profile:v baseline -level 3.0 -x264opts 'keyint=48:min-keyint=48:no-scenecut'  -r 
    Code:
    24
    -g 48 -keyint_min 48 -sc_threshold 0 -preset veryfast -maxrate 1984k -bufsize 3968k -c:a aac -b:a 128k -ar 44100 -tune zerolatency -movflags +faststart -f flv "rtmp://10.162.20.20/live/bunny"

    But when I change timecode "rate=30000/1001" (that is really 29.976 (30000/1001)) to 24 or 25 or even 30, ffmpeg fails and show me an

    Code:
    Drop frame is only allowed with 30000/1001 or 60000/1001 FPS
    Please, can anyone help me to solve this?

    Thank you
    Last edited by Rafael Linux User; 17th May 2017 at 06:18.
    Quote Quote  
  2. It looks like the drawtext timecode rate argument is irrelevant anyways, because it seems to take the rate from the source framerate. In your example it's already 24 because testsrc was 24 (it works here)

    eg. if testsrc rate was 15, it would be 15, regardless if drawtext timecode rate "said" 30000/1001

    I'm not sure if that "feature" is supposed to be there - would there be any situation where you would want a different timecode than source rate in drawtext ? If so, maybe file a bug report
    Quote Quote  
  3. Try changing the ; to a :
    https://trac.ffmpeg.org/wiki/FilteringGuide#BurntinTimecode

    (I haven't evaluated what poisondeathray said)
    Quote Quote  
  4. Yes it doesn't matter ; a colon works but you can make it 12 , 24 , 30, 30000/1001 it will still take on the src frame rate . It seems to have no effect . But if you change the src framerate, it does change the drawtext

    I guess if you had a situation where you needed a different timecode overlay I supposed you can derive it from a nullsrc or separate testsrc with different framerate
    Quote Quote  
  5. Well, in fact, the problem is that each elapsed second showed in "timecode" doesn't match a "real" second. That's to say, it's supposed that if I assigned 24fps to this stream, the timecode counter should be synchronized with the real time, but it's not. The timecode is slower that the real time.

    I expect I explained properly.

    Thank you
    Quote Quote  
  6. Originally Posted by Rafael Linux User View Post
    Well, in fact, the problem is that each elapsed second showed in "timecode" doesn't match a "real" second. That's to say, it's supposed that if I assigned 24fps to this stream, the timecode counter should be synchronized with the real time, but it's not. The timecode is slower that the real time.

    I expect I explained properly.

    Thank you

    Maybe I don't understand what you're trying to say, or maybe we're getting different results (I tested on windows, with an older ffmpeg binary)

    The timecode matches a real second according to the source framerate, irrespective of what you set

    eg. if zero to 23 frames have been displayed and passed, and you are at the beginning of frame 24, 1 second duration has passed if the source fps is 24. The timecode should read 00:00:01.000 and 24 because you're on the start of frame 24 . If source fps was 30, it would say 00:00:01.000, but on frame 30. Eitherway, 1 second has passed

    Are you playing an encoded file (TC is "baked" in), or using ffplay in realtime ? If the latter, it might be that you are not getting realtime encoding speed
    Quote Quote  
  7. My apologies - I was looking at something completely different testsrc2 (not testsrc), which places a different accurate timecode overlay in the top left corner . Not the one you were looking at... in the bottom right
    Quote Quote  
  8. as sneaker suggested, the colon seems to work for hh:minec:frames

    you might have to use some text expansion notation for other notations

    Code:
    ffmpeg -f lavfi -i "color=c=black@1.0:s=1280x720:r=24" -filter_complex "format=yuv420p, drawtext=fontcolor=white: fontsize=60: fontfile=arial.ttf: box=1:boxcolor=black@0.3: shadowcolor=black: shadowx=1: shadowy=1: x=(w-text_w-10):y=(h-text_h-5): text=${localtime}: timecode='00\:00\:00\:00': timecode_rate=24" -c:v libx264 -crf 18 -an -t 00:00:10 test.mp4 -y
    Last edited by poisondeathray; 16th May 2017 at 11:12.
    Quote Quote  
  9. In the first place, I must say this forum is incredible. I asked about the same question in the ffmpeg support forum and no one solved it.

    However poisondeathray and sneaker not only answered my question, but they solved it!!!

    THANK YOU VERY MUCH, that was exactly what I was looking for. Now it's synchred and I expect to share what I learn here.

    I'm glad to ask here.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!