Hardcoding SRT subtitles onto MP4 video

The place for all kinds of software for all kinds of operating systems.

Moderator: Dposcorp

Hardcoding SRT subtitles onto MP4 video

Postposted on Wed May 14, 2014 6:29 pm

This really shouldn't be so difficult, but apparently it is. Handbrake lacks this functionality, despite having a specific feature to add subtitles via SRT file. VLC supposedly has a conversion option that allows hardcoding of SRT files, but when I tried that, the audio wouldn't play through Windows Media Player, only through VLC, and even then, the subtitles still were not in the video.

All I want to do is take the MP4 video file and hardcode the subtitles into the video so that it will play without issue on anything that can play an MP4 video, such as game consoles. I'm getting frustrated at this point and there has to be a solution out there, any help is greatly appreciated
internetsandman
Gerbil
 
Posts: 64
Joined: Wed Jul 01, 2009 2:55 am

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Wed May 14, 2014 6:37 pm

I checked some of the foreign films I have encoded with Handrake into MP4 and the subtitles are there and hard coded, but they're not available in WMP only in VLC. I think that WMP doesn't support hardcoded subtitle tracks in MP4s if I recall correctly, WMC does however.

Edit: I'm saying hard-coded but I really mean embedded, from your post I was guessing you really meant embedded. Disregard my post if I'm wrong.
4670K@4.5GHz | Asus Z87-A | G.Skill 8GB 2400MHz CL10 | GTX 660 2GB | Samsung 840 120GB |Thermalright Macho | Lancool PC-K59
puppetworx
Gerbil XP
Silver subscriber
 
 
Posts: 484
Joined: Tue Dec 02, 2008 5:16 am

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Wed May 14, 2014 7:17 pm

puppetworx wrote:I checked some of the foreign films I have encoded with Handrake into MP4 and the subtitles are there and hard coded, but they're not available in WMP only in VLC. I think that WMP doesn't support hardcoded subtitle tracks in MP4s if I recall correctly, WMC does however.

Edit: I'm saying hard-coded but I really mean embedded, from your post I was guessing you really meant embedded. Disregard my post if I'm wrong.


I honestly don't know what the difference is, I just want the subtitles baked into the video feed so that I don't have to depend on the player to be able to see them in order to understand foreign language sections of a movie or something
internetsandman
Gerbil
 
Posts: 64
Joined: Wed Jul 01, 2009 2:55 am

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Wed May 14, 2014 8:19 pm

Yeah, you mean hardcoded then, I misinterpreted.

Hardcoded means 'baked in' as you say, rather than being additional data that you can turn on and off they're actually encoded as part of the video. Embedded means that they're additional overlaying data which you can turn on and off, they exist alongside the video and audio data in the same file.

You need to burn them in at the encoding stage, adding them after encoding just embeds them. This should be possible by adding the subtitle track in Handbrake and checking the 'Burned In' box.
4670K@4.5GHz | Asus Z87-A | G.Skill 8GB 2400MHz CL10 | GTX 660 2GB | Samsung 840 120GB |Thermalright Macho | Lancool PC-K59
puppetworx
Gerbil XP
Silver subscriber
 
 
Posts: 484
Joined: Tue Dec 02, 2008 5:16 am

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Wed May 14, 2014 9:59 pm

I have used mediacoder (http://www.mediacoderhq.com/download.htm) in the past for pretty much your scenario.

I had some high-res anime in .MKV format that had softsubs but I wanted to play it back on my phone but didnt really have the software on the phone (at the time) to play it back properly.

I kept the subs and quality was very good on the phone.
RtFusion
Gerbil
 
Posts: 12
Joined: Tue Jul 27, 2010 9:46 pm

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Thu May 15, 2014 12:15 am

puppetworx wrote:Yeah, you mean hardcoded then, I misinterpreted.

Hardcoded means 'baked in' as you say, rather than being additional data that you can turn on and off they're actually encoded as part of the video. Embedded means that they're additional overlaying data which you can turn on and off, they exist alongside the video and audio data in the same file.

You need to burn them in at the encoding stage, adding them after encoding just embeds them. This should be possible by adding the subtitle track in Handbrake and checking the 'Burned In' box.


I see no 'burn in' checkbox in the box with the relevant SRT file to be encoded in; there's a default checkbox, but the only burn in checkbox appears when I click the 'add' button, which adds a subtitle box with no option to include a subtitle file associated with it, just a 'foreign language scan' as the source.

RtFusion wrote:I have used mediacoder (http://www.mediacoderhq.com/download.htm) in the past for pretty much your scenario.

I had some high-res anime in .MKV format that had softsubs but I wanted to play it back on my phone but didnt really have the software on the phone (at the time) to play it back properly.

I kept the subs and quality was very good on the phone.


Thanks for the suggestion, I'll check it out now

Edit: Damn that application is complex, I tried it out for a bit but it wouldn't let me even start the encode and tbh it's way too daunting for this tired brain at this hour. Like I said I would have thought there would be a simple solution to this lol
internetsandman
Gerbil
 
Posts: 64
Joined: Wed Jul 01, 2009 2:55 am

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Thu May 15, 2014 12:48 am

Before finding that software, I too was looking for ways to playback anime on my phone and beam it to my TV (sadly, after the last update from Samsung for my SGS2 *Rogers LTE Model*, that feature has been removed) with no worries of subtitle issues.

Mediacoder was the best option that I found after many days looking. You can use the built in Wizard to guide you on what you want, the options provided are a lot. I usually had it all untouched, nothing downscaled and only had the subtitles captured to be hardcoded.

Do note however that (at least in my case) 10-bit encodes that have the softsubs won't appear after transcoding to whatever container you use, will only work with 8-bit encodes if you want the subtitles hardcoded.

As for playback, no issues with MPHC+Klite Codec Pack (although MPCHC by itself will play a bunch of files without codec packs). Used to use VLC quite a bit but had some quirky usability issues which made me move to MPHC.

EDIT: If you want to playback to a PS3 (assuming you have one), there is software called PS3 Media Server (http://www.ps3mediaserver.org/) but I had to do a lot of tinkering around to get subs shown from the PS3. Plus, you PC needs to be fast and so does your network as it does the transcoding on the fly, so it will be resource heavy on your PC. I no longer do this method. If I really wanted to playback anime on the TV (much of them are 10-bit encodes now), I would have to hook it up the laptop to the TV. Thankfully, there is wi-fi enabled mouse.keyboard control for android phones.

Similarly, UMS (http://www.universalmediaserver.com/) touts subtitle support which works provided that you have a separate .SRT (or other subtitle file) in the same directory as the video. You can use MKV Extract to get the subs out. Needed a replacement for PC ShareManager from Samsung as that doesn't support playing content off an External drive and using Symbolic links to fool it has at times made the entire storage subsystem to freeze forcing me to do a hard reset.
RtFusion
Gerbil
 
Posts: 12
Joined: Tue Jul 27, 2010 9:46 pm

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Thu May 15, 2014 1:27 am

RtFusion wrote:Before finding that software, I too was looking for ways to playback anime on my phone and beam it to my TV (sadly, after the last update from Samsung for my SGS2 *Rogers LTE Model*, that feature has been removed) with no worries of subtitle issues.

Mediacoder was the best option that I found after many days looking. You can use the built in Wizard to guide you on what you want, the options provided are a lot. I usually had it all untouched, nothing downscaled and only had the subtitles captured to be hardcoded.

Do note however that (at least in my case) 10-bit encodes that have the softsubs won't appear after transcoding to whatever container you use, will only work with 8-bit encodes if you want the subtitles hardcoded.

As for playback, no issues with MPHC+Klite Codec Pack (although MPCHC by itself will play a bunch of files without codec packs). Used to use VLC quite a bit but had some quirky usability issues which made me move to MPHC.

EDIT: If you want to playback to a PS3 (assuming you have one), there is software called PS3 Media Server (http://www.ps3mediaserver.org/) but I had to do a lot of tinkering around to get subs shown from the PS3. Plus, you PC needs to be fast and so does your network as it does the transcoding on the fly, so it will be resource heavy on your PC. I no longer do this method. If I really wanted to playback anime on the TV (much of them are 10-bit encodes now), I would have to hook it up the laptop to the TV. Thankfully, there is wi-fi enabled mouse.keyboard control for android phones.

Similarly, UMS (http://www.universalmediaserver.com/) touts subtitle support which works provided that you have a separate .SRT (or other subtitle file) in the same directory as the video. You can use MKV Extract to get the subs out. Needed a replacement for PC ShareManager from Samsung as that doesn't support playing content off an External drive and using Symbolic links to fool it has at times made the entire storage subsystem to freeze forcing me to do a hard reset.


What I'm trying to do is encode a subtitle file onto an MP4 file, and load it onto a NAS to stream over my network to my TV (either to a smart TV or to a game console), plus streaming over the network to a mobile device, so I basically need it to be a simple MP4 file with hardcoded subs, so that all the server has to do is provide the file, and all the client has to do is play back the file, and I can understand whatever is being said in non-english portions of the video.

I went through the setup wizard that Mediacoder gave me, and I knew pretty much what all of the options were, and tailored it to what I needed and what my computer could do (nvidia CUDA, because I have a GTX 680 and I thought it would be nice to leverage that power) but when it came time to start the transcode, after I had selected the video file and SRT file, it wouldn't start the encode, telling me the coder or something wasn't available, even though it was and had been detected.
internetsandman
Gerbil
 
Posts: 64
Joined: Wed Jul 01, 2009 2:55 am

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Thu May 15, 2014 7:08 pm

Bump. Still looking for a solution :(
internetsandman
Gerbil
 
Posts: 64
Joined: Wed Jul 01, 2009 2:55 am

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Thu May 15, 2014 9:18 pm

Yeah it seems I was wrong again, that's strike two for me in this thread. :D

If you're using an srt file as a source you cannot burn in, the only supported subtitle formats for burning in according to the Handbrake wiki are sub, pgs and ssa. Given that info I googled and found this: http://forum.videohelp.com/threads/345198-Burned-in-subtitles-help. You have to first convert the .srt to .ssa using SubtitleEdit, then mux the .ssa with your mp4 using mkvmerge, then you can finally encode and burn in the subs with Handbrake. I checked and this method definitely does work, it sounds lengthy but the first two steps are very quick.
4670K@4.5GHz | Asus Z87-A | G.Skill 8GB 2400MHz CL10 | GTX 660 2GB | Samsung 840 120GB |Thermalright Macho | Lancool PC-K59
puppetworx
Gerbil XP
Silver subscriber
 
 
Posts: 484
Joined: Tue Dec 02, 2008 5:16 am

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Fri May 16, 2014 12:59 am

If you don't mind using a longer route, you can always use something like subtitle workshop, change the srt into something that works in handbrake, then do steps in handbrake, click on burn in. there you are, problem solved.
toki
Gerbil
 
Posts: 17
Joined: Fri Nov 08, 2013 3:55 pm

Re: Harcoding SRT subtitles onto MP4 video

Postposted on Fri May 16, 2014 1:02 am

^ The "Import SRT" button on Handbrake's Subtitle handling section actually allows you to load an SRT file without having to mux it in to your source.

Back in the day this hardcoded subs thing used to be done with Virtualdub, plus Vobsub (or your preferred subtitle plugin). More savvy encoders might have used an Avisynth server.
jihadjoe
Gerbil Team Leader
 
Posts: 248
Joined: Mon Dec 06, 2010 11:34 am


Return to General Software

Who is online

Users browsing this forum: No registered users and 4 guests