View Full Version : MPEG2 in MKV
spyder
15th January 2004, 21:01
Well, after a long time and a lot of badgering by ChrisHJW and robUx4 to get it done, here is the first working alpha of mpeg2mkv. RIght now it is highly experimental. We may yet change the method for storing it so DO NOT use it for archiving or anything really important ;) I think we are doing it correctly but just to be on the safe side don't rely on it until it becomes beta :)
This version has been known to fail on large files rather often and sometimes on small ones. It has to do with the changing of timecodes in the middle of the file. I have been unable to fix this yet because it seems to be either a problem in the files themselves or in libavformat. either way I have decided to perform my own timestamping hopefully in the next version. It DOES NOT work on mpeg elementary streams yet, you will get a bunch of 0 timecode frames. It does however work with mpeg1, as a side effect of mpeg2 being an extension of 1, but it doesn't use the correct codec ID (V_MPEG1). The current version of this program uses an experimental media framework to perform the multiplexing and does not yet support muxing streams other than the mpeg2 video yet. Also, it doesn't yet set the aspect ratio in the MKV file though the files should play back in correct AR as it is stored in the video bitstream itself. Expect the next version to do this. This tool will eventually work on Linux, the only thing holding it back at the moment is that Milk(the media api) only has plugin handling code for windows. It is GPL and the source will be available from the VFRE CVS from corecodec within the next few days. I am currently cleaning the source up and will soon put Milk in it's own CVS too.
In order to play the files you need to replace(or install for the first time :) ) your MatroskaSplitter.ax with the one in this package. It maps the MPEG2 codec ID to the correct DShow media type etc. to allow playback with most mpeg2 decoders. Please let me know if you have problems with a particular decoder. MPEG1 will play out of it also. mpeg2mkv doesn't support muxing audio yet as I said above so you need the newest build of mkvmerge from http://www.bunkus.org/videotools/mkvtoolnix/win32/pre/ or if 0.8.2 has been released, http://www.bunkus.org/videotools/mkvtoolnix/ . The first link is to pre-builds and these aren't meant to be stable ;) But Mosu just added the feature to allow muxing these mpeg2 mkv's with audio yesterday. Every type I have tried has worked perfectly. Please tell me the results.
One last thing, you will probably see a bunch of "Dropping frame..." messages at the beginning of the muxing if you use a source that has been clipped out of another bitstream, ie a DVB broadcast or a cut out of a DVD/SVCD. This is due to the first GOP being open or broken. The frames which are lacking a reference are automatically dropped to close the first GOP. Becase of this, there's no easy way to sync the audio with the video except to manually try ;)
Here it is:
http://corecodec.org/project/showfiles.php?group_id=30&release_id=120
Spyder
PS: Mirror provided thanks to Insolit: http://moolabs.dcc.online.pt/atm/index.php?&direction=0&order=&directory=matroska
If you speak portuguese and like matroska, check out his site ;)
ChristianHJW
15th January 2004, 22:03
Finally :D ....
spyder
15th January 2004, 22:13
I forgot that the splitter is a debug version so you will need the DLLs in the system32_dlls.rar in order for it to even register. I put it on the release page with mpeg2mkv now.
KpeX
15th January 2004, 22:15
Thanks for that, Spyder.
The matroskasplitter.ax included with the package fails to regsvr32 on my box - error message is "LoadLibrary("matroskasplitter.ax")failed - The specified module could not be found."
The filesize seems a little off too - 804 kb for the included Splitter vs 320 kb for Gabest's last release.
Edit: Beat me to it, thanks :).
tiki4
15th January 2004, 22:47
First, thanks for something new to play with...
@KpeX: I think the splitter doesn't register because of missing debug dll's. This happened to me once. The filesize maybe off because Gabest usually compresses his stuff with UPX (at least MPC).
tiki4
Atamido
15th January 2004, 22:51
I just watched a music video with MPEG-2 for video and Vorbis for audio inside of MKV. How often do you see that?
spyder
15th January 2004, 22:54
The filesize is off because the DLLs are debug builds. Toff built them and he said he didn't know how to get the release ones to build.
robUx4
16th January 2004, 10:06
Originally posted by Pamel
I just watched a music video with MPEG-2 for video and Vorbis for audio inside of MKV. How often do you see that?
Not often... Yet :)
lazyn00b
17th January 2004, 01:37
Great news! I've been lurking in wait for MPEG2-in-MKV for a long time. My dream is to be able to store MPEG-2 (DVD or HD) and AC3 in Matroska for convenient viewing AND the easy ability to transcode to smaller files (MPEG-4 + AAC, VP6 + HE-AAC, etc) as needed - maybe using some super version of VirtualDubMod... all without dickering around with a lot of intermediary tools like DVD2AVI. Is such a scheme possible?
ChristianHJW
17th January 2004, 06:54
Originally posted by lazyn00b Great news! I've been lurking in wait for MPEG2-in-MKV for a long time. My dream is to be able to store MPEG-2 (DVD or HD) and AC3 in Matroska for convenient viewing AND the easy ability to transcode to smaller files (MPEG-4 + AAC, VP6 + HE-AAC, etc) as needed - maybe using some super version of VirtualDubMod... all without dickering around with a lot of intermediary tools like DVD2AVI. Is such a scheme possible? ... yes, i was bugging Cyrius already about that. He mentioed we could maybe use FFvFw to decode MPEG2 in VdubMod for editing/transcoding of MKV files with MPEG2, he will maybe look into this soon ....
spyder
18th January 2004, 03:39
One big plus is that it makes seeking very nice. Especially when the source file was b0rked in that respect. I love these music video in MPEG2 in MKV. :)
scrat
19th January 2004, 13:39
Hey!
I don't see much sense in muxing MPEG2 into matroska because MPEG4 makes smaller files and if I wanna have MPEG2 I burn a DVD for playback on a DVD-player.
If a DVD-player were able to play Matroska at the moment the muxing of MPEG2 into MKV would be great but in my opinion it's to early for MPEG2 in MKV and some other things would be more important (menus)...
greetings,
scrat
opsis81
19th January 2004, 17:35
I could capture MPEG-2 video with a reliable container.They I could remove the commercials very easily without using those awful MPEG Editors,demux the new streams and author my DVDs.
This makes a lot of sense for me...
Wilbert
19th January 2004, 22:41
Playback of my transport streams with a 2.0ch aac stream also sounds nice :D I guess hdtv mpeg2 streams are not supported yet?
ChristianHJW
20th January 2004, 03:11
Originally posted by Wilbert Playback of my transport streams with a 2.0ch aac stream also sounds nice :D I guess hdtv mpeg2 streams are not supported yet? ... i couldnt see why matroska should have a limit here, but maybe the existing MPEG2 decoders will have problems decoding HDTV ?
Originally posted by opsis81 I could capture MPEG-2 video with a reliable container.They I could remove the commercials very easily without using those awful MPEG Editors,demux the new streams and author my DVDs. This makes a lot of sense for me... ... YES !!! I was bugging TimJansen, the author of the XviD DirectShow encoder filter already about a realtime MPEG2 encoder filter based on FFMPEG, but he had to upgrade the XviD encoder to latest xvidcore.dll first ( done, will be uploaded as soon as i'm home from Asia ), and i dont knwo when he will have the time to do it.
Just imagine :
- capture with MPEG2 and FLAC into MKV ( to be able to invest all CPU in the video capture )
- edit the files in VirtualdubMod
- reencode into anything you like, using any video and audio codec
- convert the final MKV into a MPEG for DVD or SVCD burning
What you say :D ?
spyder
20th January 2004, 03:15
Well, I can't test with HDTV as i don't really have any samples. I did get one from a site recently but I haven't played with it yet. It's really likely that I am missing some headers or something with the current implementation.
PS: this only applies to HDTV. Other types of files should be muxed fine.
Wilbert
20th January 2004, 10:50
... i couldnt see why matroska should have a limit here, but maybe the existing MPEG2 decoders will have problems decoding HDTV ?
The problem is not the decoding of the video stream (although like Spyder says a normal mpeg2 decoder can't decode hdtv streams).
The problem is the splitting of video and the AAC stream (I think there is not dshow filter which can do that, although there exist programs which can: TSDemux and DVD2AVI_aac). Elecard has a dshow splitter for hdtv and AC3. I guess there are dshow decoders for AAC, but I'm not sure about that. That's why you can't play those files, at least not if you want to hear the audio :)
@spyder,
I will put a sample on my webpage this evening.
bill_baroud
20th January 2004, 14:11
mpeg2 + aac in matroska, with the matroska splitter, it should connect AAC to CoreAAC and the mpeg2 to a mpeg2 decoder, no :confused:
or i've missed something ?
opsis81
20th January 2004, 16:25
Just imagine :
- capture with MPEG2 and FLAC into MKV ( to be able to invest all CPU in the video capture )
- edit the files in VirtualdubMod
- reencode into anything you like, using any video and audio codec
- convert the final MKV into a MPEG for DVD or SVCD burning
What you say :D ?
ChristianHJW,this is :eek: :D :) :cool: :eek: :D .I think you understand what I mean!
Atamido
20th January 2004, 19:50
@bill_baroud: You are correct. I have no idea what Wilbert is talking about. There is no splitter that I can think of that decodes both MPEG-2 and any type of audio stream. All the streams in Matroska are split by the Matroska splitter and handled by individual DShow filters. (Hence the reason I could play MPEG-2 and Vorbis together.)
spyder
20th January 2004, 21:44
@Wilbert: do you mean you can't play the mkv files you made or did you not know this should work form mpeg transport streams too? :)
spyder
20th January 2004, 22:09
OK, I tested a little with the clip I found on the net. It was a TS but the TS doesn't work in mpeg2mkv. I used VLC to convert it to a PS and then it muxed. However, this file has strange timecodes. I am beginning to see that libavformat is broken in this respect and I will have to code a replacement for the timecoding :(. The good news is that the file played ;)
Wilbert
20th January 2004, 22:43
There is no splitter that I can think of that decodes both MPEG-2 and any type of audio stream. All the streams in Matroska are split by the Matroska splitter and handled by individual DShow filters.
I know ... Sorry, if I didn't make my self clear.
do you mean you can't play the mkv files you made
I didn't mean that, because I didn't try it. All I was asking is, is it possible to use hdtv transport streams instead of normal mpeg2 streams.
Then Spyder answered:
OK, I tested a little with the clip I found on the net. It was a TS but the TS doesn't work in mpeg2mkv. I used VLC to convert it to a PS and then it muxed.
Ok. Btw, what is VLC?
I will put some samples on my homepage later this evening.
After reading the first page I saw that audio muxing (contrary to what I assumed) is not supported yet, and you have to use mkvmerge. Sorry, that I didn't read it more carefully.
Atamido
21st January 2004, 08:09
Originally posted by Wilbert
Btw, what is VLC? VideoLAN Client (http://www.videolan.org/) Its a handy cross-platform video player that will stream across networks.
Saiya-Jin
21st January 2004, 20:42
Hmm, I was just wondering, maybe a feature could be included in a DVD ripping program such as DVD Decrypter, making possible for you to decrypt the DVD and save as .mkv instead of .vob, with all the audio, subtitles (can you attach a DVD subtitle in matroska, as they are?) and menus (in the future when menus is supported in matroska of course).
That would eliminate the need for demuxing the .ac3 tracks and making a .d2v project. And also it would be playable right of the bat (I know you can play .vob files, but playback seems a little weird at least in my system)
I'm not sure about the menus, does it have to be converted in order to be usable in matroska, or can you just put them there as they are?
Wilbert
21st January 2004, 22:17
Great program this VLC! It's able to play my ts+aac file :)
A small part of the ts file can be found here:
http://www.geocties.com/wilbertdijkhof/test.ts
I converted it to a ps file:
VLC -> streaming wizard ->
step 1: open the ts file
step 2: output methods: file -> incapsulated method (mpeg ps)
(I hope this is correct, but I wasn't sure.)
step 3: start streaming ...
I converted the ps file to a mkv file, but the playback stuttered.
ps, other hdtv files can be downloaded from this site:
http://206.159.116.24/public.htm
spyder
22nd January 2004, 05:33
I will try to work on fixing the muxer tomorrow so that it writes AR info and corrects timecodes. I just started back to school today so I fear I won't have much time for a little while.
Spyder
ChristianHJW
22nd January 2004, 15:10
Originally posted by Saiya-Jin Hmm, I was just wondering, maybe a feature could be included in a DVD ripping program such as DVD Decrypter, making possible for you to decrypt the DVD and save as .mkv instead of .vob, with all the audio, subtitles (can you attach a DVD subtitle in matroska, as they are?) and menus (in the future when menus is supported in matroska of course).
That would eliminate the need for demuxing the .ac3 tracks and making a .d2v project. And also it would be playable right of the bat (I know you can play .vob files, but playback seems a little weird at least in my system) ... :O :O !! Actually, thats a new, brilliant idea how MPEG2 in matroska could be used. the files could be directly opened in VirtualdubMod, no need to make a .d2v file anymore with DVD2AVI, so one complete step could be skipped, and at least one audio track ( i dont think VdubMod can handle more than audio for transcoding ) could be processed directly into MP3 ( not Vorbis though ), which could be quite nice in GKnot.
I'm not sure about the menus, does it have to be converted in order to be usable in matroska, or can you just put them there as they are? .. there is only a draft of our menue system so far, nothing usable yet, sorry ....
Saiya-Jin
23rd January 2004, 07:15
Originally posted by ChristianHJW
... :O :O !! Actually, thats a new, brilliant idea how MPEG2 in matroska could be used.
Well, thank you :D:D:D
.. there is only a draft of our menue system so far, nothing usable yet, sorry ....
Yea, kinda figured that. Oh well, nice to dream though ;)
E-Male
27th January 2004, 16:14
i can't register the splitter
it's the first time a .ax file doesn't work for me
spyder
27th January 2004, 18:33
Well, you need the debug dll's too, they are on the download page also.
E-Male
27th January 2004, 20:39
ok, my bad
tiki4
31st March 2004, 12:26
What's up? Quite some time now that no one posted in this thread. Are there any news?
tiki4
ChristianHJW
31st March 2004, 16:14
We are more or less waiting for S_O, who was in contact with spyder some time ago and told him he was working on a new, improved MPEG2 in MKV muxer .....
tiki4
31st March 2004, 16:26
Hm. Good news. You Matroska guys really have some plan of world domination :D
tiki4
S_O
31st March 2004, 18:42
We are more or less waiting for S_O, who was in contact with spyder some time ago and told him he was working on a new, improved MPEG2 in MKV muxer .....I´m working on it, I´ll set up a corecodec project and release a new version in the next days/weeks, currently I have a lot of work to do because I have to author/set up the new homepage/server of my school (also I have no idea how to do that, which makes things even more difficult and time-consuming).
Lobuz
15th June 2004, 02:04
Any news on mpeg2(.ts) in Matroska? Would it be possible to immitate multifile dvd structure with 1080i ts mpeg2? Or would it require finished control tracks?
Reagdrs
Lobuz
ChristianHJW
15th June 2004, 22:14
Spyder quit working on that as S_O had told him he had been working on a really nice app to mux MPEG2 into MKV. S_O hasnt been to the channel since some time now, i will ask him about the status as soon as i get hold of him.
Spyder quit working on that as S_O had told him he had been working on a really nice app to mux MPEG2 into MKV. S_O hasnt been to the channel since some time now, i will ask him about the status as soon as i get hold of him.Sorry, I haven´t continued work on it now, I´m very busy at the moment, I have to code the new homepage of my school (with PHP+SQL!), also there are a lot of exams etc. Also my PC was broken (the Elkos on my mainboard broke and the guy from ebay needed several weeks to send me the board I bought) for over a month and I only had my very old 350MHz system. But I didn´t forgot and I´ll continue the work when I find the time (probably in summer holidays).
spyder
21st August 2004, 22:27
I have attached a new version of mpeg2mkv. This is a complete rewrite from the last version I released which used libavformat to do the dirty work. It was really broken at the time. I wrote(or rather finished) my own MPEG video bitstream packetizer and this is the result. So far I'm quite pleased with it. I haven't found any files that gave it problems yet. It works on both MPEG-1 and MPEG-2. Please verify that the codec ID displayed by the program matches the format of your video because the detection of that could be wrong. The files are perfectly valid structure wise. They do lack proper cues but as the program can't process audio anyway, add the audio with mkvmerge and it will write proper cues.
The coolest feature is the fast seeking. Seeking in MPEG files tends to be slow, with Matroska it takes only milliseconds :) Please give your toughest tests. It only supports MPEG Video ES format right now so you have to demux the video stream usually. I will add PS and TS support as soon as I find the time. MPEG-1 decoding doesn't work with DirectShow based players ATM, however you can play them in VLC. If you have the latest Matroska Splitter for DShow you can play the MPEG-2 files as long as you have an MPEG2 decoder. So, have fun.
To use it, go to a command prompt and change to the directory where it is then execute "mpeg2mkv input.m2v output.mkv"
I plan to make a nice GUI for it once I have system streams supported and there's actually something to have in the GUI besides input and output file :).
PS: If you find the audio is not synced after you mux it as you normally would, this is probably due to your mpeg stream having an open first GOP. I close the first GOP which means I discard a couple of frames, usually 2 or 4. so try adjusting the delay of the audio accordingly. If you experience this problem let me know and I will help you or even add delay calculation into the app.
E-Male
23rd August 2004, 00:40
i tried alpha 0.2
i transmuxed a short svcd sample in 3 steps
-tmpgenc mpeg tools
-mpeg2mkv
-mmg
audio was in sync and it played in all my players that play matroska files
so far the good news, but i also got one problem:
changing the AR via the mkv-file doesn't work (it does with transmuxed avis)
i hope both the succes- and the bug-report help
spyder
23rd August 2004, 03:35
Yeah...I think the problem there is that the mpeg decoders respect the aspect ratio given in the mpeg stream first and you can't get it resized at the end of the graph. Perhaps it would work with ffdshow decoding the video but I think that's broken. I recommend setting the aspect ratio in both places for now.
E-Male
23rd August 2004, 06:38
ok i tested with an old svcd
demuxed, changed ar to anamorphic with restream, used your tool and then muxed with audio
works great in mpc and wmp
in winamp the ar is wrong, like it just uses the 480x576 resolution
it seems these files are sensitive to which mpeg2 decoder(s) are installed on the system (somehow that was to be expected i gues)
all in all: great job!!
spyder
23rd August 2004, 21:50
I will add support for aut setting the mkv aspect ratio info from the mpeg's settings. Also, it may be possible to modify the stream as it's muxed to change the aspect ratio so you have less to do during creation.
PS: My next plan is to work on better MKV output code so that I can create complete mkv files with cues and everything. Then I will add PS and TS support.
E-Male
23rd August 2004, 22:14
>>I will add support for aut setting the mkv aspect ratio info from the mpeg's settings.
-i thought more of the other way round
>>Also, it may be possible to modify the stream as it's muxed to change the aspect ratio so you have less to do during creation.
-ok, ignore last comment :cool:
>>PS: My next plan is to work on better MKV output code so that I can create complete mkv files with cues and everything. Then I will add PS and TS support.
-sounds great
do you think this can be integrated into mkvmerge/mmg when it's advanced and tested?
Mosu
23rd August 2004, 22:15
Originally posted by E-Male
do you think this can be integrated into mkvmerge/mmg when it's advanced and tested?
Yes.
E-Male
24th August 2004, 07:22
:)
spyder
25th August 2004, 01:14
OK, I made a couple of fixes to the app. Nothing worth incrementing the version with yet. This fixes a bug in the buffer that crashed me while debugging but not in real use. The most important change though is that this build should correctly set the default duration for frames in the MKV. This value is used to calculate framerate by some tools. The files made with an incorrect default duration are OK but they will show up strangely in informational tools(25fps will show as 25000000fps). Anyway, it still shows up wrong for 29.97fps content because I set the default duration to be 33ms which is correct for most of the frames in the MKV. From here I will try to focus on separating the code from my mini framework and adding PS support so Mosu or I can properly integrate it into mkvmerge(and with as little hassle as possible :)).
PS: Please DO NOT use MPEG-PS files(.mpg .vob) directly as input to this tool. It will not tell you it doesn't support them and copy all of the mpeg packs into the mkv. This is not a nince thing :) Also, remember for a couple of weeks this is kind of experimental. The files it makes should be fine. It will be more stable once it's part of mkvmerge which has much more refined code for writing mkv's.
E-Male
25th August 2004, 14:38
i wrote a little batch file that converts mpg files "directly" to mkv
http://e-rels.dyndns.org/downloads/mpg2mkv.bat
requirements:
mpgtx in c:\mpgtx (http://mpgtx.sourceforge.net)
mpeg2mkv in c:\mpeg2mkv (this thread)
mkvmerge in c:\mkvtoolnix (http://www.bunkus.org/videotools/mkvtoolnix/index.html#dlinst_win32)
twice the size of the input-file free on c:
(paths can be changed ofcourse)
installation:
just put the batch-file somewhere
how to:
run with mpg file as parameter or simply drop the mpg file on the batch file
notes:
uses c:\m2m_tmp for temp files
resulting file will have the same name as the input file plus the .mkv extension
atm only the first audio stream is kept
enjoy
GIR
26th August 2004, 05:20
Well things for MPEG2 in MKV sure are looking good :) I have successfully managed to mux an MPEG2 stream with mpeg2mkv and then remux the file using mkvtoolnix with one audio stream and one subtitle stream, plays great in MPC, my tests using MPEG1 were not so good though :( it is b0rked, resulting file crashes MPC completely, it would be good if this was working as well as MPEG2 as I have a few old MPEG1 videos with subtitles that I need in the one package.
E-Male
26th August 2004, 06:59
i updated the batch-file to work with mpeg 1 & 2 (second audio stream is next)
but mpeg1 indeed crashes mpc
robUx4
26th August 2004, 09:13
(from I understood on our IRC channel)
MPEG1 found in VCDs usually have MPEG PS. But spyder's program only handle MPEG ES for the moment. He plans on adding support for PS soon, and that should solve the PS problem which is probably what you experience.
edit: maybe it's not clear, but you need to use Haali's new Matroska splitter (http://haali.cs.msu.ru/mkv/) for MPEG1.
E-Male
26th August 2004, 09:20
i'll retry later with that splitter
spyder
26th August 2004, 18:25
OK, a simple reminder. mpeg2mkv only accepts raw ES files. This means you have to demux the video from the PS file(.vob, .mpg, .dat). A PS(Program Stream) file is the type which has audio and video both. It is also possible to have just video in the file. Be aware that the current version of mpeg2mkv will NOT warn you in any form if you use a PS file directly and it will proceed to make a nice unplayable file. I hope to have time tomorrow afternoon to work on PS support and a clean interface for this to be integrated into mkvmerge. Until then, please use bbdmux or something similar to extract the video to an ES file first. If you do that and still get unplayable files please give me a sample. Thanks
PS: I did forget to announce the new splitter here I guess. MPEG1 did crash mpc before Haali fixed the splitter.
alexnoe
27th August 2004, 17:47
Could you download avi-mux gui 1.16.8, then replace the exe with this one (http://www-user.tu-chemnitz.de/~noe/amg.zip) and try to add audio streams to such an MKV file?
Don't forget to replace that exe file...otherwise b0rked forward references are written! I've tried it only with an AC3 stream, which worked, but i've only tested one file...so please test some files and check if anything is b0rked.
The source file i used was 25 fps, demuxed with dvddecrypter from a DVD which has been created by CloneDVD.
Disabled
27th August 2004, 18:07
And again Matroska beats another container size wise:
sample.d2v: 27.267.770 Bytes
sample.mkv: 27.156.838 Bytes factor 0.996
sample2.mkv: 27.156.643 Bytes factor 0.996(remuxed with mkvmerge)
Only few bytes but that was without audio.
sample.mpg: 30.101.508 Bytes (with audio)
sample.mkv: 29.600.610 Bytes (with audio) factor 0.983
Here we get an advantage of more than 1.5% over mpg.
I demuxed the vob with decodevob and remuxed the mpg with TMPGEnc.
Anyway: Looks quite nice to me! Would be great to see this in the official mkvmerge release soon.
BTW: File was stuttering in wmp6.4 but played fine in VLC. So might be my mkv splitter.
spyder
27th August 2004, 19:31
alexnoe, I tried your new version here and as far as I can tell it works perfectly :) I haven't looked at the structure very much but I assume you know what you are doing there. I'll take a look in a bit.
EDIT: I looked at structure, it looks fine except for the default duration. Steve says you shouldn't average the durations like that but I can't see that it's really hurting anything. It's just a strange practice :)
PS: Where have you been? I haven't seen you on IRC...
alexnoe
27th August 2004, 20:15
As my car was so b0rked that it needed to be towed to the garage (cooling is broken; the engine reached 250°F after ~5 miles), I'm on ISDN @ 64 kbps atm, and won't be back on 100 MBit/s till it is fixed. I need a car to get there.... Could be tomorrow, could be later :p
About that shitty avg duration... assuming you have one AVI file of 25 fps and one of 29.97 fps and join them. What is the new default duration? Average? Zero (because of VFR, like Vorbis)? Now what about 24,9999 and 25,0001? Still Zero? Or 25,0000? Do I need to implement VFR detection working "spongily"?
As long as no lacing is used, default duration is only applied to the last block of the track and only if Duration is not written for that block (AVI-Mux GUI does write duration for the last block of each stream, if that duration can be determined). So I could even write a value of 17 or 23 there, and it should not impair anything.
robUx4
27th August 2004, 20:22
You write durations even if the value is the default one ?! So don't set a default one, it's pointless... (but I understand it can be used for strange apps that need to know the FPS)
alexnoe
27th August 2004, 21:02
You've just explained why I refuse not to write it, unless it is impossible to determine one...
spyder
27th August 2004, 22:20
I have a beta of mpeg2mkv here that writes nanosecond precise timecodes but mkvmerge is failing to remux them. AVIMuxGUI muxes them fine though. I will release it once I know for sure if it is a bug in mkvmerge causing the problem or my code. Also, it tries to check for MPEG PS and TS streams and will warn the user if it encounters one. From here I am focusing entirely on making this code useable inside mkvmerge and maybe even AVIMuxGUI. So expect this to be the last release until I finish restructuring my code. Version 0.3 will be released when that is done and after it is tested enough to be considered stable I'll hand the lib over to Mosu and help him integrate it. :)
alexnoe
28th August 2004, 09:42
It should be pretty easy to find out if the bug is in mkvmerge.... just look at your files and see if they are valid :p
spyder
2nd September 2004, 22:24
Finally...
Mosu fixed a bug in mkvmerge which prevented this version from cooperating :) Here's the "beta" release of mpeg2mkv. It will be the last until the code is separated out and made ready for mkvmerge integration. It will write output files with nanosecond precision, this will let the remuxing app do rounding itself. This may not be useful really but I think it's safer this way. Please be aware this is a prebuild of mkvmerge.
PS: both files can be retrieved from http://www.matroska.org/~spyder482/
avih
7th September 2004, 11:46
@spyder:
apologies for not approving the attachment earlier. i'm a bit busy lately.
sorry,
avih.
song
18th January 2005, 07:37
Thanks for that, Spyder.That's a Great job!!
i try made mpeg2 ts to MKV IN MPEG2MKV , this page:
http://test.sleeplesss.com/LeeOsX.mht
my english is too bad.That is my friend LeeOsX Translator .
iapir
18th January 2005, 22:40
That link is unusable from here. What application can open it ?
stephanV
19th January 2005, 14:38
uhm, perhaps you wanna use the latest prerelease of MKVtoolnix for this...
here (http://www.bunkus.org/videotools/mkvtoolnix/win32/pre/HEAD/)
Mosu
19th January 2005, 14:45
Not for TS. mkvmerge only handles ES and PS.
Sdc77
8th March 2005, 09:08
Hello all,
mmg works now perfectly with mpeg1/2 since mkvtoolnix 1.4 , but how can i extract mpeg1/2 from an mkv file ?
Cheers.
Mosu
8th March 2005, 09:14
Originally posted by Sdc77
Hello all,
mmg works now perfectly with mpeg1/2 since mkvtoolnix 1.4 , but how can i extract mpeg1/2 from an mkv file ?
Cheers.
You can't. Maybe something can be thrown together with GraphEdit, but I have no clue how or if.
iapir
8th March 2005, 10:30
How about extracting tracks in raw format in mkvextract, regardless of the codec ?
Mosu
8th March 2005, 10:36
Originally posted by iapir
How about extracting tracks in raw format in mkvextract, regardless of the codec ?
Planned for 1.4.2 (1.4.1 will be a bugfix-only release hopefully coming this weekend).
vlada
5th February 2006, 13:12
Hello, is there anything new regarding extraction of MPEG-2 from MKV? MKVExtract said it doesen't support MPEG-2 and I have no idea how could I do it in GraphEdit. I tried to connect Haali's splitter with filewriter, but it didn't work.
Thanks,
Vlada
Mosu
5th February 2006, 21:37
Hello, is there anything new regarding extraction of MPEG-2 from MKV? MKVExtract said it doesen't support MPEG-2 and I have no idea how could I do it in GraphEdit. I tried to connect Haali's splitter with filewriter, but it didn't work.
Thanks,
Vlada
Raw extraction exists, but raw is not the same as "MPEG-2 elementary stream" which mkvextract still not supports. There won't be any work on that particular feature in the near future.
SeeMoreDigital
6th February 2006, 00:02
Raw extraction exists, but raw is not the same as "MPEG-2 elementary stream" which mkvextract still not supports. There won't be any work on that particular feature in the near future.Alex Noé's AVI-Mux GUI is also able to extract MPEG-2 in MKV to RAW.
That said, these "RAW" streams can be re-named to .M2V and should be playable and therefor mux-able using other applications ;)
Cheers
vlada
6th February 2006, 01:11
Mosu> I found the right switch in mkvextract and it worked fine. Thank you.
SeeMoreDigital> But it failed in AVI-Mux GUI. This program even wasn't able to demux AC3 from the file. And I have no idea how should I demux video in it.
I wish Avidemux will implement MKV support. Are there any plans to do it?
SeeMoreDigital
6th February 2006, 11:19
But it failed in AVI-Mux GUI. This program even wasn't able to demux AC3 from the file. And I have no idea how should I demux video in it. I've been able to do it..... Admittedly it's only a very short file though (not that it should make much difference)
http://img73.imageshack.us/img73/9697/avimuxgui7si.png
I wish Avidemux will implement MKV support. Are there any plans to do it?It already provides basic "muxing" functions for placing MPEG-4 video, AC3, MP3, WAV, AAC etc audio streams within the MKV container.... And for "de-muxing" many other audio and video stream combinations.
Cheers
vlada
6th February 2006, 20:13
SeeMoreDigital> Thank you for the picture. I found out I had an older AVI-Mux GUI 1.7.3, so that might have been the problem. I'll try it with the new version, but unfortunately I don't have the test MKV file anymore, because I succeeded with mkvextract.
According to Avidemux, what version do you use? I have 2.1.1 which is the newest one I found. But it doesen't seem to support MKV. Even in this thread (http://forum.doom9.org/showthread.php?t=103918) there is mentioned, that MKV is planed after finishing MP4 support.
Once again thank you for your help.
Vlada
SeeMoreDigital
6th February 2006, 20:17
I have not tried AVIdeMUX yet (only AVI-Mux GUI)... Is there a compile with GUI?
Cheers
vlada
6th February 2006, 20:23
OK, it was a missunderstanding - AVI-Mux GUI vs. Avidemux. You can find Avidemux at http://avidemux.berlios.de/index.html they have a version for both Linux and Windows. It has a GTK+ GUI, like GIMP for example. I don't like it too much, but it is only a GUI. Currently it only supports MPEG and AVI. MOV, MP4 and MKV is planned. It would be a great tool then.
sterlina
8th February 2006, 21:17
Not for TS. mkvmerge only handles ES and PS.
ehu... what's exactly does TS/ES/PS means? :confused:
sillKotscha
8th February 2006, 21:59
Transport Stream
Elementary Stream
Program Stream
tomos
26th April 2006, 12:11
I've been able to do it..... Admittedly it's only a very short file though (not that it should make much difference)
http://img73.imageshack.us/img73/9697/avimuxgui7si.png
It already provides basic "muxing" functions for placing MPEG-4 video, AC3, MP3, WAV, AAC etc audio streams within the MKV container.... And for "de-muxing" many other audio and video stream combinations.
Cheers
a forum search brought me to your post. i've tried this with the latest version of that proggy, but i cant get an extract option on the video. right clicking on the vid just says 'default track'.
the audio lets me extract but nada for the video
there is also no info about the video source. vdubmod can read the file fine tho.
mkv extract is also the same. audio is fine, but the mpeg-2 video is a no go.
SeeMoreDigital
26th April 2006, 12:17
a forum search brought me to your post. i've tried this with the latest version of that proggy, but i cant get an extract option on the video. right clicking on the vid just says 'default track'. It wouuld seem the "video extract" option is not available AVI-Mux GUI 1.17.5.... Bummer!
Cheers
tomos
26th April 2006, 12:30
:( shame. was it working in 1.17.4?
at least dgindex can open the mkv and do its thing so avisynth works thankfully :)
SeeMoreDigital
26th April 2006, 13:04
:( shame. was it working in 1.17.4?Yes
at least dgindex can open the mkv and do its thing....When I tried doing the same with DGIndex, I got bad blocking when playing the .M2V stream!
tomos
26th April 2006, 14:32
checked again and found the old ver is still there. :D works well too :)
as for dgindex, going through avisynth (mpeg2source) it looks fine in vdubmod. the pic is clean :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.