VideoHelp Forum
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. I have a .mp4 file that has about 15 soft-coded Time Text subtitles with different languages. I would like to just change the container from .mp4 to .mkv, (no reconversions) but keep the 15 soft-coded Time Text subtitles with different languages, but have the English subtitles to be forced on by default. I tried using MKVToolNix, but found out that it does not support Time Text subtitles. Any help would be appreciated.
    Quote Quote  
  2. Member
    Join Date
    Aug 2006
    Location
    United States
    Search Comp PM
    Originally Posted by vega69-ux View Post
    I have a .mp4 file that has about 15 soft-coded Time Text subtitles with different languages. I would like to just change the container from .mp4 to .mkv, (no reconversions) but keep the 15 soft-coded Time Text subtitles with different languages, but have the English subtitles to be forced on by default. I tried using MKVToolNix, but found out that it does not support Time Text subtitles. Any help would be appreciated.
    What kind of timed text subtitles do you have? I have MKVToolNix GUI installed, and it appears that MKVToolNix supports several timed text formats, SRT, VTT, SSA/ASS, USF, XML.
    Ignore list: hello_hello, tried, TechLord, Snoopy329
    Quote Quote  
  3. ffmpeg will automatically convert MP4 Timed Text to Advanced Sub Station Alpha ASS subs.

    Code:
    ffmpeg -i input.mp4 -c:v copy -c:a copy -map 0 output.mkv
    Quote Quote  
  4. Member
    Join Date
    Aug 2006
    Location
    United States
    Search Comp PM
    I haven't used TTML 1 but it seems to be XML-based. What happens if you change a file extension to XML and then try to mux the file? If muxing works, do you lose any features?

    Never mind. Try what jagabo suggested.
    Ignore list: hello_hello, tried, TechLord, Snoopy329
    Quote Quote  
  5. Thank you. However...

    1. The subtitles are very big, looks like x48 font. Also, they're displaying on the bottom left of the video. How do I center the fonts and make them the normal size?

    2. How do I include the metadata of the subtitles? It currently says "Track 1 - English" "Track 2 - Spanish" etc. The original file says "Italian - [Italian]" "English - English" etc.
    Quote Quote  
  6. Try forcing the sub(s) to SRT. I think this will work but I don't have an mp4 video with multiple subtitles to test:

    Code:
    ffmpeg -i input.mp4 -c:v copy -c:a copy -c:s srt -map 0 output.mkv
    Converting to SRT will lose all formatting info so you should get normal sized subs, centered horizontally. I don't know if it will keep the language metadata.
    Last edited by jagabo; 2nd Mar 2022 at 17:26.
    Quote Quote  
  7. I figured out the subtitles are tx3g. Is there a way to keep the metadata of the subtitles in the mp4, and just change the container from .mp4 to .mkv? No conversions? Lossless?
    Quote Quote  
  8. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by vega69-ux View Post
    I figured out the subtitles are tx3g. Is there a way to keep the metadata of the subtitles in the mp4, and just change the container from .mp4 to .mkv? No conversions? Lossless?
    to change mp4 to mkv just run ffmpeg -i input.mp4 output.mkv
    Quote Quote  
  9. Originally Posted by october262 View Post
    to change mp4 to mkv just run ffmpeg -i input.mp4 output.mkv
    That will encode the video, the audio, and convert the subs to ASS. And it will only include one of each stream type.

    As far as I know ffmpeg will not copy mp4 subs to mkv without converting them to ASS or SRT or other sub format.
    Quote Quote  
  10. Any ideas, if ffmpeg will not work if there is another way to achieve this?
    Quote Quote  
  11. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by vega69-ux View Post
    Any ideas, if ffmpeg will not work if there is another way to achieve this?
    there is another thread that deals with timed time text subtitles - https://forum.videohelp.com/threads/402515-Problem-with-extracting-tx3g-subtitles
    see if it'll be any help.
    Quote Quote  
  12. Even if you manage to get 3GPP subs (aka MP4 Timed Text as defined by MPEG-4 Part 17) into an MKV file you probably won't find any player that plays them.
    Quote Quote  
  13. Member
    Join Date
    Aug 2006
    Location
    United States
    Search Comp PM
    Do you know for certain that whatever you plan to use to play these files will even display 3GPP format subtitles inside an MKV container? You may need to convert the subs and make them external subtitles.

    It looks like jagabo and I had the same idea.
    Ignore list: hello_hello, tried, TechLord, Snoopy329
    Quote Quote  
  14. I was able to extract the Timed Texts with My MP4Box GUI to .srt files. However, it does not export the metadata. So I don't know which language is what. Ideas?
    Quote Quote  
  15. SRT is plain text. Use NotePad or WordPad to look at the text.
    Quote Quote  
  16. If your subtitle fonts are too large you can change them. ASS and SRT plain text that you can edit in NotePad or WordPad. Here the fontsize is set to 40 (right after Arial in the V4+ Styles section) near the start of the file:

    Code:
    [Script Info]
    ; Script generated by FFmpeg/Lavc58.134.100
    ScriptType: v4.00+
    PlayResX: 384
    PlayResY: 288
    ScaledBorderAndShadow: yes
    
    [V4+ Styles]
    Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
    Style: Default,Arial,40,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0
    
    [Events]
    Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
    Dialogue: 0,0:18:37.00,0:18:39.00,Default,,0,0,0,,Blow them up.
    Dialogue: 0,0:18:41.58,0:18:42.58,Default,,0,0,0,,MOVE IT!
    With SRT the font size is probably set on each line:

    Code:
    1
    00:18:37,021 --> 00:18:39,020
    <font size="40">Blow them up.</font>
    
    2
    00:18:41,604 --> 00:18:42,603
    <font size="40">MOVE IT!</font>
    You can perform a global replacement of <font size="40">.
    Quote Quote  
  17. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    As a follow on to jagabo.

    For my 'video.avi' I created a 'video.srt' file and a 'video.srt.style' file.
    i.e.
    3 files in the folder
    video.avi
    video.srt
    video.srt.style

    .srt
    Code:
    1
    00:00:54,421 --> 00:00:58,981
    Which is San Jose and that's only 40 kilometers
    
    2
    00:01:01,461 --> 00:01:07,461
    And well I'm going to the capital because I'm\hgonna go past the Honda dealer there to pick up\h\h
    .srt.style
    Code:
    [V4+ Styles]
    Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
    Style: Default,Arial,10,&H0000ff,&H0000ff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0
    By changing the font size and color in the .style file, MPC-HC played quite happily with the new size & color chosen.
    There was no need to burn in subtitles or add the stream to an mkv. I just had the 3 files in a folder and told MPC-HC to play the subtitles.
    The hexadecimal color shown above is for bright red.

    Not sure how all this helps. Not sure how it plays on anything other than a computer.
    But I learned stuff, and it was fun to play with.

    Cheers
    Last edited by pcspeak; 3rd Mar 2022 at 18:51.
    Quote Quote  
  18. Don't count on style files working with all players, especially outside a computer.
    Quote Quote  
  19. I have about 35-40 different multi-languages subtitles to a video.
    Quote Quote  



Similar Threads

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