Log in

View Full Version : Getting all subtitles when merging streams


LonelyPixel
15th June 2015, 17:52
I'm using eac3to to demux m2ts playlists and streams to recode them with the tracks I want. I also use it to merge multiple m2ts streams into one final video file.

A problem I now found is that some of the source files have a subtitle track and others not. I found out that I get to see all the tracks that appear in the first source file. Unfortunately, I need to merge these files so that the first one does not have a subtitle track. When I do that, I will lose the subtitle tracks in the later files.

How can I force eac3to to show me and extract tracks that only appear in a later file?

Here's the syntax I use:

eac3to 00101.m2ts+00102.m2ts+00103.m2ts+00104.m2ts+00105.m2ts

I then read the output of the program and find all tracks.

Ghitulescu
15th June 2015, 20:38
Demux them then change the starting time of the first subtitle accordingly :) then remux them with joining.

LonelyPixel
16th June 2015, 07:05
You mean demux every single stream individually, then assembly the whole thing one by one? Hm, I was hoping not to do that since eac3to can list tracks and demux them in one.

Ghitulescu
16th June 2015, 09:33
It is in theory possible to mix files with different stream arrangements, including differences in number, position or even codec. It requires that updated PMTs are always sent along, so that the decoding device would know how to deal with the streams.

This compatibility is restricted to software or hardware that allow changes of streams on-the-fly.

Anyway, if the streams are identical in all aspects but some have an additional subtitle stream while others don't (but the subtitle stream is identical across all files, except of course timing and subpictures :) ) then you can try the good old DOS command COPY /B file1+file2+file3+... result.m2ts.

LonelyPixel
19th June 2015, 21:52
Oh I was wrong, the subtitle is recognised by eac3to. I just didn't see it at first because it has no language. But the extracted .sup file seems broken somehow. When merging it all in a .mkv file with mkvmerge, the video cannot be seeked to in a certain time range. Also, the subtitle is played at 0:00 but can only be seen later. When applying a delay to that track, it is at the correct time, but still it cannot be seen until it's almost over. The seeking issue is also still there. I have no idea what's the problem with that file, but I also don't understand what the PGS format actually contains. There doesn't seem to be a file format description available.

Copy-appending the m2ts files only resulted in broken source files and broken results as well, so that didn't help.

LonelyPixel
20th June 2015, 10:22
So any hacks with the source files failed.

Now I tried to process each group of files with different track layouts separately and merge them with mkvmerge afterwards. But it complains that some tracks are not in all files. This is true and I know that. I want to append the files anyway.

I think I need to add a fake subtitle track in the other files so that the merge will work. How can I create an empty PGS subtitle file with a specified length? eac3to and mkvmerge don't seem to be able to make one theirselves.

hubblec4
23rd June 2015, 06:30
I think I need to add a fake subtitle track in the other files so that the merge will work. How can I create an empty PGS subtitle file with a specified length? eac3to and mkvmerge don't seem to be able to make one theirselves.

I mux always my seasons(many files) with my chapteEditor in the Matroska Menu Editor, and save the menu.xml in a separate menu.mkv.
So i need all Episode.mkv with the same count of tracks, but sometimes not all episodes have the same count.

in the attachments you will find a blank PGS.sup that i use for such Episode.mkv's.