hls-test/make-standalone.sh
2023-02-13 14:05:37 -08:00

40 lines
2.2 KiB
Bash
Executable file

MOVFLAGS="-movflags +frag_keyframe+empty_moov+default_base_moof+faststart"
HLSFLAGS="-hls_time 10 -hls_list_size 0 -hls_segment_type fmp4 -hls_flags single_file -hls_playlist_type vod"
RES_MAIN="-s 854x480"
RES_SMALL="-s 256x144"
BITRATE_HI="-b:v 1024k"
BITRATE_LO="-b:v 768k"
VIDEO_H264="-vcodec h264 $BITRATE_HI"
VIDEO_JPEG="-vcodec mjpeg $BITRATE_LO -s 426x240"
VIDEO_VP8="-vcodec libvpx -cpu-used 4 $BITRATE_HI"
VIDEO_VP9="-vcodec libvpx-vp9 -row-mt 1 -cpu-used 4 $BITRATE_LO"
AUDIO_VORBIS="-acodec libvorbis -ac 2 -ar 44100 -vb 128k"
AUDIO_OPUS="-acodec libopus -ac 2 -ar 48000 -vb 96k"
AUDIO_MP3="-acodec libmp3lame -ac 2 -ar 44100 -vb 128k"
AUDIO_AAC="-ac 2 -ar 44100 -vb 128k"
#INFILE=polyphon.ogv
INFILE=caminandes-llamigos.webm
# Flat WebM
ffmpeg -i $INFILE $RES_MAIN $VIDEO_VP9 $AUDIO_OPUS -y standalone-vp9-opus.webm || exit 1
ffmpeg -i $INFILE $RES_MAIN $VIDEO_VP9 -an -y standalone-vp9.webm || exit 1
ffmpeg -i $INFILE $RES_MAIN $VIDEO_VP8 $AUDIO_VORBIS -y standalone-vp8-vorbis.webm || exit 1
ffmpeg -i $INFILE $RES_MAIN $VIDEO_VP8 -an -y standalone-vp8.webm || exit 1
# Flat MJPEG+MP3/AAC/none mov
ffmpeg -i $INFILE $RES_SMALL $VIDEO_JPEG -an $MOVFLAGS -y standalone-mjpeg.mov || exit 1
ffmpeg -i $INFILE $RES_SMALL $VIDEO_JPEG $AUDIO_MP3 $MOVFLAGS -y standalone-mjpeg-mp3.mov || exit 1
ffmpeg -i $INFILE $RES_SMALL $VIDEO_JPEG $AUDIO_AAC $MOVFLAGS -y standalone-mjpeg-aac.mov || exit 1
# Standalone HLS
ffmpeg -i $INFILE $RES_SMALL $VIDEO_JPEG $AUDIO_AAC $HLSFLAGS -hls_segment_filename standalone-mjpeg-aac.mp4 -y standalone-mjpeg-aac.m3u8 || exit 1
ffmpeg -i $INFILE $RES_SMALL $VIDEO_JPEG $AUDIO_MP3 $HLSFLAGS -hls_segment_filename standalone-mjpeg-mp3.mp4 -y standalone-mjpeg-mp3.m3u8 || exit 1
ffmpeg -i $INFILE $RES_SMALL $VIDEO_JPEG -an $HLSFLAGS -hls_segment_filename standalone-mjpeg.mp4 -y standalone-mjpeg.m3u8 || exit 1
ffmpeg -i $INFILE $RES_MAIN $VIDEO_VP9 $AUDIO_AAC $HLSFLAGS -hls_segment_filename standalone-vp9-aac.mp4 -y standalone-vp9-aac.m3u8 || exit 1
ffmpeg -i $INFILE $RES_MAIN $VIDEO_VP9 $AUDIO_MP3 $HLSFLAGS -hls_segment_filename standalone-vp9-mp3.mp4 -y standalone-vp9-mp3.m3u8 || exit 1
ffmpeg -i $INFILE $RES_MAIN $VIDEO_VP9 -an $HLSFLAGS -hls_segment_filename standalone-vp9.mp4 -y standalone-vp9.m3u8 || exit 1