You could make a Python script that updates a text file with the current system time. Then use ffmpeg to reload and overlay the text file for each frame. I have to admit, I tried something similar to this though and sometimes it would crash because they were both accessing the file.
On Tue, Nov 12, 2019 at 3:37 PM Byron J <[email protected]> wrote: > Hello, > > What are some methods of timestamping video? I found one method using the > framerate but I would like to use the PC clock. > > Any help would be greatly appreciated. If anyone is interested, payment for > the solution could be a possibility. > > Here is the .bat file with the FFMPEG commands running the postprocessing. > > > setlocal > @echo off > set sourcefile=%~1 > set destfile=%~2 > shift > shift > REM Variables > set sourcefile=%sourcefile% > set destfile=%destfile% > set tempfile=%sourcefile:~0,-3%_tmp.mp4 > set logofile=C:\Users\Public\WinTV\fox49-logo-header-v2.png > set hour=%sourcefile:~-7,2% > set min=%sourcefile:~-5,2% > set year=%date:~10,4% > set month=%date:~4,2% > set day=%date:~7,2% > set dts=%year%_%month%_%day% > echo WinTV8 Post processing log. > postprocess.log > echo sourcefile = %sourcefile% >> postprocess.log > echo destfile = %destfile% >> postprocess.log > echo tempfile = %tempfile% >> postprocess.log > echo logofile = %logofile% >> postprocess.log > echo hour = %hour% >> postprocess.log > echo min = %min% >> postprocess.log > echo dts = %dts% >> postprocess.log > REM Video Processing > echo Starting timecode overlay... >> postprocess.log > ffmpeg -y -i %sourcefile% -b:v 1M -vcodec libx264 -preset ultrafast -s > 480X360 -vf drawtext="text='%dts%\ \ \ \ > ':timecode='%hour%\:%min%\:00\:00': rate=25: > fontfile=C\\:\\Windows\\Fonts\\Ariel.ttf: x=400: y=h-lh-1: > > fontcolor=white:shadowcolor=black:shadowx=1:shadowy=1:fontsize=72:box=1:[email protected] > :boxborderw=5:" > %tempfile% > echo End timecode overlay. >> postprocess.log > echo Starting image overlay... >> postprocess.log > ffmpeg -y -i %tempfile% -i %logofile% -filter_complex > "[1:v]format=argb,geq=r='r(X,Y)':a='0.5*alpha(X,Y)'[image]; > [0:v][image]overlay=(main_w-overlay_w-0):(main_h-overlay_h-2)" %destfile% > echo End image overlay. >> postprocess.log > REM Validate file exsists and cleanup > if exist "%destfile%" ( > del %tempfile% >> postprocess.log > del %sourcefile% >> postprocess.log > ) else ( > echo Error processing file %sourcefile%. >> postprocessing.log > ) > echo End post processing. >> postprocess.log > endlocal > > > > > > > > Byron Johnson > _______________________________________________ > ffmpeg-user mailing list > [email protected] > https://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > [email protected] with subject "unsubscribe". _______________________________________________ ffmpeg-user mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
