I'm currently in the process of converting all my Mkv's to mp4 because I use plex and I have audio and video sync issues with mkv's , but not with mp4's ,so as the title says I want to add subs and chapters to my new mp4 files..ive tried various things like drax for chapters and although it says completed the chapters don't actually work...so any help would be much appreciated...thnx
+ Reply to Thread
Results 1 to 18 of 18
-
-
Do the original mkv files already have chapters and subtitles embed? Then I would recommend using VidCoder or HandBrake for conversion to mp4 because they will keep the chapters and can also copy the subtitles (burn-in all types, or ASS or srt as simple text).
Do you know what causes your mkvs to stutter? Variable framerate? Too high bitrate? Maybe outputting as mkv (but coded differently than the source mkv) may also solve the problem.
If you only want to add chapters and subtitles to already existing mp4 files, mp4box can do that.
mp4box -add "subtitles.srt" -add "chapters.txt:chap" "video.mp4"
(video.mp4 will be overwritten in-place. Make a backup first.) -
My mkv files dont stutter on plex, they actually stream perfect however the audio is slightly out of sync and it drives me nuts..mp4 however works perfectly in sync hence why I'm converting.. I don't want to re encode an entire film just for subs or chapters id like a program like mkv merge where I can just add them to the container file..i use shana encoder to convert to mp4 and it takes about a minute to do but I can't find a way of adding the metadata from the original mob.. I've extracted it from the mkv but just can't find a program to re add to the mp4...ill try the software you suggested and report back later...thanks
-
You could also try ffmpeg:
ffmpeg -i "input.mkv" -map 0:v -map 0:a -map 0:s -map_chapters 0 -c:v copy -c:a copy -c:s mov_text "output.mp4"
Or with only audio re-encoding to stereo aac:
ffmpeg -i "input.mkv" -map 0:v -map 0:a -map 0:s -map_chapters 0 -c:v copy -c:a aac -ac 2 -c:s mov_text "output.mp4"
I think BOX4 is a GUI that basically does the same. -
Chapters are automatic. For subtitles you can set a default in "settings". Or after adding an input file to the list click on "tracks".
-
ok heres what ive got so far...installed ffmpeg and all required files, installed myffmpeg gui and box4..the outcome is the same with both programs..on myffmpeg the i set the video to passthrough, the audio to aac , i added subs and chapters from the source file..the outcome is the subtitles lose their size and go really small, the chapters work BUT it also adds them as an extra subtitle file which is weird..i then tried box4 and the outcome is exactly the same..im stumped
-
ok after a few attempts box4 doesnt work 100%..it adds my chapters as a subtitle stream which is weird also there isnt enough control over audio properties etc..so im gonna scrap that one...so moving onto to command lines, this confuses the hell out of me even where to start...i basically want an mkv to mp4 with passthrough video, dts to aac audio but i also want the audio to be maximised as it loses volume under the conversion process..i also want to keep all available subs and chapters..if this is possible id like to know how...thanks
-
There are different ways to store chapters in mp4. I think BOX4/ffmpeg use two ways to make sure they are compatible with every player.
Start with the examples I gave?
BOX4 can do all of that. -
just trying the command line to see how that works
Last edited by rumblylwc; 22nd Apr 2017 at 19:46.
-
Ancient thread resurrection, but here's how I do it:
Open mp4 in Avidemux. Edit video losslessly as necessary in there cutting off extraneous video pre+post, resave then reload in Avidemux. Use the time markers displayed in Avidemux to create a list of chapters at your chosen time points in MKVToolNix GUI (which has an excellent tool for doing this). You edit the names of the chapters too in here if you wish, or just leave blank or have generic names like Chapter 1, Chapter 2 etc. whatever you prefer. Leave MKVToolNix GUI open.
Now insert the mp4 into the open session of MKVToolNix with the chapters you've created in it. You're going to create an MKV, but this is just a temporary step in order to get back to MP4+chapters again. Mux the mp4 into an mkv and save the chapters you created into the mkv after the muxxing has finished. Now you have an mkv version of the original mp4 with working chapters and no lossy re-encoding required. The cut editing by Avidemux is lossless and the remux conversion to mkv is also lossless.
Now to get back to mp4 again with the mkv chapters intact, you need to losslessly remux again using XMedia Recode. There is a built-in preset called mp4 (stream copy). Use that as it involves no re-encoding at all. It just copies the video and audio streams as they are and remuxes back to mp4 container format. Importantly it also copies already present chapter markers as well and includes them in the resulting mp4.
At the end you will have a working mp4 with chapter markers you created and no quality loss at all from the original mp4 without chapters you started with.
Source mp4 -> edit in Avidemux -> first edited mp4 -> Avidemux again to get time stamps for new chapters -> Create chapters in MKVToolNix -> MKVToolNix to create MKV -> New mkv file with chapters -> XMedia Recode remux -> end result mp4 with chapters -> Celebrate, you're done! -
BOX4 appears to not deal with chapters at all. I can find no settings inside BOX4 to tell it how to deal with chapters. In testing, if you feed it an MP4 with chapters embedded, it will strip them out in the remux it does. I can't see that BOX4 will help in any way with adding chapters. It's pretty good for getting rid of chapters though if that's what you want to do.
-
You can try this option
https://ffmpeg.org/ffmpeg-formats.html#Metadata-1
https://ikyle.me/blog/2020/add-mp4-chapters-ffmpeg
I assume this would work for audio m4a tracks as well. Great for one track albums.
Similar Threads
-
ffmpeg: Concatenating MP4 files adding chapters for each one
By Keyser in forum Video ConversionReplies: 6Last Post: 12th May 2022, 17:19 -
Adding Chapters To Mp4 File
By wulf109 in forum Video ConversionReplies: 5Last Post: 6th Sep 2017, 21:35 -
Adding original subs to extended scenes where translated subs missing
By SidDan in forum SubtitleReplies: 2Last Post: 6th Aug 2015, 03:57 -
adding permanent subs to mp4
By xtwist3dx in forum Newbie / General discussionsReplies: 15Last Post: 18th Mar 2014, 19:28 -
MKV w/SSA/ASS soft subs to MP4 w/hard subs using Format Factory
By Budman1 in forum Latest Video NewsReplies: 0Last Post: 12th Oct 2012, 23:59