VideoHelp Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. 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?
    Quote Quote  
  2. 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)
    Quote Quote  
  3. Use clever FFmpeg-GUI.
    Load your mkv, main, multiplex, your streams are already loaded, select mp4 as container, set your target file, click on multiplex. done.
    If your subtitle is srt, ass or ssa then it will be automatically converted to mov_text, the only subtitle accepted by the mp4 container.
    Last edited by ProWo; 31st May 2021 at 10:13. Reason: typo
    Quote Quote  
  4. Originally Posted by ProWo View Post
    Use clever FFmpeg-GUI.
    Load your mkv, main, multiplex, your streams are already loaded, select mp4 as container, set your target file, click on multiplex. done.
    If your subtitle is srt, ass or ssa then it will be automatically converted to mov_text, the only subtitle accepted by the mp4 container.
    Thanks for the suggestion, but, I am trying to find an answer to the ffmpeg command. And, I was simply asking why ffmpeg loses subtitles when doing a simple copy. Plus, you missed the part where I was converting MP4 to MP4, not from MKV to MP4.
    Last edited by the_steve_randolph; 31st May 2021 at 11:28.
    Quote Quote  
  5. Originally Posted by the_steve_randolph View Post
    And, I was simply asking why ffmpeg loses subtitles when doing a simple copy. Plus, you missed the part where I was converting MP4 to MP4, not from MKV to MP4.
    Try
    Code:
    ffmpeg -i input.mp4 -c:v copy -c:a copy -c:s mov_text output.mp4
    Quote Quote  
  6. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    another thing to try is explicitly tell FFMPEG to map all streams .. should be something like...

    Code:
    ffmpeg -i input.mp4 -map 0 -c copy output.mp4
    Quote Quote  
  7. 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 15:45. Reason: typos and removing the link to an app added by the site - but, can't get rid of the smilie
    Quote Quote  
  8. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by the_steve_randolph View Post
    As a side note, how can I put a command statement inside of a "Code:" box like y'all have done?
    You can manually enclose the code part into [CODx][/CODx] tags (where x = letter E) .. or use the # icon ("Wrap CODE text around selected text") from the formatting bar (not available when you quick reply)
    Quote Quote  
  9. 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?
    Quote Quote  
  10. Originally Posted by krykmoon View Post
    You can manually enclose the code part into [CODx][/CODx] tags (where x = letter E) .. or use the # icon ("Wrap CODE text around selected text") from the formatting bar (not available when you quick reply)
    Code:
    ffmpeg -i input.mp4 -c:v copy -c:a copy -c copy output.mp4

    Thanks!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!