Preparing Video files for roku media player on tcl

Supported media file types

Different Roku devices support different formats. Newer firmware may support additional formats. The type of audio formats supported is dependent on the type of TV or A/V receiver (AVR) your Roku device is connected to. Formats supported by your Roku device can be viewed by accessing the ?/Help pages from the Media Device and the Media Type selection screens.

The following file formats are supported:

Video – H.264/AVC (.MKV, .MP4, .MOV)
Audio – AAC (.MKV, .MP4, .MOV); MP3(.MP3, .MKV); FLAC (.FLAC, .MKV), PCM (.WAV, .MKV, .MP4, .MOV), AC3/EAC3 (.MKV,.MP4. .MOV, .AC3), DTS (.MKV, .MP4, .MOV,.DTS), ALAC (.MKV, .MP4, .MOV, .M4A), Vorbis (.OGG,.MKV,.WEBM)
Playlists –.M3U, .M3U8, .PLS
Image – JPG, PNG, GIF (non-animated)

The following media formats are supported on Roku devices that support 4K

4K Video – H.265/HEVC (.MKV, .MP4, .MOV); VP9 (.MKV, .WEBM) and AV1 (.MKV, MP4) on some Roku devices
4K Video – H.264 (Roku Premiere, Premiere+, and Ultra only)

The following media formats are supported on Roku devices that support 8K

8K Video – AV1 (.MKV, MP4) and H.265/HEVC (.MKV, .MP4)

The following media formats are supported on Roku TV models and some Roku players

Video – H.262 (.MKV)

Note:
    The Roku Media Player channel will not display unsupported file types or files it has determined cannot be played by your Roku device.
    DRM-protected content is not supported.

Audio

Problems are always with DTS so convert those to dolby digital add as new audio stream and keep original

Video

Stick to mkv (browser support?) for container format and for video encoding stick to h.265 or x.264 vp9 and av1 will slow to a halt, next time shopping for a tv take note that the tv has enough processing power to handle these formats

Subtitles

roku doesn’t like image based subtitles, stick to text based

1 - find embedded subtitles and their types

ffprobe -v -quiet -show_streams -select_streams s -print_format "json" file.mkv | jq '.streams[] | {name: .codec_name}'
 
Output:
{
    "name": "subrip"
}
{
    "name": "hdmv_pgs_subtitle"
}
 

2 - If there are no subrip subtitles there are two options 2.1 - download subtitle with subliminal, opensubtitles as example -f -> force download even if subtitle already exists -l -> language subliminal —opensubtitles ‘username’ ‘password’ download -f -l en file.mkv

2.2 - If subliminal fails to get text based subs, then a last resort is to convert image based subtitles to text based with subtitle edit

3 - Is the subtitle synced? A bit more challenging to address this one without adding complexity

putting it all back together

After the right audio file has been generated and subtitles fetched we append them to original file

prep files for expermineting or testing

create small segments of files for testing ffmpeg commands ss time -> start seeking time in seconds -t -> duration

ffmpeg -i input.mkv -ss 90 -t 10 -c copy output.mkv