+1-323-909-4740 blog@hegars.com

Pull in an iso and stream it

ffmpeg -re -i MWC-D01.iso -map 0:1 -map 0:4 -c:v:1 copy -c:a:0 libmp3lame -b:a:4 192k -f mpegts udp://192.168.254.1:1234

fmpeg -re \
-i MWC-D01.iso \
-map 0:1 -map 0:4 \
-c:v:1 copy \
-c:a:0 libmp3lame -b:a:4 192k \
-f mpegts udp://192.168.254.1:1234

Input #0, mpeg, from ‘MWC-D01.iso’:
Duration: 00:23:16.13, start: 0.300300, bitrate: 45321 kb/s
Stream #0:0[0x1bf]: Data: dvd_nav_packet
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, smpte170m), 720×480 [SAR 32:27 DAR 16:9], max. 7700 kb/s, 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
Stream #0:2[0x20]: Subtitle: dvd_subtitle
Stream #0:3[0x21]: Subtitle: dvd_subtitle
Stream #0:4[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s

Mixing video and audio then streaming it

ffmpeg \
-v 40 `#set verbosity`\
-i Chairlift\ -\ Romeo-CncbXK6vURA.mp4 \
-i Chairlift\ -\ Romeo-CncbXK6vURA.m4a \
-map 0:0 -map 1:0 \
-c copy \
-c:v:0 libx264 -c:a:1 copy \
-maxrate 12M -bufsize 100M \
-f mpegts \
-bsf:v h264_mp4toannexb \
udp://192.168.254.1:1234?buffer_size=10240

Streaming a test pattern

ffmpeg -f lavfi -i smptehdbars=size=1280×720:rate=30 -f mpegts udp://192.168.254.1:1234

#!/bin/bash
#
#Generate test stream

ffmpeg \
-v 40 `#set verbosity`\
-re \
-f lavfi \
`#-i smptehdbars=size=1280×720:rate=30 `\
-i testsrc=size=1280×720 \
`#-codec:v:0 libx264 -preset veryfast -maxrate 3000k` \
-codec:v:0 libx264 \
-f lavfi \
-i sine=1000 \
-codec:a aac -b:a 128k -ar 44100 -ac 2 \
-vf drawtext=”fontfile=/Library/Fonts/Arial\ Black.ttf: \
text=’Test Transmission %{localtime\:%T}’: fontcolor=white: fontsize=24: box=1: boxcolor=black@0.5: \
boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2″ \
-f mpegts udp://192.168.254.1:1234