Log in

View Full Version : Accurate keyframe edits on x264 streams with avidemux... suggestions


dwallersv
8th June 2008, 05:13
Okay... so I have an x264 stream that I'd like to edit without having to recode, saving lots of time. I do this on MPEG2 streams using VideoRedo (an excellent tool!), but unfortunately it doesn't support ASP or AVC yet.

Can-do with Avidemux (another excellent tool!). However, avidemux doesn't handle B-frames in ASP/AVC streams gracefully. In theory, I should be able to perform frame-accurate edits so long as I keep the cuts on I-frames, and then save the edited stream using the copy mode, creating an edited stream without recoding (and getting it done in literally a minute or so for an hour of video).

All good so far. Here's the problem: avidemux doesn't seek in a clean, predictable way due to the packed GOPs in these formats. So even when I advance I-frame by I-frame, I don't get consistent results -- I don't always land on an I-frame! Then, backing up or going forward a frame to get to the I-frame is goofy -- clearly the packed GOPs and B-frames are being handled weirdly.

So, here's the question: Anyone have advice/techniques for how to set markers in avidemux to make a clean cut between two I-frames (not necessarily consecutive)? I can do it, but it takes a lot of seeking back and forth with the I-frame fwd/back, and single frame fwd/back, until I get a clean display of the individual frames in the right order, can stop on the starting keyframe, mark it, go to the ending keyframe (then seek back and forth over and over like before), back up to the P/B frame right before the ending keyframe, mark it, then cut.

This works, but it's a lot of awkward effort. Worth it to preserve quality and save time avoiding recoding, but I'd love a simpler, more straightforward way to do this.

I've got one of those new Hauppauge HD PVR thingies on the way due tuesday, so I'll be doing a lot more h264 editing soon. Right now, it's a bit of a pain with the partially supported packed bitstream support in avidemux.

Thanks!

(please forgive me in advance if I've munged any of the terminology... I'm learning)

mean
8th June 2008, 07:56
It is not due to packed bitstream. Avidemux handles packed bitstream and mpeg4 SP/ASP just fine (except for some bugs).
The problem with h264 is that it as complicated reordering and frame depency scheme and avidemux does not have, at the moment, the logic to handle that.
So it lets the decoder does it, but it is causing a lag.
I.e. you feed a frame at moment T, it is displayed at T+N frames.

phnxcoyote
26th June 2008, 13:34
I've got one of those new Hauppauge HD PVR thingies on the way due tuesday, so I'll be doing a lot more h264 editing soon.


Are you having any success editing .TS H.264 recordings created by the Hauppauge HD PVR with Avidemux? I'm trying, but it doesn't seem Avidemux can handle HD PVR TS files without crashing. I just installed last night Avidemux 2.4.1 (r4160). I can open a .TS file in Safe Mode. As soon as I try doing anything, like playing the video or even advancing a frame, I get a Fatal Error crash. I've tried two different .TS files with the same results.

Here's a link to the sample 99MB TS clip I'm trying to edit in Avidemux.

http://www.gigasize.com/get.php?d=8m60brcgngc

mean
27th June 2008, 21:18
That file is using PAFF

The 2.4.x versions of avidemux are using an older version of lavcodec without PAFF support hence the problems

The 2.5-dev/experimental branch is using a newer lavcodec, and can open the file much better.

phnxcoyote
28th June 2008, 14:30
That file is using PAFF

The 2.4.x versions of avidemux are using an older version of lavcodec without PAFF support hence the problems

The 2.5-dev/experimental branch is using a newer lavcodec, and can open the file much better.

Thanks for the explanation. Where can I find the 2.5 version? I only see the 2.4 builds available for download.

LoRd_MuldeR
28th June 2008, 15:01
Thanks for the explanation. Where can I find the 2.5 version? I only see the 2.4 builds available for download.

It's not released officially yet. You got PM ;)