Generate MPEG-TS from file with ffmpeg

ffmpeg -stream_loop -1 -i /mnt/Sunrise.mp4 -map 0:v -vcodec copy -bsf:v h264_mp4toannexb -f h264 - | ffmpeg -framerate 25 -fflags +genpts -r 25 -re -i - -f lavfi -i anullsrc=r=48000:cl=stereo -c:a aac -shortest -vf drawtext=fontfile=/root/Vera.ttf:fontsize=12:text='eyevinntechnology/toolbox-loopts':fontcolor=white@0.9:x=20:y=20:shadowcolor=black:shadowx=2:shadowy=1,drawtext=fontfile=/root/Vera.ttf:fontsize=200:text='%{localtime\:%T}':fontcolor=white@0.9:x=(w-tw)/2:y=250:shadowcolor=black:shadowx=2:shadowy=1,drawtext=fontfile=/root/Vera.ttf:fontsize=40:text='[%{n}/%{pts}]':fontcolor=white@0.9:x=(w-tw)/2:y=h-th-10:shadowcolor=black:shadowx=2:shadowy=1 -vcodec libx264 -preset veryfast -pix_fmt yuv420p -strict -2 -y -f mpegts -r 25 udp://239.0.0.1:1234?pkt_size=1316
ffmpeg -stream_loop -1 -i /mnt/Sunrise.mp4 -map 0:v -vcodec copy -bsf:v h264_mp4toannexb -f h264 -
ffmpeg -framerate 25 -fflags +genpts -r 25 -re -i -
-f lavfi -i anullsrc=r=48000:cl=stereo -c:a aac -shortest
-vf "drawtext=fontfile=/root/Vera.ttf:fontsize=12:text='eyevinntechnology/toolbox-loopts':fontcolor=white@0.9:x=20:y=20:shadowcolor=black:shadowx=2:shadowy=1,drawtext=fontfile=/root/Vera.ttf:fontsize=200:text='%{localtime\:%T}':fontcolor=white@0.9:x=(w-tw)/2:y=250:shadowcolor=black:shadowx=2:shadowy=1,drawtext=fontfile=/root/Vera.ttf:fontsize=40:text='[%{n}/%{pts}]':fontcolor=white@0.9:x=(w-tw)/2:y=h-th-10:shadowcolor=black:shadowx=2:shadowy=1"
-vcodec libx264 -preset veryfast -pix_fmt yuv420p -strict -2 -y -f mpegts -r 25 udp://239.0.0.1:1234?pkt_size=1316
docker run --rm -p 9998:9998/udp -v $PWD:/mnt eyevinntechnology/toolbox-loopts IN.mp4 udp://host.docker.internal:9998?pkt_size=1316 --withtc
udp://@127.0.0.1:9998
docker run --rm -p 9998:9998/udp -v $PWD:/mnt eyevinntechnology/toolbox-loopts IN.mp4 udp://host.docker.internal:9998?pkt_size=1316 --withtc --withaudio
docker run --rm -p 9998:9998/udp -v $PWD:/mnt eyevinntechnology/toolbox-loopts -h

Secure Reliable Transport

docker run --rm -p 9998:9998/udp -v $PWD:/mnt eyevinntechnology/toolbox-loopts IN.mp4 "srt://0.0.0.0:9998?pkt_size=1316&mode=listener" --withtc
srt://@127.0.0.1:9998

--

--

--

We are consultants sharing the passion for the technology for a media consumer of the future.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Eyevinn Technology

Eyevinn Technology

We are consultants sharing the passion for the technology for a media consumer of the future.

More from Medium

WRITE-BUG (Students’ GitHub and More)

Securely Connect to Redis and Utilize Benchmark Tools

Deploying Open Source Observability Stack in AWS — Part — II

Sometimes, building your own Prometheus Exporter for monitoring Cloudflare Workers is the best…

The outages fighters