<commit_before>#!/bin/bash

FILE=$1
if [ -z "$FILE" ] ; then
  echo "usage: $0 <input file>"
  exit 1
fi

BIND_INTERFACE=eth0
MULTICAST_IP_ADDR="192.168.127.12"
AUDIO_UDP_PORT="5004"
VIDEO_UDP_PORT="5005"

BIND_ADDRESS=`ifconfig $BIND_INTERFACE | grep "inet addr:" | awk '{print \$2}' | awk -F: '{print \$2}'`
if [ -z "`gst-inspect-1.0 | grep omxh264enc`" ] ; then
  H264_ENC="x264enc quantizer=19"
else
  H264_ENC=omxh264enc
fi

gst-launch-1.0 filesrc location="$FILE" ! decodebin name="input" \
               input. ! videoconvert ! videoscale ! video/x-raw,width=720,height=480 ! $H264_ENC ! queue ! h264parse ! rtph264pay ! videosink. \
               input. ! audioconvert ! avenc_ac3_fixed bitrate=64000 ! rtpac3pay ! queue ! audiosink. \
               udpsink name="videosink" auto-multicast=true ttl-mc=3 bind-address=$BIND_ADDRESS host=$MULTICAST_IP_ADDR port=$VIDEO_UDP_PORT \
               udpsink name="audiosink" auto-multicast=true ttl-mc=3 bind-address=$BIND_ADDRESS host=$MULTICAST_IP_ADDR port=$AUDIO_UDP_PORT

<commit_msg>Updates for mpegts in RTP<commit_after>#!/bin/bash

BIND_INTERFACE=$1
FILE=$2

if [ -z "$BIND_INTERFACE" ] || [ -z "$FILE" ] ; then
  echo "usage: $0 <bind interface> <input file>"
  exit 1
fi

MULTICAST_IP_ADDR="192.168.127.12"
PORT="5004"

BIND_ADDRESS=`ifconfig $BIND_INTERFACE | grep "inet addr:" | awk '{print \$2}' | awk -F: '{print \$2}'`
if [ -z "`gst-inspect-1.0 | grep omxh264enc`" ] ; then
  H264_ENC="x264enc quantizer=19"
else
  H264_ENC=omxh264enc
fi

echo "Launching stream at rtp://$BIND_ADDRESS@$MULTICAST_IP_ADDR:$PORT"

gst-launch-1.0 filesrc location="$FILE" ! decodebin name="input" \
               input. !queue ! videoconvert ! videoscale ! video/x-raw,width=720,height=480 ! $H264_ENC ! queue ! h264parse ! mux. \
               input. ! queue ! audioconvert ! avenc_ac3_fixed ! queue ! mux. \
               mpegtsmux name="mux" ! rtpmp2tpay ! \
               udpsink auto-multicast=true ttl-mc=3 bind-address=$BIND_ADDRESS host=$MULTICAST_IP_ADDR port=$PORT

{'fraction_non_alphanumeric': 0.14440611138491868, 'fraction_numerical': 0.0625924100542139, 'mean_word_length': 3.7209302325581395, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1917150', 'n_tokens_mistral': 878, 'n_tokens_neox': 786, 'n_words': 158}