Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

Pages: (2) [1] 2  ( Go to first unread post )
Mpeg-2 Input Filter Aborting Prematurely
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
orange123
Posted: Nov 26 2007, 01:43 AM


Member


Group: Members
Posts: 18
Member No.: 22493
Joined: 26-November 07



First off I just wanted to say thank you to the authors of VirtualDub and the various input filters. I'm a long time casual user of VirtualDub (geez it's been a few years now) and it has been such a great utility. And now with the ability to directly open a wide variety of encoding formats, well, that's just so cool! Overwhelmingly I have had great results, but I did run into a problem with the MPEG-2 input filter and thought I should pass it along.

The files that cause me problems are downloads from my TiVo. Here is the workflow:

1) pull to my PC using TiVo Desktop
2) strip the TiVo wrapper using Direct Show Dump Utility
3) load into VirtualDub 1.7.6 (via fccHandler's MPEG-2 plugin v2.0)

(This method works just fine on most files from my TiVo btw.)

The files that cause me problems are ones in which the TiVo had to change channels on the set top box immediately before recording. In these cases, the TiVo sends the command to change the channel on the set top box, begins recording, and then the channel changes. Therefore the channel change is present in the MPEG and it is exactly at this point that the MPEG-2 plugin fails every time. When I load these files, the import simply stops after ~130 to ~160 frames. The files are however 30 minute shows (~54k frames). I figure there must be some sort of "end of file" code or error in the stream that causes the filter to call it quits. I poked around with VirtualDub's hex editor, but I don't even know where to begin to look. These "problem" files play just fine in Window Media Player btw.

Any thoughts? And thanks again for making such great software available!
 
     Top
foxidrive
Posted: Nov 26 2007, 05:02 AM


Advanced Member


Group: Members
Posts: 918
Member No.: 16996
Joined: 21-October 05



If you create a ~5 second file using the problematic method and post it on the web then the author might be able to find the issue.
 
    Top
orange123
Posted: Nov 27 2007, 12:31 PM


Member


Group: Members
Posts: 18
Member No.: 22493
Joined: 26-November 07



Good idea. I'll do that when I get some time.

I know there are many places offering free file hosting but I have never hosted on them. Could you recommend one that's hassle free to put files onto?
 
     Top
foxidrive
Posted: Nov 27 2007, 01:08 PM


Advanced Member


Group: Members
Posts: 918
Member No.: 16996
Joined: 21-October 05



I used this the other day - no registration or details needed: http://rapidshare.com/
 
    Top
orange123
Posted: Dec 5 2007, 12:08 PM


Member


Group: Members
Posts: 18
Member No.: 22493
Joined: 26-November 07



Ok, I've uploaded a file demonstrating the problem. The clip is 11 seconds long and plays fine in WMP. GSpot also recognizes the file correctly saying that it has 283 frames. When I load into VirtualDub via fccHandler's MPEG-2 plugin however, only the first 64 frames are present.

The file is ~4 MB and is located here:

http://www.savefile.com/files/1243730

Thanks again for any help you can provide.
 
     Top
pintcat
Posted: Dec 9 2007, 02:21 PM


Advanced Member


Group: Members
Posts: 142
Member No.: 18182
Joined: 19-February 06



Changing the channel obviously corrupts your video. I managed to fix it by cutting away about 3 or 4 seconds at the beginning, but it was a bit tricky. First I demuxed it using TMPG's MPEG tools (I think you can use every custom MPEG-demultiplexer) and opened the streams with Cuttermaran, which is imho the best tool for cutting MPEGs. The 1st cut produced a video which was playing fine (even with VirtualDub!), but due to the corruption, the audio was completely out of sync and kind of truncated at the end (about 1 or 2 seconds). So I cut only the video stream, imported it to VDub, added the original demuxed audio stream, corrected the sync and compressed it with XviD/MP3. The resulting AVI should work with every player and editor... check here:

http://filemojo.com/017986119169304
 
     Top
orange123
Posted: Dec 13 2007, 01:29 AM


Member


Group: Members
Posts: 18
Member No.: 22493
Joined: 26-November 07



pintcat, thanks for working with the file! I downloaded your edit and it did indeed work. I don't have any other MPEG editing tools (or much experience with any either) so I appreciate you looking into it. And since you were able to open the file with other tools, I'm more encouraged than ever that fccHandler can find a workaround for my type of anomaly.

I am really hoping for a fix that won't complicate what is otherwise a pretty simple workflow... fccHandler where are you?! smile.gif
 
     Top
heustess
Posted: Dec 13 2007, 02:26 AM


Advanced Member


Group: Members
Posts: 67
Member No.: 21872
Joined: 5-August 07



I have the same problem with the first vob out of 29 vobs all copied (no protection present) straight from the original dvd set to the hard drive. Windows Media Player plays all the vobs fine when renamed to something.mpeg. VirtualDub 1.7.6 and 1.7.7 with MPEG-2 plugin 2.0 prematurely aborts that first vob.

--------------------
http://heustess.com/
 
      Top
fredgiblet
Posted: Dec 13 2007, 05:41 AM


Advanced Member


Group: Members
Posts: 356
Member No.: 22601
Joined: 13-December 07



Hello, first time poster, I'm having this same problem. I ripped a DVD and I have successfully compressed it with VDub-MPEG2 1.6.19 but due to screwing up the settings I need to do it again. The vob plays fine, the demuxed .m2v plays fine and the .m2v loads and compresses fine in 1.6.19 but it stops partway through in 1.7.6 with the plugin. What information can I give you to help figure this out?
 
     Top
pintcat
Posted: Dec 15 2007, 06:07 PM


Advanced Member


Group: Members
Posts: 142
Member No.: 18182
Joined: 19-February 06



@heustess & fredgiblet: I'm aware of this odd behavior (had it myself with a few DVDs). Sometimes it helps playing around with different demuxing tools like DGIndex or SmartRipper. You might also open the MPEGs with Cuttermaran, mark the whole video and save it as cut. I heard that Cuttermaran sometimes repairs the stream in some way, so the edited video might work with fccHandler's MPEG2 plug-in. If it doesn't then here is another way: When VDub aborts while importing a video, it just opens a small amount of frames. You could try to open the same video with Cuttermaran, cut away all these frames from the beginning and open the cut version with VDub and MPEG2 plug-in.
 
     Top
fredgiblet
Posted: Dec 17 2007, 08:25 PM


Advanced Member


Group: Members
Posts: 356
Member No.: 22601
Joined: 13-December 07



Unfortunately I no longer have the .vob in question as I finished the compression in 1.6.19 and deleted it before I posted here. I'll keep trying new ones and see what happens.
 
     Top
orange123
Posted: Dec 23 2007, 05:03 PM


Member


Group: Members
Posts: 18
Member No.: 22493
Joined: 26-November 07



I don't know if it's good or bad that I'm not the only one having problems. smile.gif

I just played around with Cuttermaran for a few minutes and found the interface a bit bewildering. It reinforced why I like VirtualDub so much and why I'm hoping fccHandler will chime in on this topic some time!
 
     Top
fccHandler
Posted: Dec 24 2007, 06:40 AM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



Sorry to be so late. I started a new job recently and it's taking up all my time. Add to that my car troubles and the holiday rush; it leaves me little time for forum talk...

I looked at your original file, and indeed it fails to load completely because of a break in the sequence (due to changing channels). MPEG "sequence headers" appear periodically in MPEG files, typically at every GOP, and they contain some global parameters for the sequence. Consequently (as described in the spec) most of the fields in a sequence header remain consistent in later sequence headers. In fact, that is a requirement for a given sequence.

The MPEG-2 plugin stores the first sequence header, and compares subsequent headers to the first one. If there is any discrepancy, the rest of the stream is abandoned, and the load stops there. Four fields in the header are checked; they are:

- horizontal_size
- vertical_size
- pel_aspect_ratio
- picture_rate

These must remain consistent from header to header, or the load will abort.

IIRC, I think VirtualDub-MPEG2 only checks the horizontal and vertical size fields, so it manages to parse a little farther into the split sequences.

I won't be changing this algorithm, because it's a rigid interpretation of the MPEG spec, which I strive to adhere to. If your MPEG stream changes any of the above parameters partway through, it's unsupported by design.

--------------------
May the FOURCC be with you...
 
     Top
orange123
Posted: Dec 24 2007, 06:12 PM


Member


Group: Members
Posts: 18
Member No.: 22493
Joined: 26-November 07



Thank you for your detailed response. I figured it was something like this, but unfortunately I have no knowledge of the MPEG specs, file formats, parameters, etc..

I also understand your plan to stick to the spec. That's why specs exist. smile.gif Would it be possible however to add an option to the input filter to ignore changes in the sequence header? What I'm thinking of would be similar to what tateu did with the VirtualDub Quicktime input filter. He uses the "Ask for Extended Options Dialog" to prompt for a few key parameters to direct the input filter, such as selecting a specific 'Video Decoder Mode'. By doing something like this the MPEG input filter could retain its spec-compliant nature, but an option could be provided to ignore sequence header changes for those times when a file is damaged.

This would obviously be a "use at your own risk" feature, but would at least provide an opportunity to try to load damaged, but otherwise spec-compliant files that a number of us have encountered.

And thanks again for looking into my problem, especially when life is busy. VirtualDub is such an elegant solution for so many things (lately moreso than ever) and I really do appreciate your contribution.
 
     Top
fccHandler
Posted: Dec 25 2007, 08:01 AM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



QUOTE (orange123 @ Dec 24 2007, 02:12 PM)
Would it be possible however to add an option to the input filter to ignore changes in the sequence header?

Yep, that's easy to do:

http://fcchandler.home.comcast.net/Plugins/MPEG2

But it's risky, and may not work for you. The pel_aspect_radio and picture_rate fields are safe to ignore, but if your sequence changes its width or height fields, it's unlikely that the plugin can handle it.

The plugin allocates picture buffers with a fixed size based on a reading of the first sequence header. It's not dynamic, so if your picture size changes midstream it will probably crash VirtualDub.

You've inadvertently forced me to release some code I was working on in October, which supposedly allows Direct Stream Copy of MPEG audio. I haven't seen it since then, and I don't remember if that code works or not, but it's going public now. rolleyes.gif

--------------------
May the FOURCC be with you...
 
     Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
27 replies since Nov 26 2007, 01:43 AM Track this topic | Email this topic | Print this topic
Pages: (2) [1] 2 
<< Back to VirtualDub Filters and Filter Development