halsboss
25th February 2009, 09:26
edit: see http://forum.doom9.org/showthread.php?s=&threadid=80430 "MPEG-4 B-frames in AVI/VFW hackery description".
This post is part FYI and part seeking suggestions from anyone else who has solved it.
XVID inside AVI using any VFW based application like AVISynth or VirtualDub, returns occasional out-of-sequence frames when going backward. This means probable broken results when processing with some filters including temporal processing and possibly setMTmode. I wondered for ages what was going on. non-VFW applications seem to work ok.
Here's threads describing the issue and the journey.
http://forum.videohelp.com/topic363395.html
http://forum.doom9.org/showthread.php?t=144713
Notionally, using packed-bitstream type AVIs for xvid content can fix it. But not always. mpeg4modifier can unpack/pack xvid AVIs. mpeg4modifier of itself was a good idea while it lasted. A packed bitstream xvid in .AVI (clip extract below) turned out to be a little odd. Unpacked with mpeg4modifier and repacked with it, and still had problems with it.
The only reliable way I found to get around it and have confidence in AVIsynth getting/using the right frames was a combination of mpeg4modifier and the latest ffmpeg -
(1) unpack it with mpeg4modifier
(2) convert to a lossless ffv1 .AVI (ffmpeg handles xvid's b-frames in AVI OK by the looks, though only from non-packed-bitstream AVIs)
(3) then process the ffv1 AVI with avisynth.
Command lines :-
"C:\SOFTWARE\MPEG4Modifier\mmcl.exe" --unpack --always-write "input.avi" "input-unpacked.avi"
"C:\SOFTWARE\ffmpeg\ffmpeg.exe" -y -i "input-unpacked.avi" -f avi -vcodec ffv1 -an "input-ffv1.avi"
It uses a bit of disk space. Anyone got an easier or more usable solution ? (eg maybe some tool to extract/copy the xvid directly from the .AVI into an .MP4 so it can be opened with DirectShowSource)
Here's a couple of clips to open in the latest Virtualdub
http://rapidshare.com/files/202285381/clip-packed-bitstream.avi
packed bitstream 400k
1. jump to frame 123
2. single-step through to frame 128 observing each frame
...frame 126 is the scene change and the door in the background opens smoothly
3. backward single-step through to frame 123 observing each frame
...at frame 126 notice at frame the door does a backflip for 1 frame
...frame 124 is where the scene change occurs
http://rapidshare.com/files/202285382/clip-ffv1.avi
ffv1 (not quite the same frames clipped, but contains the same sequence) 3Mb
1. jump to frame 25
2. single-step through to frame 35 observing each frame
...frame 30 is the scene change and the door in the background opens smoothly
3. backward single-step through to frame 25 observing each frame
...the movements and scene-changes stay the same
This post is part FYI and part seeking suggestions from anyone else who has solved it.
XVID inside AVI using any VFW based application like AVISynth or VirtualDub, returns occasional out-of-sequence frames when going backward. This means probable broken results when processing with some filters including temporal processing and possibly setMTmode. I wondered for ages what was going on. non-VFW applications seem to work ok.
Here's threads describing the issue and the journey.
http://forum.videohelp.com/topic363395.html
http://forum.doom9.org/showthread.php?t=144713
Notionally, using packed-bitstream type AVIs for xvid content can fix it. But not always. mpeg4modifier can unpack/pack xvid AVIs. mpeg4modifier of itself was a good idea while it lasted. A packed bitstream xvid in .AVI (clip extract below) turned out to be a little odd. Unpacked with mpeg4modifier and repacked with it, and still had problems with it.
The only reliable way I found to get around it and have confidence in AVIsynth getting/using the right frames was a combination of mpeg4modifier and the latest ffmpeg -
(1) unpack it with mpeg4modifier
(2) convert to a lossless ffv1 .AVI (ffmpeg handles xvid's b-frames in AVI OK by the looks, though only from non-packed-bitstream AVIs)
(3) then process the ffv1 AVI with avisynth.
Command lines :-
"C:\SOFTWARE\MPEG4Modifier\mmcl.exe" --unpack --always-write "input.avi" "input-unpacked.avi"
"C:\SOFTWARE\ffmpeg\ffmpeg.exe" -y -i "input-unpacked.avi" -f avi -vcodec ffv1 -an "input-ffv1.avi"
It uses a bit of disk space. Anyone got an easier or more usable solution ? (eg maybe some tool to extract/copy the xvid directly from the .AVI into an .MP4 so it can be opened with DirectShowSource)
Here's a couple of clips to open in the latest Virtualdub
http://rapidshare.com/files/202285381/clip-packed-bitstream.avi
packed bitstream 400k
1. jump to frame 123
2. single-step through to frame 128 observing each frame
...frame 126 is the scene change and the door in the background opens smoothly
3. backward single-step through to frame 123 observing each frame
...at frame 126 notice at frame the door does a backflip for 1 frame
...frame 124 is where the scene change occurs
http://rapidshare.com/files/202285382/clip-ffv1.avi
ffv1 (not quite the same frames clipped, but contains the same sequence) 3Mb
1. jump to frame 25
2. single-step through to frame 35 observing each frame
...frame 30 is the scene change and the door in the background opens smoothly
3. backward single-step through to frame 25 observing each frame
...the movements and scene-changes stay the same