[FFmpeg-user] Drawtext specific date and time with replay

Stanislas Defawes sdefawes at ina.fr
Fri May 8 17:48:21 EEST 2020



> Le 8 mai 2020 à 15:51, Stanislas Defawes <sdefawes at ina.fr> a écrit :
> 
> 
> 
>> Le 8 mai 2020 à 14:58, Stanislas Defawes <sdefawes at ina.fr> a écrit :
>> 
>> 
>> 
>> Le 8 mai 2020 à 13:59, Edward Park <kumowoon1025 at gmail.com<mailto:kumowoon1025 at gmail.com>> a écrit :
>> 
>> Hi,
>> Thank’s for reply. Yes I try it and it works fine but with this argument (Timecode), it’s going back to 00:00:00:00 when you seek and this is exactly that I don’t want.
>> 
>> Oh, I did not know this happened, it sounds like a small bug? Then I suppose you could add setpts=PTS-STARTPTS before the drawtext filter and use the original command you had, it will set the starting pts to be 0.
>> 
>> Regards,
>> Ted Park
>> 
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org<mailto: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".
>> 
>> I'll try it yesterday but with a wrong syntax, then I try again now and it works (good date and time) but the seeking problem is the same that with the timecode syntax, it’s come back to 06:00:00 when you seek forward,  ooooh it was to good to be true !
>> 
>> _______________________________________________
>> 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 ».
> 
> I try to pipe from ffmpeg  (with fix PTS) to ffplay and then it’s works but audio and video are out of sync in this case and it’s re encoded off course…. Is it possible to pipe from ffplay to ffplay ? I don’t find how to do that
> 
> _______________________________________________
> 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".


Well, the answer is No, ffplay is only a player so I found a solution for my problem, if someone else in interested :

First : extraction of the start time of the first image with ffprobe :

ffprobe -v error -show_format -show_streams path/to/theFile.ts | grep start_time | head -n 1

start_time=61880.537989

Keep the result as integer then calculate the timestamp of the time and date you looking for (in my case 2020:05:01 06:00:00)

date -j -f "%Y:%m:%d %H:%M:%S" '2020:05:01 06:00:00' +%s 

Result is 1588305600

Then 1588305600 - 61880 = 1588243720

Then ffplay command :

ffplay path/to/theFile.ts -vf "drawtext=text='%{pts\:localtime\: 1588243720\}':fontfile=/Library/Fonts/Arial.ttf:fontsize=48:fontcolor=white:box=1:boxborderw=6:boxcolor=black at 0.75:x=(w-text_w)/2:y=h-text_h-20 »

It work’s for me and it’s seekable.


More information about the ffmpeg-user mailing list