I am researching a seemingly different conversion problem and I ran across this basic issue. The MP4 file has no chapters, a single title (that is, no multiple titles like some DVDs), a single audio track, a single video track, and, a single subtitle track. Just as a test to prove that nothing should change, I ran this command:
ffmpeg -i input.mp4 -c copy output.mp4
When I looked at the output file, the subtitle track is missing. Obviously, I don't want that to happen, but, I don't know why it happened. I have attached the console output from that command. Anybody know what is going on?
+ Reply to Thread
Results 1 to 10 of 10
I see from another thread that a user lost subtitles while converting from MK4 to MP4. One reply mentioned that MP4 does not support as many subtitle formats as MKV. I know that subtitles can be text-based or image-based, but, I don't know what other formats there might be. I am trying to learn and use ffmpeg for all of my conversions. According to the ffmpeg console output, the information related to the MP4 subtitle track is:
mov_text (tx3g / 0x67337874), 793,72, 0 kb/s (default)
Last edited by ProWo; 31st May 2021 at 11:13. Reason: typo
Last edited by the_steve_randolph; 31st May 2021 at 12:28.
OK, both of these solutions worked:
ffmpeg -i input.mp4 -c:v copy -c:a copy -c mov_text output.mp4
ffmpeg -i input.mp4 -map 0 -c copy output.mp4
When I do my original statement, I look at the console output and towards the end, it has a label called "stream mapping" that is missing the subtitle stream. With those other two commands, under that label it has the subtitle stream listed like this:
Stream #0:2 -> #0:2 (copy)
I accept that these work and my original statement does not work. Now the question is: why?
Why is "-c copy" getting the video and audio streams but not the subtitle stream? Maybe ffmpeg's default stream handling doesn't have enough love/respect for the subtitle stream?
BTW, this statement also works:
ffmpeg -i input.mp4 -c:v copy -c:a copy -c copy output.mp4
As a side note, how can I put a command statement inside of a "Code:" box like y'all have done?
Last edited by the_steve_randolph; 31st May 2021 at 16:45. Reason: typos and removing the link to an app added by the site - but, can't get rid of the smilie
OK, I found this: [link](https://ffmpeg.org/ffmpeg.html#Automatic-stream-selection)
Under "4.1.1 Automatic stream selection" there is this statement:
"for subtitles, it is the first subtitle stream found but thereís a caveat. The output formatís default subtitle encoder can be either text-based or image-based, and only a subtitle stream of the same type will be chosen."
So, given my issue, this would seem to indicate that the default subtitle encoder for MP4 is NOT text-based since my MP4's subtitle track is "mov_text". That would explain why the "Stream #0:2 -> #0:2 (copy)" is not shown in the console output from my original statement but "Stream #0:2 -> #0:2 (copy)" is shown/included in the two solutions provided above.
Am I understanding/interpreting this correctly?