Perian, MKV, MPEG2 = yuck

The Perian forums have moved to Google Groups, this forum is read only.
jelockwood
Harmless
Posts: 13
Joined: Fri Aug 10, 2007 8:41 pm

Perian, MKV, MPEG2 = yuck

Postby jelockwood » Mon Mar 08, 2010 9:39 pm

I used makemkv 1.5 for Mac OS X, to convert a DVD title to an MKV file, complete with all audio tracks, all subtitles tracks, and chapter markers. This worked fine and plays fine in VLC. The DVD and hence MKV file, is MPEG2 video, with two AC3 audio tracks, and two DVD subtitles tracks.

The file does open successfully in QuickTime with Perian 1.2, and (technically) does play the video (still in MPEG2), and you can hear the audio (still in AC3), and see the subtitles and chapter markers. However the quality is appallingly bad on the same machine that VLC played the file with no problems. I did let QuickTIme Player fully load the file before trying to play it. The Mac is a Mac mini running Mac OS X 10.5.8, with 4GB of RAM, and a 2GHz Core2Duo processor and nothing else running. The file which remember is from a (PAL) DVD and therefore only standard resolution stutters continuously and also has occasional bad pixelation. As a reminder the same file plays fine in VLC. I do have the Apple MPEG2 QuickTime Component installed.

Here is a screencapture as an example.

test.jpg

I would really like to get this working as it would be a perfect solution to storing TV episodes ripped from DVDs as it will in theory avoid QuickTime's inability to play AC3 audio from 'normal' MPEG2/VOB files, while still having the advantage of not losing any quality due to re-encoding as H.264.

Here is another example from the same file.

test2.jpg

gbooker
Cocoaforge Admin
Posts: 723
Joined: Sat May 06, 2006 2:47 am
Contact:

Re: Perian, MKV, MPEG2 = yuck

Postby gbooker » Tue Mar 09, 2010 12:32 am

Does the pixelation only happen after a pause (stutter) in the video or in other places too? The pixelation looks like macroblocks not correctly decoded, which could be the result of a missing reference from another frame which failed to decode or was skipped.

Does it have any issues if you step through the file frame by frame? Does it happen in the same place twice or is it random?

Mr VacBob
Crema
Posts: 330
Joined: Thu Jan 04, 2007 11:14 pm
Contact:

Re: Perian, MKV, MPEG2 = yuck

Postby Mr VacBob » Wed Mar 10, 2010 3:21 am

Hmm, something's definitely wrong with handling of these files. I tried importing a DVD (Martian Successor Nadesico vol1) and the video doesn't import due to some problem with sample times. Haven't looked at it much yet.

My only impression when looking at mkvinfo is that their video tracks should use SimpleBlock, but that shouldn't affect this. It would be interesting to know if it thinks every frame in the MKV is a keyframe (that would cause the problem here), but I need to be able to import a video before I can see that.

jelockwood
Harmless
Posts: 13
Joined: Fri Aug 10, 2007 8:41 pm

Re: Perian, MKV, MPEG2 = yuck

Postby jelockwood » Wed Mar 10, 2010 12:42 pm

gbooker wrote:Does the pixelation only happen after a pause (stutter) in the video or in other places too? The pixelation looks like macroblocks not correctly decoded, which could be the result of a missing reference from another frame which failed to decode or was skipped.

Does it have any issues if you step through the file frame by frame? Does it happen in the same place twice or is it random?


The stuttering is mild but almost continuous so it is hard to definitively know if the pixelation is happening at the same time. Yes, moving frame by frame shows the pixelation and bad video in the same places. As a reminder VLC plays it fine. The second example picture was more 'smearing' rather than bad macroblocks (which was shown in the first picture).

jelockwood
Harmless
Posts: 13
Joined: Fri Aug 10, 2007 8:41 pm

Re: Perian, MKV, MPEG2 = yuck

Postby jelockwood » Fri Mar 26, 2010 3:22 pm

For what its worth, I have now repeated the test using Perian 1.2.1 with Mac OS X 10.6.2 and a new file produced using MakeMKV 1.5.2beta.

The results were equally awful.

Again VLC plays it perfectly.

Mr VacBob
Crema
Posts: 330
Joined: Thu Jan 04, 2007 11:14 pm
Contact:

Re: Perian, MKV, MPEG2 = yuck

Postby Mr VacBob » Mon Mar 29, 2010 5:22 am

Yeah, there were no changes to 1.2.1 affecting this.

jelockwood
Harmless
Posts: 13
Joined: Fri Aug 10, 2007 8:41 pm

Re: Perian, MKV, MPEG2 = yuck

Postby jelockwood » Sun Apr 17, 2011 7:20 pm

Good news. (For you!)

Via another forum I came across another MKV tool for Mac called MkvToolnix which includes MkvMerge. I used this to merge a .M2V video file three Ac3 audio files and IDX/SUB files for the subtitles. The resulting MKV file like the ones produced using MakeMKV contained unaltered MPEG2 video therefore preserving as desired all the original quality, but this time it played perfectly in QuickTIme Player (with Perian 1.2.2).

As a check I used the same VIDEO_TS with MakeMKV and it still resulted in a bad file.

Therefore it is possible to use Perian to play an MKV file containing MPEG2 video successfully and any remaining problems are now down to MakeMKV. I have posted a message on the MakeMKV website.

Unfortunately it is a lot more work involved using the MkvMerge approach than it would be with MakeMKV.

Both MakeMKV and MkvMerge produce files that play fine in VLC.

chucky23
Harmless
Posts: 12
Joined: Wed Apr 08, 2009 8:01 pm

Re: Perian, MKV, MPEG2 = yuck

Postby chucky23 » Tue Apr 19, 2011 4:57 pm

jelockwood wrote:Via another forum I came across another MKV tool for Mac called MkvToolnix which includes MkvMerge. I used this to merge a .M2V video file three Ac3 audio files and IDX/SUB files for the subtitles. The resulting MKV file like the ones produced using MakeMKV contained unaltered MPEG2 video therefore preserving as desired all the original quality, but this time it played perfectly in QuickTIme Player (with Perian 1.2.2).

jelockwood, you have blown my mind.

I have several Terrabytes of MPEG2 video files with AC3 soundtracks, recorded on my TiVo and unwrapped to the underlying .mpg file, which I've long wanted to get Quicktime accessible. They playback fine in MPEG StreamClip, VLC, and EyeTV, but there has been no way to get QuickTime Player 7 or QuickTime Player to recognize the soundtrack in the .mpg files.

http://forums.cocoaforge.com/viewtopic.php?f=25&t=19775&p=115350

And now, you've proposed an actual solution.

Unfortunately, things aren't fully working for me.

I tried running five different MPEG2/AAC files through MkvToolnix to open with Perian, and only one passed the test.

The one that passed the test is perfect. MkvToolnix remuxed the file, Perian 1.2.2 loaded the .mkv file into QuickTime, and the playback was perfect.

Two failed because MkvToolnix complained about the mpg file being damaged, and refused to proceed.

Two failed because, while MkvToolnix did the remux, Perian wouldn't load more than the first 15 - 30 seconds of video into QuickTime, though the entire soundtrack got loaded into QuickTime.

All five .mpg files playback just fine in MPEG StreamClip, VLC, and EyeTV.

So, this obviously isn't a practical workflow for me yet, but it definitely is progress. I guess I'll have to do some research to see if there is anything I can tweak to get MkvToolnix to better cope with the CableCARD mpg files I'm asking it to remux...

jelockwood
Harmless
Posts: 13
Joined: Fri Aug 10, 2007 8:41 pm

Re: Perian, MKV, MPEG2 = yuck

Postby jelockwood » Wed Apr 20, 2011 2:42 am

chucky23 wrote:
jelockwood wrote:Via another forum I came across another MKV tool for Mac called MkvToolnix which includes MkvMerge. I used this to merge a .M2V video file three Ac3 audio files and IDX/SUB files for the subtitles. The resulting MKV file like the ones produced using MakeMKV contained unaltered MPEG2 video therefore preserving as desired all the original quality, but this time it played perfectly in QuickTIme Player (with Perian 1.2.2).

jelockwood, you have blown my mind.

I have several Terrabytes of MPEG2 video files with AC3 soundtracks, recorded on my TiVo and unwrapped to the underlying .mpg file, which I've long wanted to get Quicktime accessible. They playback fine in MPEG StreamClip, VLC, and EyeTV, but there has been no way to get QuickTime Player 7 or QuickTime Player to recognize the soundtrack in the .mpg files.

And now, you've proposed an actual solution.

Unfortunately, things aren't fully working for me.

I tried running five different MPEG2/AAC files through MkvToolnix to open with Perian, and only one passed the test.

The one that passed the test is perfect. MkvToolnix remuxed the file, Perian 1.2.2 loaded the .mkv file into QuickTime, and the playback was perfect.

Two failed because MkvToolnix complained about the mpg file being damaged, and refused to proceed.

Two failed because, while MkvToolnix did the remux, Perian wouldn't load more than the first 15 - 30 seconds of video into QuickTime, though the entire soundtrack got loaded into QuickTime.

All five .mpg files playback just fine in MPEG StreamClip, VLC, and EyeTV.

So, this obviously isn't a practical workflow for me yet, but it definitely is progress. I guess I'll have to do some research to see if there is anything I can tweak to get MkvToolnix to better cope with the CableCARD mpg files I'm asking it to remux...

The files I am using are from DVDs, in theory Tivo files should work equally well.

Having established where (my) problem was i.e. with MakeMKV, I contacted the author and he has stated he is aware of the current problems and plans to address them in MakeMKV 1.7.0 (current version is 1.6.7). Hopefully this will work for your files as well. It might be worth getting a couple of small sample files ready, one that works and one that does not so you can send them if needed.

Oops - just realised, I don't believe MakeMKV is going to help you, it is designed to work with DVD or BD sources, not .M2V.

The Mac version of MkvToolnix is available here http://jonthn.free.fr/MKVtoolnix/ the person who made the Mac build can be contacted via the information here http://jonthn.free.fr/MKVtoolnix/CONTACT you could try contacting him firstly and then sending samples and logs. It maybe he will then need to pass you to the author of the original (Linux) code which would be via http://www.bunkus.org/videotools/mkvtoolnix/index.html

I would think there would be interest in getting Tivo files working so there is hope they will look in to it.

If MPEGStreamClip likes your Tivo files then I would have considered them to be undamaged. Some DVDs as an example have timecode errors which MPEGStreamclip will find when you use the extracted video, if MPEGStreamClip is similarly complaining about your Tivo files then the timecode errors might upset things.

By the way, I thought CableCard had severe DRM which is why it is not available for Mac but only for Windows (and set-top boxes).

chucky23
Harmless
Posts: 12
Joined: Wed Apr 08, 2009 8:01 pm

Re: Perian, MKV, MPEG2 = yuck

Postby chucky23 » Wed Apr 20, 2011 9:40 am

jelockwood wrote:The files I am using are from DVDs, in theory Tivo files should work equally well.

The Mac version of MkvToolnix is available here http://jonthn.free.fr/MKVtoolnix/ the person who made the Mac build can be contacted via the information here http://jonthn.free.fr/MKVtoolnix/CONTACT you could try contacting him firstly and then sending samples and logs. It maybe he will then need to pass you to the author of the original (Linux) code which would be via http://www.bunkus.org/videotools/mkvtoolnix/index.html

Thanks. That's where I shall turn next.

jelockwood wrote:I would think there would be interest in getting Tivo files working so there is hope they will look in to it.

I would think so as well.

It's a niche, but there sure is interest inside that niche.

jelockwood wrote:If MPEGStreamClip likes your Tivo files then I would have considered them to be undamaged. Some DVDs as an example have timecode errors which MPEGStreamclip will find when you use the extracted video, if MPEGStreamClip is similarly complaining about your Tivo files then the timecode errors might upset things.

MPEGStreamClip likes the files just fine. It never sees timecode errors with them, and is happy to both playback and edit them.

jelockwood wrote:By the way, I thought CableCard had severe DRM which is why it is not available for Mac but only for Windows (and set-top boxes).

TiVo files have the same kind of DRM that DVD does - aka, one that was widely cracked a decade ago.

The problem for some is that the wireline providers are able to set flags to prevent certain shows from being accessible to "TiVoToGo" (aka - TTG) . If a show is disabled from TTG access by the wireline provider though setting the flag, then there is no way to get it off the TiVo box and onto the Mac in the first place, and the DRM thus is unbreakable in practice.

However, certain wireline providers like mine (Verizon) don't set the flags by choice, and thus all recorded material is able to transfer to my Mac via TTG. Once on the Mac, it is just a standard MPEG2/AAC file inside a .Tivo wrapper. Unwrapping the underlying file (aka - decrypting) is trivial.

All wireline providers are forced by law to not set the flags for Over The Air content, and some choose to not set the flags for anything but 'premium' cable channels. But good wireline providers like mine choose not to set the flag for any cable programming, which Verizon chooses to do because it doesn't own any studios or networks, and thus doesn't have any internal conflicts with letting users have TTG access to the programming they're already paying for.

So that's how I've got Terrabytes of TiVo-produced MPEG2 files which I've already paid for accessible to my Mac Mini HTPC, which all playback perfectly in MPEGStreamClip, EyeTV, and VLC...

jelockwood
Harmless
Posts: 13
Joined: Fri Aug 10, 2007 8:41 pm

Re: Perian, MKV, MPEG2 no longer = yuck

Postby jelockwood » Tue Jul 19, 2011 11:27 am

For the benefit of anyone interested, MakeMKV 1.6.12 now produces .mkv files from a DVD that playback correctly in QuickTime Player and no longer produce the ghastly image problems in my original report.

As a result I can now convert movies or more importantly TV shows from a DVD to a .mkv file which -

    Preserves all the original video quality as the MPEG2 video is not being transcoded
    Preserves all the audio tracks also unaltered
    Preserves all the subtitles tracks also unaltered
    Keeps all the DVD Chapter markers
    Keeps the naming of the languages for the audio and subtitle tracks
    Allows in QuickTime Player 7 (with QuickTime Pro key) selecting the subtitle tracks and turning them on or off
    Allows playback of the original unaltered AC3 audio track
And as a bonus the process of converting the file also repairs any timecode errors in the video on the original DVD, a surprisingly large number of DVDs have timecode errors in the video stream. Normally as a DVD you will not notice these as the timecodes in the IFO files override the bad timecodes in the actual video stream. However if you merely copy the .VOB data you no longer have the IFOs. As an example all four Firefly DVDs have time code errors in each episode.

In otherwords, the resulting file now plays as well in QuickTime Player as it always could do in VLC.

As a reminder a 'normal' .VOB or MPEG2 file will not play audio in QuickTime Player even if you have the Apple MPEG2 QuickTime Component.

gbooker
Cocoaforge Admin
Posts: 723
Joined: Sat May 06, 2006 2:47 am
Contact:

Re: Perian, MKV, MPEG2 = yuck

Postby gbooker » Tue Jul 19, 2011 1:55 pm

jelockwood wrote:As a reminder a 'normal' .VOB or MPEG2 file will not play audio in QuickTime Player even if you have the Apple MPEG2 QuickTime Component.

That's because Apple's MPEG2 component ignores AC3 audio and just skips it.

jelockwood
Harmless
Posts: 13
Joined: Fri Aug 10, 2007 8:41 pm

Re: Perian, MKV, MPEG2 = yuck

Postby jelockwood » Tue Jul 19, 2011 3:04 pm

gbooker wrote:
jelockwood wrote:As a reminder a 'normal' .VOB or MPEG2 file will not play audio in QuickTime Player even if you have the Apple MPEG2 QuickTime Component.

That's because Apple's MPEG2 component ignores AC3 audio and just skips it.

I know Apple's component cannot cope with multiplexed media like MPEG2 files. This is why I looked at using Perian as a solution initially to play MPEG2 files directly (which it cannot do even though ffmpeg can), and then later to use Perian's ability to play .mkv files.

Now that MakeMKV has fixed its engine it is producing .mkv files containing the MPEG2 and AC3 audio in a way that works perfectly in QuickTime Player. You still need Perian though.

gbooker
Cocoaforge Admin
Posts: 723
Joined: Sat May 06, 2006 2:47 am
Contact:

Re: Perian, MKV, MPEG2 = yuck

Postby gbooker » Tue Jul 19, 2011 4:40 pm

I was clarifying why Apple's MPEG2 component does not play the audio. It's not that it cannot cope with muxed media, it's that it ignores all but a a select list of tracks. AC3 is not a track type it accepts, and so it skips that track.


Return to “Perian”

Who is online

Users browsing this forum: No registered users