Log in

View Full Version : editing H264/mp4 videos with virtualdub..possible?


jacktradesy2k
1st December 2011, 03:05
Hiya,
I would like to know if it is possible to edit H264/mp4
videos with virtualdub?
If yes which other codec's or filters do I need to install on to my system?
Thx alot in advance,jacktradesy2k
Ps Here is all the Info on of them videos I am try edit.

Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 272 MiB
Duration : 1h 39mn
Overall bit rate mode : Variable
Overall bit rate : 381 Kbps
Writing application : Lavf52.102.0

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L1.3
Format settings, CABAC : No
Format settings, ReFrames : 3 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1h 39mn
Bit rate : 308 Kbps
Width : 320 pixels
Height : 240 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.160
Stream size : 220 MiB (81%)
Writing library : x264 core 114
Encoding settings : cabac=0 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / vbv_maxrate=768 / vbv_bufsize=3000 / crf_max=0.0 / nal_hrd=none / ip_ratio=1.41 / aq=1:1.00

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 1h 39mn
Bit rate mode : Variable
Bit rate : 68.5 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 49.0 MiB (18%)

hello_hello
1st December 2011, 12:37
Once you edit do you want to re-encode or are you hoping to just delete bits and resave what's left without re-encoding?

AVIDemux might be a better option, but I've not used it myself.

There's a plugin for VirtualDub to open MP4 (and MKV) files but it's hopeless for accurate x264 editing.
You can open pretty much any type of file via an AVIsynth script using VirtualDub, but of course after editing you'd have to re-encode. Do you have AVIsynth installed?
If you do you can even try VirtualDubMod. It has a "use AVIsynth template" dropdown box at the bottom of the window which opens after you select File/Open. If you select the DirectShow option you can open just about any type of file for which you have the correct codecs installed. i.e. if you can play it, you can probably open it with VirtualDubMod that way.

LoRd_MuldeR
1st December 2011, 12:48
Indeed, if he want to re-encode anyway, then Avisynth is a good way to go. There are Avisynth source filters available for almost everything, thanks to FFmpegSource2 and DGDecode/DGDecNV.

And Avisynth-input works very well with VirtualDub. Though, generally, you will be restricted to VFW-Codecs and AVI output, once you have imported your source into VirtualDub.

(I know that there are some VFW Codecs, such as x264's VFW interface, that allow bypassing VirtualDub and writing the video directly into the desired container format).

If he needs to edit the video without re-encoding, then Avisynth is not an option. Avidemux should be able to the job. But be aware: Avidemux 2.6 has improved frame-accuracy for H.264 video a lot!

Of course Avidemux can also be used for re-encoding - without having to worry about VFW Codecs. Though limited to the "built-in" encoders (not usually a problem, as there are many ^^).

ale5000
4th December 2011, 03:04
You could try VirtualDub + QuickTime input plugin (http://forums.virtualdub.org/index.php?act=ST&f=7&t=19488) (take the one from fccHandler, not the others) that will allow to open the mp4 directly.

hello_hello
4th December 2011, 04:41
Even with the correct plugin VirtualDub seems hopeless for frame accurate editing of h264 video. If you skip around the video using the jump to keyframe navigation buttons you'll notice that as you jump back and forth the time stamps for a particular keyframe are rarely the same twice.

jacktradesy2k
5th December 2011, 02:03
Hiya,
I dug the old gordian knot out gave VirtualDubMod another go.
Without any sucess.
On the other hand i managed to to edit the H264/mp4 with vdvideosofts Free Video Dub program.
The gui is a bit of hassle to get use to but get's things done.
Which is ok for now.
Thx alot for all the help

hello_hello
5th December 2011, 03:37
I guess we'll never find out if you just wanted to edit the video, or if you wanted to re-encode it after editing?

jacktradesy2k
5th December 2011, 14:02
To resolve the greatest mystery in the entire universe.
All I wanted to do is..for now.was to edit those videos.

hello_hello
6th December 2011, 10:35
It's hardly the greatest mystery. It's not even remotely important. When you post in forums asking for help though, answering the questions asked of you not only makes it easier for those trying to help you to do so, it's also good manners. There's no mystery there.

jfcarbel
29th December 2011, 08:29
If he needs to edit the video without re-encoding, then Avisynth is not an option. Avidemux should be able to the job. But be aware: Avidemux 2.6 has improved frame-accuracy for H.264 video a lot!
^^).

Lord Mulder, can you explain.

Is avidemux 2.5 able to cut/edit H.264? Does 2.5 version only support this cutting on I-Frames? What version of 2.5 supports h.264 editing (that is, does this require a beta build)?

In regards to your comment that Avidemux 2.6 has improved h,264 frame accuracy alot, I believe 2.6 is an experimental build or is this an incorrect interpretation for specific builds? Is there a fairly stable 2.6 build that can be used for h.264 editing?

LoRd_MuldeR
29th December 2011, 14:15
Lord Mulder, can you explain.

Is avidemux 2.5 able to cut/edit H.264?

Yes, but Avidemux 2.6 has much improved for such things.

Does 2.5 version only support this cutting on I-Frames?

If you want to cut an existing stream without re-encoding, you can only cut at I-Frames.

More specifically, each "section" you keep in has to start with an I-Frame and must not end with any B-Frames (here I talk about display order).

That's the Nature of Things. It's not an Avidemux limitation ;)

What version of 2.5 supports h.264 editing (that is, does this require a beta build)?

Anyone, more or less. But, as always, your best choice is to go with the latest SVN build.

And, as said before, frame-accuracy for H.264 streams has greatly improved in 2.6, while in 2.5 it was more "guess and try" for this kind of tasks.

In regards to your comment that Avidemux 2.6 has improved h,264 frame accuracy alot, I believe 2.6 is an experimental build or is this an incorrect interpretation for specific builds? Is there a fairly stable 2.6 build that can be used for h.264 editing?

Try the latest one from Gruntster's site. And report back problems you may encounter:
http://avidemux.razorbyte.com.au/#betaBuilds

cord-factor
29th December 2011, 16:46
jfcarbel, if you have enough free space on your hard drive, you can uncompress your materials to ffvhuff+PCM (in AVI container). Edit it without any restrictions. And then encode to codec@format you want.
Yes, it is two steps (two encodings). However, I-frame cuts is often inconvenient, by itself. You want to cut in this point, but the I-frame is not there, so you will have to cut video were the I-frame is, and so on... With uncompressing you will not have this issues, plus no any potential 'out of sync' or 'frame occuracy' problems.
Good luck.

LoRd_MuldeR
29th December 2011, 17:04
jfcarbel, if you have enough free space on your hard drive, you can uncompress your materials to ffvhuff+PCM (in AVI container). Edit it without any restrictions. And then encode to codec@format you want.

It should be mentioned that you usually don't need to use an uncompressed intermediate file for this purpose.

Unless you operate in "Copy" mode (aka "direct stream copy"), the video editor will re-encode anyway and thus all cut-point restrictions are gone.

You can also use use Avisynth input instead of an uncompressed intermediate file in this case.

Nonetheless, as soon as you are re-encoding, there will be some quality loss. Just cutting the original streams is 100% lossless...

jfcarbel
29th December 2011, 17:42
Yes, but Avidemux 2.6 has much improved for such things.

If you want to cut an existing stream without re-encoding, you can only cut at I-Frames.

More specifically, each "section" you keep in has to start with an I-Frame and must not end with any B-Frames (here I talk about display order).

Try the latest one from Gruntster's site. And report back problems you may encounter:
http://avidemux.razorbyte.com.au/#betaBuilds

By "each section" do you mean each GOP? And in 2.5 is there a way to tell what is an I-Frame and if it ends with a B-frame?

I will indeed download Gruntster's build and give it a try.

On a separate note, is 2.5 still fully fine for Xvid editing in direct copy mode? Or is it the same in that 2.6 version is better for Xvid as well?

LoRd_MuldeR
29th December 2011, 18:02
By "each section" do you mean each GOP? And in 2.5 is there a way to tell what is an I-Frame and if it ends with a B-frame?

No. With "section" I mean each sequence of consecutive frames from the original input H.264 stream that you copy over to the output H.264 stream.

Each of these sections may consist of a huge number of GOP's. Actually what you have to ensure is that a "section" doesn't begin or end in the middle of a GOP.

If a section doesn't start with an I-Frame, all frames, up to the section's first I-Frame, will be undecodable. The same goes for "orphaned" B-Frames at the end of a section

And, as said before, Avidemux 2.5 has some frame-accuracy problems for H.264 footage. So it doesn't always tell you the correct frame type. Use v2.6 ;)

On a separate note, is 2.5 still fully fine for Xvid editing in direct copy mode? Or is it the same in that 2.6 version is better for Xvid as well?

Xvid is a video encoder, not a video format. There is no such thing as "Xvid video" that you could edit.

What you probably mean is: Can video encoded by Xvid, i.e. video in the MPEG-4 ASP format, be edited in Avidemux 2.5?

And, as far as I know, there should be no frame-accuracy problem for MPEG-4 ASP streams in Avidemux. 2.5.

Avidemux even supports "smart re-encoding" for MPEG-4 ASP video. This means, cutting at Non-I-Frame is support for that specific format.

(In that case only the beginning of your selection, i.e. everything up to the first I-Frame, will be re-encoded. The rest is copied 1:1)

cord-factor
30th December 2011, 11:27
It should be mentioned that you usually don't need to use an uncompressed intermediate file for this purpose.

Unless you operate in "Copy" mode (aka "direct stream copy"), the video editor will re-encode anyway and thus all cut-point restrictions are gone.
Yes, of course. If he will make encoding right away there are no any issues at all (I think).

And, as far as I know, there should be no frame-accuracy problem for MPEG-4 ASP streams in Avidemux. 2.5.
Confirmative. I have used it with "xvid" and "direct stream copy" cutting on I-frame points many times. No any problems in all cases.

movmasty
20th January 2012, 21:56
And, as said before, Avidemux 2.5 has some frame-accuracy problems for H.264 footage. So it doesn't always tell you the correct frame type. Use v2.6 ;)

What you probably mean is: Can video encoded by Xvid, i.e. video in the MPEG-4 ASP format, be edited in Avidemux 2.5?

And, as far as I know, there should be no frame-accuracy problem for MPEG-4 ASP streams in Avidemux. 2.5.

In my experience roughly 15/20% of MPEG-4 ASP video cant be lossless cut in Vdub or Avidemux,
some of the chunks will be unreadable for the first GOP,
all of these are encoded without packet bs(but not all the)

Does also in MPEG-4 ASP any chunk has to end too with a Keyframe?