ffmpegraspberry-pisrtomxplayervideo-subtitles

Can OMXPlayer show SRT subtitles embedded in a mp4 file?


Is there a way to get OMXPlayer to show the embedded subtitles in foo.mp4 without first extracting the subtitles with ffmpeg to foo.srt, and without hardcoding the subtitles into foo.mp4?


Solution

  • The problem was solved by adding SRT subtitles to a MKV-container instead of MP4:

    ffmpeg -i infile.mp4 \
    -f srt -i subtitles.srt \
    -c:v copy -c:a copy -c:s srt \
    -metadata:s:s:0 language=nor \
    outfile.mkv
    

    Subtitles can than be displayed by starting OMXPlayer with -t 0

    omxplayer -t 0 outfile.mkv