Skip to content

Instantly share code, notes, and snippets.

@rtucker
Created January 27, 2014 01:24
Show Gist options
  • Save rtucker/8641882 to your computer and use it in GitHub Desktop.
Save rtucker/8641882 to your computer and use it in GitHub Desktop.
#!/bin/bash
FONTFILE=/usr/share/fonts/truetype/freefont/FreeSerif.ttf
TEXT="bladeRF_ATSC_Demo_TBM2"
VIDEOFILE="tbm_tdf_2.mp4"
OUTFILE="tbm_tdf_2.ts"
FILTERS="-vf drawtext=fontfile=${FONTFILE}:text=${TEXT}:x=100:y=50:fontsize=72:fontcolor=white@0.6:box=1:boxcolor=black@0.2 -t 327"
VIDEO_CODEC="-vcodec mpeg2video -s hd720 -r 25"
VIDEO_QUALITY="-b:v:0 8M"
AUDIO_CODEC="-acodec ac3_fixed"
AUDIO_QUALITY="-b:a:0 384k -ar 48k -ac 2"
if [ -n "${VIDEOFILE}" ]; then
VIDEOFILE="-i ${VIDEOFILE}"
fi
if [ -n "${AUDIOFILE}" ]; then
AUDIOFILE="-i ${AUDIOFILE}"
fi
avconv -re \
${VIDEOFILE} ${AUDIOFILE} \
${VIDEO_CODEC} \
${FILTERS} \
${VIDEO_QUALITY} \
${AUDIO_CODEC} \
${AUDIO_QUALITY} \
-muxrate 19393000 -f mpegts \
-metadata service_name="${OUTFILE}" \
-metadata service_provider="BladeRF ATSC Demo" \
${OUTFILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment