katzenjoghurt
27th June 2020, 19:19
Hey ho,
so I've found my way to add forced subtitles into mp4 containers... but it's pretty insane.
So my source is an MKV with an MPEG-2 video and idx/sub subtitles.
So what I have to do now is:
1) Remux the MKV to MP4 with ffmpeg like this:
ffmpeg.exe" -i "input.mkv" -map 0 -c copy "output.mp4"
2) Extract the idx/sub subtitle files from the MKV using MkvExtractGUI
3) Convert the subs to srt (as only for srts the next step will work) using Subtitle Edit.
4) Add the srt using mp4box with this line:
mp4box.exe" -add "input.mp4" -add "subs.srt":txtflags=0xC0000000:lang=eng:name=Forced -new output.mp4
And NOW I got a file with autoplaying forced subs.
At least VLC will play it and MediaInfo will detect the subtitles as forced.
Just... the way back (MP4 to MKV) is a bit blocked now as ffmpeg won't like that new track and will complain with:
Subtitle codec 94213 is not supported.
Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
Btw... people keep mentioning this as a way to mark a subtitle track as forced... but it did nothing for me:
ffmpeg -i in.mkv -c copy -disposition:s:0 forced out.mp4
VLC was unimpressed, MediaInfo said "Forced: No".
Is there no easier way? :eek:
so I've found my way to add forced subtitles into mp4 containers... but it's pretty insane.
So my source is an MKV with an MPEG-2 video and idx/sub subtitles.
So what I have to do now is:
1) Remux the MKV to MP4 with ffmpeg like this:
ffmpeg.exe" -i "input.mkv" -map 0 -c copy "output.mp4"
2) Extract the idx/sub subtitle files from the MKV using MkvExtractGUI
3) Convert the subs to srt (as only for srts the next step will work) using Subtitle Edit.
4) Add the srt using mp4box with this line:
mp4box.exe" -add "input.mp4" -add "subs.srt":txtflags=0xC0000000:lang=eng:name=Forced -new output.mp4
And NOW I got a file with autoplaying forced subs.
At least VLC will play it and MediaInfo will detect the subtitles as forced.
Just... the way back (MP4 to MKV) is a bit blocked now as ffmpeg won't like that new track and will complain with:
Subtitle codec 94213 is not supported.
Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
Btw... people keep mentioning this as a way to mark a subtitle track as forced... but it did nothing for me:
ffmpeg -i in.mkv -c copy -disposition:s:0 forced out.mp4
VLC was unimpressed, MediaInfo said "Forced: No".
Is there no easier way? :eek: