Skip to content

Instantly share code, notes, and snippets.

@m1tk4
Created March 4, 2020 17:59
Show Gist options
  • Save m1tk4/31363a830a5ff5752ceab06478faba61 to your computer and use it in GitHub Desktop.
Save m1tk4/31363a830a5ff5752ceab06478faba61 to your computer and use it in GitHub Desktop.
SMPTE HD Bars + Overlay Text as TS Loop suitable for Mux
@echo off
:: Set duration in seconds
set duration=20
:: Temporary loop TS file to create
set loopfile=svc%1.ts
set "overlaytext=ABC-%2 / LTN"
:: Create the loop file
ffmpeg.exe ^
-f lavfi -i "smptehdbars=duration=%duration%:size=1280x720:rate=60000/1001" ^
-f lavfi -i "sine=frequency=220:beep_factor=5:sample_rate=48000:duration=%duration%" ^
-vf "drawtext=text='%overlaytext%':x=W/2-tw/2:y=H/2-th/2:fontfile=consolab.ttf:fontsize=72:fontcolor=white:shadowcolor=black:shadowx=5:shadowy=5" ^
-c:v libx265 -x265-params bframes=0 -b:v 100k -preset slow ^
-force_key_frames "expr:gte(t,n_forced*3)" ^
-c:a mp2 -b:a 32k ^
-y ^
-f mpegts ^
-metadata service_provider="ABC" ^
-metadata service_name="ABC-%2" ^
-mpegts_flags system_b ^
-mpegts_pmt_start_pid %101 ^
-mpegts_start_pid %110 ^
-mpegts_service_id %1 ^
-mpegts_service_type hevc_digital_hdtv ^
-muxrate 250000 ^
%loopfile%
:: Show what we got
ffprobe %loopfile%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment