[FFmpeg-user] Stuck with error when adding two subtitles

ffmpeg at bechhold.de ffmpeg at bechhold.de
Sat Feb 10 17:13:31 EET 2018


Hi,

I‘m new to the list and hope this is the right place for this issue.

I‘m using this command, to add non-english (alien) subtitles as forced
and the full english subtitles as regular second subtitle track:

ffmpeg -i movie-in.mp4 -i sub-alien.srt -i sub-full.srt -map 0:v -map
0:a -map 1 -map 2 -c:v copy -c:a copy -c:s mov_text -disposition:s:0
forced -metadata:s:s:0 language=eng -metadata:s:s:0 title="Alien only"
-metadata:s:s:1 language=eng -metadata:s:s:1 title="English" movie-out.mp4

ffmpeg starts copying, but after a while which seems to correlate with
lines in the ‚alien‘ subtitle file, I get multiple messages like this one.

[mp4 @ 0x4d0e020] Application provided duration: 2638848000 / timestamp:
4113897000 is out of range for mov/mp4 format
[mp4 @ 0x4d0e020] pts has no value

Both subtitles are added to the movie, but the ‚alien‘ subtitle isn‘t in
the right position, instead it starts right when the movie begins.

After searching the web, I added ‚-fflags +genpts‘ and
‚-fix_sub_duration‘ to the command, but to no avail.

ffmpeg -fflags +genpts -i movie-in.mp4 -fix_sub_duration -i
sub-alien.srt -fix_sub_duration -i sub-full.srt -map 0:v -map 0:a -map 1
-map 2 -c:v copy -c:a copy -c:s mov_text -disposition:s:0 forced
-metadata:s:s:0 language=eng -metadata:s:s:0 title="Alien only"
-metadata:s:s:1 language=eng -metadata:s:s:1 title="English" movie-out.mp4

Having read, that bad timing information in a subtitle file might cause
this issue, I used the full english subtitle twice. Once as an ‚alien‘
subtitle substitute with the ‚disposition:s:0 forced‘ option and as the
regular subtitle and it worked. No error messages and the subtitle was
automatically displayed as expected.

Assuming, something with the original ‚alien‘ subtitle file was wrong, I
copied the full english subtitle, deleted the non-alien lines, corrected
the indices and ran the command again. To my surpise again I got all the
error messages and the ‚alien‘ subtitles were in the wrong place.

To keep things short, here‘s what else I tried:
* Used only the minimum command (no metadata, language and disposition
setting)
* Only tried to set the ‚alien‘ subtitle
* Saved and used subtitle in all combinations as UTF-8, Western
(ISO-8859-15), with Windows and Linux line breaks.
* Used a new file, typing a couple of subtitle lines from scratch
* Converted subtitle from ‚srt‘ to ‚ass‘. (There‘s a bug report on
ffmpeg mentioning that rounding times by doing so helps with a similar
issue)
* Converted this ‚ass‘ file back to ‚srt‘
* Downloaded ffmpeg-3.4.1-64bit-static to use it instead my Ubuntu
ffmpeg 7:3.3.4-2 version
* Stripped all non-alien lines from the full subtitle file, but left the
indeces and timing information
* Copied the mp4 file to mkv
* Recoded the video to make sure, the video isn‘t part of the problem

None of this worked. Interestingly enough, I only have this issue with
three of my videos. There are at least two videos which I treated the
same way and the subtitles were added as expected.

Has anyone had the same issue, or would know, what else to try? I‘m
really running out of ideas of what else to try. Happy to provide more
information, if needed. Thanks.




More information about the ffmpeg-user mailing list