-
-
Save sfahadshahzad/9c5f9930757bdaa91697daf4223146af to your computer and use it in GitHub Desktop.
HEVC Test Pattern to UDP Multicast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Set duration in seconds | |
set duration=10 | |
:: Temporary loop TS file to create | |
set loopfile=loop.mkv | |
:: Target mpegts URL (ESCAPE &s with ^!!! and add double quotes) | |
:: see https://www.ffmpeg.org/ffmpeg-protocols.html#udp for full syntax | |
set "target=udp://239.0.0.1:1234?ttl=13^&pkt_size=1316" | |
echo %target% | |
::exit | |
:: Create the loop file | |
if not exist %loopfile% ( | |
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%" ^ | |
-c:v libx265 -x265-params bframes=0 -b:v 100k -preset slow ^ | |
-force_key_frames "expr:gte(t,n_forced*3)" ^ | |
-c:a aac -b:a 16k ^ | |
-y ^ | |
%loopfile% | |
) | |
:: Play it | |
ffmpeg.exe ^ | |
-threads 2 ^ | |
-re -fflags +genpts -stream_loop -1 ^ | |
-i %loopfile% -vcodec copy -acodec copy ^ | |
-f mpegts %target% | |
:: Various options for encoding I tried | |
:: -c:v libx265 -b:v 50k -x265-params keyint=100:no-open-gop -preset slow ^ | |
:: -c:v libx265 -x265-params bframes=0 -b:v 100k -preset slow ^ | |
:: -f lavfi -i "sine=frequency=1000:sample_rate=48000:duration=%duration%" ^ | |
:: -c:v libx265 -x265-params bframes=0 -b:v 100k -preset slow ^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment