Log in

View Full Version : MPEG2 in MKV


Pages : 1 [2]

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 :)