VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 34
  1. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    I record mpeg4 videos from tv with my Ati aiw card. I'll need to cut commercials out of it and Virtualdub with "direct stream copy" does the job quite well without the need to re-encode.

    But I have a small problem. Cuts are not too accurate. I guess the reason is because I, P or B-frames are the ones where cut can be done or something like that.

    Is there a way to do frame accurate cuts to mpeg4 without re-encoding like you can do for example with VideoReDo to mpeg2?
    Quote Quote  
  2. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    I assume you are using DivX compression with the ATI card.

    1. Open file with G-Spot to see which MPEG4 codec the file was encoded with.
    2. Open the file you want to edit in Virtualdub.
    3. Select Video, Compression and find the video codec that was used.
    4. Edit the properties of that codec to make every frame a keyframe.
    5. Select Video, Fast Recompress and save new AVI. This should not affect the quality of the file.
    6. Take new AVI and cut all the commercials out.
    7. Direct stream copy audio and video and save final AVI.
    Quote Quote  
  3. Get the latest version of VirtualDub. It has smart editing. It can cut on any frame and will only reencode the small sections it needs to (around the cuts).
    Quote Quote  
  4. Member olyteddy's Avatar
    Join Date
    Dec 2005
    Location
    United States
    Search Comp PM
    @ jagabo, Does VirtualDub Mod or Mpeg2 do smart editing too? My source is MPEG2 from a Hauupauge PVR.
    Quote Quote  
  5. Originally Posted by olyteddy
    @ jagabo, Does VirtualDub Mod or Mpeg2 do smart editing too? My source is MPEG2 from a Hauupauge PVR.
    Neither of those has the smart editing feature. But with an MPEG2 source you're going to be using Fast Recompress, Normal Recompress, or Full Processing Mode. Those will let you cut on any frame you want anyway.
    Quote Quote  
  6. Mod Neophyte redwudz's Avatar
    Join Date
    Sep 2002
    Location
    USA
    Search Comp PM
    arrow, just for your information, some MPEG-4 codecs have a lot of frames between keyframes. Xvid for example, has 300 frames between keyframes by default. That makes frame accurate editing very difficult without some re-encoding. This problem is common with highly compressed formats. It's the codec that's the problem, not the editor.
    Quote Quote  
  7. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    Jagabo,

    I tried the smart rendering feature last week for the other thread we were talking about exact cutting of AVI in Virtualdub and talking about keyframes. This feature did not work for me because the codec settings have to be the exact same for the file you're making as the original file. any slight difference (and VDub doesn't work well with very slight differences) in the two settings and VDub will refuse to use this feature. I looked in the information page and set the codec to the same setting that info gave and it still refused to work.

    You have to use smart rendering with fast recompress anyway, according to the Virtualdub help files.

    Fast recompress doesn't care what the other codec settings are. It just turns every frame into a keyframe.

    The instructions that I gave for setting the keyframes in the codec and fast recompressing takes hardly any time at all (basically direct stream copying the file with the fast recompress feature) and makes every frame a keyframe so that exact frame by frame editing is possible.

    fast recompressing an MPEG2 file in VDub MPEG2 will give you a humongous uncompressed AVI file. You can frame by frame edit an MPEG2 file anyway since it is uncompressed when it enters VDub-MPEG2 and you have to compress it to an AVI compression anyway.

    For anyone using Virtualdub, the new version, 1.7.1 ( build 27021 ) is a must.
    Quote Quote  
  8. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    arrow, just for your information, some MPEG-4 codecs have a lot of frames between keyframes. Xvid for example, has 300 frames between keyframes by default. That makes frame accurate editing very difficult without some re-encoding. This problem is common with highly compressed formats. It's the codec that's the problem, not the editor.
    Try the instructions I listed above and change 300 to 1 in the XviD codec keyframe settings. That is the codec that I used in my test file. This is one of the coolest things that I have discovered and I've been using Virtualdub for over 7 years. I was e-mailing Phaeron for help, long before the unofficial Virtualdub messageboard was created.

    I figured the only way it could be done was to recompress the file. Glad I didn't give up.
    Quote Quote  
  9. Mod Neophyte redwudz's Avatar
    Join Date
    Sep 2002
    Location
    USA
    Search Comp PM
    I have changed the keyframe rate to one when I desperately needed to do some frame accurate editing on a Xvid, but the filesize also went up by 3-4 times.
    Quote Quote  
  10. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    The clip I tried wasn't very big. The original was 6,592kb before keyframe change and 7,102kb after keyframe change. I assume a full length movie would be pretty big but after editing and saving, you could always go back and set the keyframes back to 300 and fast recompress again to make the file smaller.
    Quote Quote  
  11. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    Thanks for the answers.

    My AIW seems to use divx 4 for mpeg4 packing and set keyrames to 300. All the solutions need the exact same codec but I couldn't find that from Virtualdubs format settings page. I'll find divx version 4, install it and give then a try.
    Quote Quote  
  12. Originally Posted by DarrellS
    I tried the smart rendering feature last week for the other thread we were talking about exact cutting of AVI in Virtualdub and talking about keyframes. This feature did not work for me because the codec settings have to be the exact same for the file you're making as the original file. any slight difference (and VDub doesn't work well with very slight differences) in the two settings and VDub will refuse to use this feature. I looked in the information page and set the codec to the same setting that info gave and it still refused to work.
    I never have any problems. I just set Xvid up for single pass constant quantizer encoding and pick the quantizer I want.

    Originally Posted by DarrellS
    You have to use smart rendering with fast recompress anyway, according to the Virtualdub help files.
    That's the setting you use but all frames that don't need to be recompressed are Direct Stream Copied. In most cases that will be the majority of the video. I took a 50 minute long Xvid file, cut out a half dozen short segments are random locations and saved the 45 minute long result in about 40 seconds.

    Originally Posted by DarrellS
    The instructions that I gave for setting the keyframes in the codec and fast recompressing takes hardly any time at all (basically direct stream copying the file with the fast recompress feature)
    It's certainly faster than when you're not doing all keyframe. Because the codec can skip all the motion vector analysis. But it's still much slower than smart rendering. The clip above took over 12 minutes in fast recompress with all keyframes. And the results will be additional compression artifacts on every frame of the video.

    Originally Posted by DarrellS
    and makes every frame a keyframe so that exact frame by frame editing is possible.
    Frame accurate editing is possible in anything other than Direct Stream Copy mode.
    Quote Quote  
  13. Originally Posted by arrow
    My AIW seems to use divx 4 for mpeg4 packing and set keyrames to 300. All the solutions need the exact same codec but I couldn't find that from Virtualdubs format settings page. I'll find divx version 4, install it and give then a try.
    Try using AVI FourCC Code Changer and changing the fourcc to Divx or Xvid. Then use either the Divx or Xvid codecs. Or waste your time and degrade your entire video as DarrellS suggests.

    Actually, you might not be wasting your time. Although frame accurate editing of any video is possible as long as you're not in Direct Stream Copy mode, it can be tedious. For example, if you're sitting on frame 299 of a 300 frame GOP and press Left Arrow to move to frame 298, VirtualDub has to seek all the way back frame 0 of the GOP and decode all 298 frames to display the requested frame. That can take several seconds depending on the speed of your CPU. If you're going to do lots of editing it might be faster to recompress as all keyframes. But you will be losing quality if you do that.
    Quote Quote  
  14. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    I tried the new Virtualdub Smart rendering. It did the cuts right. However there was a strange side effect.

    With Windows Media Player everything works fine but with Media Player Classic and Videolan there is a strange "jump" when the cutting place is played. There is a short black flash and Videolan kind of re-starts (when playing full screen the player part appears for a short period).

    Has anyone else had same kind of problems?

    I installed divx 4 encoder and used that with Virtualdub. Maybe I still check the codec configurations one more time...
    Quote Quote  
  15. Originally Posted by arrow
    I tried the new Virtualdub Smart rendering. It did the cuts right. However there was a strange side effect.

    With Windows Media Player everything works fine but with Media Player Classic and Videolan there is a strange "jump" when the cutting place is played. There is a short black flash and Videolan kind of re-starts (when playing full screen the player part appears for a short period).

    Has anyone else had same kind of problems?
    I haven't seen anything like that but I've only edited Xvid and a few DX50 (DIvx 5 and 6) files with smart rendering. If you single step forward through the same part of the video with VirtaulDub is there anything unusual?
    Quote Quote  
  16. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    I never have any problems. I just set Xvid up for single pass constant quantizer encoding and pick the quantizer I want.
    I Didn't use Target Quantizer in my test. I set the bitrate the same as the original and it spit out an error message.

    By using Target Quantizer, Virtualdub was able to use the same settings as the original file and use the Smart Rendering feature.

    Thanks for the info.

    Now that Virtualdub has this Smart Render feature, DivX and XviD may become the capture format of choice. No need to recompress a file if you can capture to a finished format and edit out what you don't want and smart render with Virtualdub.
    Quote Quote  
  17. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    I haven't seen anything like that but I've only edited Xvid and a few DX50 (DIvx 5 and 6) files with smart rendering. If you single step forward through the same part of the video with VirtaulDub is there anything unusual?
    Nothing unusual. Of course there is a new keyframe at the cut place but I guess it shouldn't mess anyhing. When I play the smart rendered video, player seems to change aspect ratio at that cut keyframe and then change it back right away. Could there be some new encoder information that palyer needs to think for a while or something? Windows media player works ok with the file.

    I tried to change smart rendering codec to xvid in Virtualdub and it did the rendering ok but the result was same. With Divx5 Virtualdub refused to encode at all.
    Quote Quote  
  18. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    After editing, try using mpeg4modifer to put a new aspect ratio through the whole file. It sounds like the AR flag is being lost for just the re-encoded frames. WMP has no problems because it is too stupid to recognise that AR flags even exist. It won't even recognise them in 16:9 flagged mpeg-2 files.
    Read my blog here.
    Quote Quote  
  19. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    Thanks for the tip guns1nger! That solved the issue and video is working now in all players.
    Quote Quote  
  20. I was able to duplicate your problem. Xvid's AR flags when you smart reencoded the AVI were different than those in the original AVI. You can check the AR flags of the original with MPEG4Modifer, then set the AR flags the same in Xvid when you edit/encode.



    Some players appear to read the AR only once and use that for the entire video. Others appear to read and adjust the AR throughout the video.
    Quote Quote  
  21. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    Thanks jagabo.

    I couldn't find AR settings in divx 4 encoder but found them from Xvid encoder thanks to your tip. However there was a tiny freeze during cut frame when I played the xvid encoded video. Maybe I need to play bit more with the settings.

    I also tested with ffdshow encoder (I chose mpeg4 with Fourcc:divx) and set AR there to be the same as in source and that did the trick. Video was ok now right after Virtualdub smart rendering and worked at least in VLC and MPC. No freezes like with xvid.
    Quote Quote  
  22. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    I've been now able to cut out commercials from my movie gallery without problems. Thanks for the tips guys!

    But I want to get back to this DarrellS's method. DarrellS said that if I use exact same codec settings and fast recompress in Virtualdub it shouldn't affect the video quality.

    If I need to decrease the file size is the best way to use same codec but smaller bitrate and fast recompres in Virtualdub? At least I haven't been able to find similar application than DVDShrink for mpeg4.
    Quote Quote  
  23. Originally Posted by arrow
    DarrellS said that if I use exact same codec settings and fast recompress in Virtualdub it shouldn't affect the video quality.
    He's wrong. Any time you compress with a lossy codec you will lose detail and generate artifacts. It may not be very noticeable but there will be a loss of quality. Using all I frames will definitely generate worse looking video with the same codec at the same bitrate.

    Originally Posted by arrow
    If I need to decrease the file size is the best way to use same codec but smaller bitrate and fast recompres in Virtualdub? At least I haven't been able to find similar application than DVDShrink for mpeg4.
    I'm not aware of any applications like DVD Shrink for MPEG 4 video. Generally, the benefit of DVD Shrink is that it's faster, not that it's better than decompressing and recompressing. DVD Shrink's method may yield better quality when shrinking by a very small amount.

    If you must reduce the file size of a video that's MPEG 4 part 2 (Divx, Xvid, etc.) compressed, using a codec that's better than Divx/Xvid will generate better results than using Divx or Xvid, h.264 for example. But again, you will be reducing the picture quality because you recompressed, just not by as much.
    Quote Quote  
  24. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    Thanks for the tip. I tried x264 vfw encoder with AIW capture and it seems to work great. Smaller size, better quality.

    Only problem is that I cannot open files with Virtualdub. I get error:
    MPEG Import filter: invalid pack at position 3: marker bit not set; maybe MPEG-2 stream
    I did turn on libavcodec for h264 from ffdshow's decoder part.

    Could there be a problem in ATI MMC capture?
    Quote Quote  
  25. x264 is an encoder only. ffdshow's VFW decoder can uncompress x264 video for VirtualDub. Make sure you enabled the VFW decoder, not just the DirectShow decoder.
    Quote Quote  
  26. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    I found out why Virtualdub gave that error. Video file was actually mpeg2. For some reason MMC didn't accept the new x264 profile I created and used default mpeg2 recording. That's why it looked good .

    When I got x264 avi profile accepted MMC didn't even start to record. Most likely it's too heavy codec or something. I did a test encoding session with Virtualdub and encoding process was really slow.

    I enabled h.264 also from VFW decoder. Encoded h.264 file opened in Virtualdub but there was no picture. It says that codec cannot decompress to an RGB format. I should check if there is any "force YUY2" option selected.

    Any ideas?
    Quote Quote  
  27. You won't be able to capture with x264. It's way too slow.

    Go to ffdshows output options and enable RGB as an output type:

    Start -> All Programs -> ffdshow -> VFW Configurartion -> Decoder tab -> Image Settings -> Output
    Quote Quote  
  28. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    Thanks jagabo.
    I installed newest version of ffdshow and did those activations. Now it's working in Virtualdub. It takes some time for video to start after play button but I guess that's because codec is heavier.
    Quote Quote  
  29. Member
    Join Date
    Feb 2007
    Location
    United Kingdom
    Search Comp PM
    Another suggestion for doing frame-accurate editing with VirtualDubMod:

    I'm assuming the goal is to import an MPEG2 file, edit it frame-accurately in VDubMod, and then push it through XviD or some similar codec.

    One useful way of doing this is to pull the original MPEG2 file into VDubMod, set up VDubMod as a frameserver, and serve frames to a second instantiation of VDubMod. The second VDubMod will see every frame as an I-frame. Snip out all the junk, cutting at any frame you choose, and then bang the edit into XViD in the normal way. This is very simple.

    Or...

    Don't do the editing in VDubMod. Pull your MPEG2 stuff into an Avisynth script, controlled by AvsP. AvsP makes it very easy to do frame-accurate edits, which it translates into Avisynth code. The great joy of this is that you have much more flexibility than with the VDubMod edit method I outline above. For instance, you can set up straight cuts as Trims, and then with some simple text editing transform some of the cuts into dissolves. If you're editing out ads from a movie, sometimes you're left with a rather nasty cut, even if you are cutting frame-accurately. Avisynth gives you a very easy way to do dissolves, fade in, fade out, fade to black or whatever -- a whole palette of transitions to cover awkward cuts. Having set that up, save your Avisynth script and bang it into VDub or VDubmod for compressing in the usual way.

    --
    voodle
    Quote Quote  
  30. Member
    Join Date
    Mar 2002
    Location
    Finland
    Search Comp PM
    Actualy as I stated in the first post I'm editing mpeg4 files. However thanks for the tips voodle I guess those work fine with mpeg4 files. I have to give them a try.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!