They're here! More Muvipix.com Guides by Steve Grisetti!
The Muvipix.com Guides to Premiere & Photoshop Elements 2024
As well as The Muvipix.com Guide to CyberLink PowerDirector 21
Because there are stories to tell
muvipix.com

How to fix bad MPEG-2 clips

Video / Image editing, advanced techniques, computer settings, third party software, shortcuts, workarounds ... share your tips and tricks here.

How to fix bad MPEG-2 clips

Postby Ken Jarstad » Tue May 11, 2010 10:31 pm

I have been having a ball editing HDV clips in Vegas Platinum but recently I tried to add a couple of clips to the timeline and found that Vegas would stall while "ingesting" the file, building peaks, requiring a shutdown of Vegas to recover. To be fair, the clips has discontinuities in them due to reviewing the footage in the camcorder and then rewinding the tape until it was 'close' to the end. And, sometimes close wasn't very good because I noticed that the time counter had restarted at zero again.

I used HDVsplit for capturing which, evidently, does not do any error correcting.

HDV files are MPEG-2 transport stream files and the first thing I tried was using the free editor Avidemux. Avidemux accepted the files and I was able to configure it to save as an MPEG-2 program stream file. That was fine but I thought there must be a better way to 'fix' the file and even find out what was wrong with it.

I found a utility (Ken, the utility king!) that does the job! It's called 'mpeg2repair'. Sounds appropriate, doesn't it? This utility not only fixes problem MPEG-2 files but writes a text log file with what it found and fixed. Recommended. :tup:

http://www.free-codecs.com/download/MPEG2Repair.htm

Here is my log for a sample:
MPEG2Repair: D:\Capture\Mt_Rainier.m2t


Sequence Frame 3257(1-B) / Time 0:01:48 :
VideoWarning: Discontinuity of (14+) packet(s). First packet ending at offset 367820308

Sequence Frame 3264(8-P) / Time 0:02:40 :
VideoWarning: Discontinuity of (10+) packet(s). First packet ending at offset 368689432

Sequence Frame 3273(13-B) / Time 0:02:40 :
VideoWarning: TemporalRef gap of 1021. Timestamp gap of 51.251201 sec. ending at file offset 368177168

Sequence Frame 5303(7-B) / Time 0:03:48 :
VideoWarning: Discontinuity of (9+) packet(s). First packet ending at offset 598800304

Sequence Frame 5311(6-B) / Time 0:04:33 :
VideoWarning: Discontinuity of (13+) packet(s). First packet ending at offset 599669428

Sequence Frame 5319(13-B) / Time 0:04:34 :
VideoWarning: TemporalRef gap of 1015. Timestamp gap of 45.345301 sec. ending at file offset 599051132

Sequence Frame 18741(10-B) / Time 0:12:01 :
Info: End of MPEG2 sequence

Sequence Summary:

File Size Processed: 1.97 GB, Play Time: 00h:12m:01s
1440 x 1080, 29.97 fps, 25.00 Mbps (21.66 Mbps Average).
Average Video Quality: 101.81 KB/Frame, 0.54 Bits/Pixel.
MPEG Audio.
0 of 18741 video frames found with errors.
0 of 0 audio frames found with errors.
0 corrupted video bytes in file.
96.596501 seconds of video timestamp gaps.
0.000000 seconds of audio timestamp gaps.

End of Log
-=Ken Jarstad=-
Linux Kubuntu 20.04, DIY ASRock MB, Ryzen 3 1200 CPU, 16 GB RAM, GT-710 GPU, 250 GB NVMe, edit primarily with Shotcut
User avatar
Ken Jarstad
Premiere Member
Premiere Member
 
Posts: 978
Joined: Wed Feb 21, 2007 2:16 pm

Re: How to fix bad MPEG-2 clips

Postby RJ Johnston » Tue May 11, 2010 11:19 pm

Thanks, Ken.

Why are you using this fine free utility when you could use VideoReDo Plus?

Are you still creating AVCHD discs from your HDV video in Platinum?

Do you export back to HDV using smart rendering in Platinum?

Rob
User avatar
RJ Johnston
Premiere Member
Premiere Member
 
Posts: 3143
Joined: Thu Apr 12, 2007 4:33 pm
Location: Northern California, USA

Re: How to fix bad MPEG-2 clips

Postby Ken Jarstad » Tue May 11, 2010 11:44 pm

RJ Johnston wrote:Thanks, Ken.

Why are you using this fine free utility when you could use VideoReDo Plus?

Are you still creating AVCHD discs from your HDV video in Platinum?

Do you export back to HDV using smart rendering in Platinum?

Rob

Whaaaaaat - and pay??

Better than that - I have mostly finished editing my first three-camera on-location video shoot for the cable access program. Vegas 9 Platinum handled all three camcorder captures, one above the other on the timeline, and I used the composite envelope technique to to put in 'takes' between them. It was a blast!

Yes, I exported my finished HDV timeline back to another HDV file since I had the three camera tracks and a fourth with some outdoor shots to insert during appropriate dialog. Since all four tracks that Platinum supports were taken I had to render out to a new HDV file. Now I'm adding intro video, theme music, credits and such.

I did two 30 minute shows like that and but then took the two intermediate HDV renders and, just for fun, added them to Nero Vision 10, added a simple menu and burned a standard definition DVD. I did this because the people I create these videos for don't have Blu-ray equipment. I played them on my system which then upconverted the video to play on my 32 inch HDTV.

Robert - I could hardly believe my eyes. The image quality I swear looked almost high definition!!!

This IS the "Holy Grail" of of video production IMHO - to make a SD DVD look nearly as good as a Blu-ray disk. I have only seen this on the very best commercial SD DVDs. Woo hoo! I am happy!
-=Ken Jarstad=-
Linux Kubuntu 20.04, DIY ASRock MB, Ryzen 3 1200 CPU, 16 GB RAM, GT-710 GPU, 250 GB NVMe, edit primarily with Shotcut
User avatar
Ken Jarstad
Premiere Member
Premiere Member
 
Posts: 978
Joined: Wed Feb 21, 2007 2:16 pm

Re: How to fix bad MPEG-2 clips

Postby RJ Johnston » Wed May 12, 2010 12:11 am

Regarding smart rendering, the very few HDV (.m2t) sample files I have would not smart render in Platinum until I ran them through VideoReDo or Magix MEP 16. I just ran them through your new-found utility, and that works as well to create smart renderable files.

Very nice find.
User avatar
RJ Johnston
Premiere Member
Premiere Member
 
Posts: 3143
Joined: Thu Apr 12, 2007 4:33 pm
Location: Northern California, USA

Re: How to fix bad MPEG-2 clips

Postby Ken Jarstad » Wed May 12, 2010 12:18 am

Great, Robert! Looks like we have a winner. :-5
-=Ken Jarstad=-
Linux Kubuntu 20.04, DIY ASRock MB, Ryzen 3 1200 CPU, 16 GB RAM, GT-710 GPU, 250 GB NVMe, edit primarily with Shotcut
User avatar
Ken Jarstad
Premiere Member
Premiere Member
 
Posts: 978
Joined: Wed Feb 21, 2007 2:16 pm


Return to Tips and Tricks 


Similar topics


Who is online

Users browsing this forum: No registered users and 12 guests

cron