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?
Asked
Active
Viewed 597 times
0
-
MP4 only supports "mov_text" subtitles. Are you sure OMXPlayer can read that format? – llogan Apr 05 '21 at 16:53
-
Yes, omxplayer --subtitles foo.srt foo.mp4 displays subtitles. – Eddy Sorngard Apr 05 '21 at 18:14
-
That's SRT. I was asking about the alleged embedded subtitles in the MP4 itself. – llogan Apr 05 '21 at 18:39
-
ffmpeg -i infile.mp4 \ -f srt -i subtitle.srt \ -c:a copy -c:v copy -c:s \ mov_text -metadata:s:s:0 \ language=nor \ -movflags +faststart \ outfile.mp4 – Eddy Sorngard Apr 05 '21 at 19:14
-
VLC displays the subtitles,omxplayer outfile.mp4 does not. – Eddy Sorngard Apr 05 '21 at 19:16
-
If you want to use omxplayer it appears you are stuck using SRT and will not be able to avoid the extra step of extracting. – llogan Apr 05 '21 at 19:22
-
Could MKV solve the problem? – Eddy Sorngard Apr 05 '21 at 21:23
1 Answers
1
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

Eddy Sorngard
- 149
- 1
- 12