PDA

View Full Version : Inserting single B-frames into MPEG-2 files?


evilclive
16th November 2007, 14:33
I recorded a programme off Freeview (DVB-T) some time ago, capturing it directly as a MPEG-2 without de/re-coding it. There were a few sporadic glitches in the signal I received, which has left a few video frames slightly scrambled.

When I demux the recording using ProjectX 0.90.4.00 (a version that is probably out of date by now) without invoking the option to ignore video errors, I get the following log message:


!> dropping useless B-Frames @ GOP# 0 / new Timecode 00:00:00.000
!> dropping GOP# 128 @ orig.PTS 02:51:48.044 (927723987), errorcode: 24
!> Pics exp/cnt 12/11, inGOP PTS diff. 0ms, new Timecode 00:00:59.320
-> dump GOP to file: E:\Temp\bird
!> PTS difference of 43200 (00:00:00.480) to last exported GOP detected
!> dropping useless B-Frames @ GOP# 129 / new Timecode 00:00:59.320


One of the signal glitches has knocked out a single B-frame from this GOP; the rest of the GOP, and the concomitant audio frames, are intact. The absence of a single B-frame is practically unnoticeable in the original recording, whereas dropping the entire GOP is intolerable.

Has anyone written a utility that will insert a replacement B-frame (either a blank one, or a copy of the remaining good one) into a GOP, thereby repairing the GOP's temporal structure?

DrP
18th November 2007, 20:41
If you have a .mpg file, try converting it to a .ts file with project-x (won't do any fixes), then run the .ts through mpeg2repair (http://users.adelphia.net/~mwilczyn/mpeg2repair/). That might fix things to the point that you want.

videoredo (http://www.videoredo.com/)'s quick stream fix would do the trick too.

Those two options may not insert a B frame but they will give output that won't have the GOP dropped.