#!/bin/bash

#ulimit -s 20480
ulimit -n 1000000
ulimit -i 1000000

INPUT_FILE="BBB_1080p_50fps_20Mbps_nobframes.ts"
#INPUT_FILE="timer_500mbps.ts"
#INPUT_FILE="white_noise_1080_264mbit_orig.mkv"
#INPUT_FILE=""

OUTPUT_MCAST="233.69.69.102:29102"
#OUTPUT_MCAST="233.67.67.100:27100"
#OUTPUT_IF="127.0.0.1"
OUTPUT_IF="10.10.17.219"
#UTPUT_IF="10.10.7.219"
#OUTPUT_IF="10.31.10.1"
#OUTPUT_IF="94.43.126.9"

ffmpeg -analyzeduration 50000000 -probesize 50000000 -thread_queue_size 64 -threads 64 -stream_loop -1 -re \
-i $INPUT_FILE \
-c:v copy \
-c:a copy \
-flush_packets 0 -f mpegts "udp://$OUTPUT_MCAST?overrun_nonfatal=1&fifo_size=286720000&localaddr=$OUTPUT_IF&ttl=16&pkt_size=1316"
