I'm still having quite a fit with getting this working. What is even more frustrating is that Roku does not spit out an error, it just quits loading.
Can anybody else chime in on getting FFMPEG to work creating compliant files for Roku. Here is the Bash Script I'm using if it will help.
#!/bin/bash
VIDSOURCE="$1"
name=${VIDSOURCE%.*}
name=${name// /-}
echo """$name"""
#generate encoding key
keyFile="$name.key"
#save encoding key to file
openssl rand 16 > $keyFile
#storing keyfile reference in a file
#if we are successfully adding SSL, then http should be changed into https
printf ''$keyFile'\r'$keyFile'\r' > keyinfo
#Parameters corresponding to https://developer.apple.com/library/ios/technotes/tn2224/_index.html#//apple_ref/doc/uid/DTS40009745-CH1-SETTINGSFILES
RESOLUTION3="640x360"
RESOLUTION4="640x360"
RESOLUTION5="960x540"
RESOLUTION6="1280x720"
RESOLUTION7="1280x720"
RESOLUTION8="1920x1080"
FRAMERATE3="29.97"
FRAMERATE4="29.97"
FRAMERATE5="29.97"
FRAMERATE6="29.97"
FRAMERATE7="29.97"
FRAMERATE8="29.97"
TOTALBITRATE3="664k"
TOTALBITRATE4="1296k"
TOTALBITRATE5="3596k"
TOTALBITRATE6="5128k"
TOTALBITRATE7="6628k"
TOTALBITRATE8="8628k"
VIDEOBITRATE3="600k"
VIDEOBITRATE4="1200k"
VIDEOBITRATE5="3500k"
VIDEOBITRATE6="5000k"
VIDEOBITRATE7="6500k"
VIDEOBITRATE8="8500k"
AUDIOBITRATE3="64k"
AUDIOBITRATE4="96k"
AUDIOBITRATE5="96k"
AUDIOBITRATE6="128k"
AUDIOBITRATE7="128k"
AUDIOBITRATE8="128k"
AUDIOSAMPLERATE="48k"
KEYFRAME3="90"
KEYFRAME4="90"
KEYFRAME5="90"
KEYFRAME6="90"
KEYFRAME7="90"
KEYFRAME8="90"
VPROFILE3="baseline"
VPROFILE4="baseline"
VPROFILE5="main"
VPROFILE6="main"
VPROFILE7="main"
VPROFILE8="high"
LEVEL3="3.0"
LEVEL4="3.1"
LEVEL5="3.1"
LEVEL6="3.1"
LEVEL7="3.1"
LEVEL8="4.0"
SEGMENTSIZE="9"
PRESET="ultrafast"
# the order is relevant, as players will start playing the first stream usually before checking bandwidth
# you should choose which bitrates you want to offer, comment out the rest
echo '#EXTM3U' > $name.m3u8
echo '#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH='$TOTALBITRATE8',CODECS="avc1.640028,mp4a.40.2"' >> $name.m3u8
echo $name'-stream-high.m3u8' >> $name.m3u8
echo '#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH='$TOTALBITRATE7',CODECS="avc1.4d001f,mp4a.40.2"' >> $name.m3u8
echo $name'-stream-wifi4.m3u8' >> $name.m3u8
echo '#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH='$TOTALBITRATE6',CODECS="avc1.4d001f,mp4a.40.2"' >> $name.m3u8
echo $name'-stream-wifi3.m3u8' >> $name.m3u8
echo '#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH='$TOTALBITRATE5',CODECS="avc1.4d001f,mp4a.40.2"' >> $name.m3u8
echo $name'-stream-med.m3u8' >> $name.m3u8
echo '#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH='$TOTALBITRATE4',CODECS="avc1.42001f,mp4a.40.2"' >> $name.m3u8
echo $name'-stream-wifi1.m3u8' >> $name.m3u8
echo '#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH='$TOTALBITRATE3',CODECS="avc1.42001e,avc1.66.30,mp4a.40.2"' >> $name.m3u8
echo $name'-stream-low.m3u8' >> $name.m3u8
AUDIO_OPTS3="-c:a aac -strict -2 -b:a $AUDIOBITRATE3 -ac 2"
AUDIO_OPTS4="-c:a aac -strict -2 -b:a $AUDIOBITRATE4 -ac 2"
AUDIO_OPTS5="-c:a aac -strict -2 -b:a $AUDIOBITRATE5 -ac 2"
AUDIO_OPTS6="-c:a aac -strict -2 -b:a $AUDIOBITRATE6 -ac 2"
AUDIO_OPTS7="-c:a aac -strict -2 -b:a $AUDIOBITRATE7 -ac 2"
AUDIO_OPTS8="-c:a aac -strict -2 -b:a $AUDIOBITRATE8 -ac 2"
VIDEO_OPTS3="-c:v libx264 -x264opts keyint=90:min-keyint=90 -s $RESOLUTION3 -b:v $VIDEOBITRATE3 -force_key_frames "expr:gte\(t,n_forced*$KEYFRAME3\)" -profile:v $VPROFILE3 -level $LEVEL3"
VIDEO_OPTS4="-c:v libx264 -x264opts keyint=90:min-keyint=90 -s $RESOLUTION4 -b:v $VIDEOBITRATE4 -force_key_frames "expr:gte\(t,n_forced*$KEYFRAME4\)" -profile:v $VPROFILE4 -level $LEVEL4"
VIDEO_OPTS5="-c:v libx264 -x264opts keyint=90:min-keyint=90 -s $RESOLUTION5 -b:v $VIDEOBITRATE5 -force_key_frames "expr:gte\(t,n_forced*$KEYFRAME5\)" -profile:v $VPROFILE5 -level $LEVEL5"
VIDEO_OPTS6="-c:v libx264 -x264opts keyint=90:min-keyint=90 -s $RESOLUTION6 -b:v $VIDEOBITRATE6 -force_key_frames "expr:gte\(t,n_forced*$KEYFRAME6\)" -profile:v $VPROFILE6 -level $LEVEL6"
VIDEO_OPTS7="-c:v libx264 -x264opts keyint=90:min-keyint=90 -s $RESOLUTION7 -b:v $VIDEOBITRATE7 -force_key_frames "expr:gte\(t,n_forced*$KEYFRAME7\)" -profile:v $VPROFILE7 -level $LEVEL7"
VIDEO_OPTS8="-c:v libx264 -x264opts keyint=90:min-keyint=90 -s $RESOLUTION8 -b:v $VIDEOBITRATE8 -force_key_frames "expr:gte\(t,n_forced*$KEYFRAME8\)" -profile:v $VPROFILE8 -level $LEVEL8"
#if you want no segments and just one big file, choose one line or the other
#OUTPUT_HLS="-hls_time 10 -hls_list_size 0 -hls_wrap 0 -hls_allow_cache 0 -start_number 1 -segment_format mpegts -copyts -hls_flags single_file" #one big file
OUTPUT_HLS="-hls_time 10 -hls_key_info_file keyinfo -hls_list_size 0 -hls_wrap 0 -hls_allow_cache 0 -start_number 1 -segment_format mpegts -copyts" #multiple segments
ffmpeg -re -i "$VIDSOURCE" -y -threads 4 -preset $PRESET \
$AUDIO_OPTS3 $VIDEO_OPTS3 $OUTPUT_HLS $name-stream-low.m3u8 \
$AUDIO_OPTS5 $VIDEO_OPTS5 $OUTPUT_HLS $name-stream-med.m3u8 \
$AUDIO_OPTS8 $VIDEO_OPTS8 $OUTPUT_HLS $name-stream-high.m3u8 \
$AUDIO_OPTS4 $VIDEO_OPTS4 $OUTPUT_HLS $name-stream-wifi1.m3u8 \
$AUDIO_OPTS6 $VIDEO_OPTS6 $OUTPUT_HLS $name-stream-wifi3.m3u8 \
$AUDIO_OPTS7 $VIDEO_OPTS7 $OUTPUT_HLS $name-stream-wifi4.m3u8 \
rm keyinfo