[FFmpeg-user] Timestamp using PC Clock - possible payment for solution.

Byron J byronj64 at gmail.com
Tue Nov 12 22:30:17 EET 2019


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:boxcolor=black at 0.5: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


More information about the ffmpeg-user mailing list