Hi,
I've been looking for ways to crop my VP6 video without loss of quality. The bottomline on almost every thread is that this can't be done. However, I found one thread which stated it was possible in some cases using the header:
http://forum.doom9.org/archive/index.php/t-119748.htmlOpen windows calc, enter the height of the current file, and the set it to hex. Open virtualdub, and open tools->hex editor. Load your file in. Click on "strf" which will highlight the important chunk. (Not strl or strh.) Now look in the highlighted area of the left pane for the height, it'll probably start right underneath strf (the bytes will be backwards, but you should recognize it from what calc showed). Subtract 8 from the number (use calc if you aren't handy with hex) and replace the first byte - you probably won't need to touch the others. Save, and see if it worked.
Unfortunately this didn't work for me. On most players the video looked the same after editing and on a few players only the aspect ratio was changed. However, in Vdub the video did look cropped.
This gave me a sparkle of hope it might be possible. I then found this in the VP6 documentation:
OutputVFragments. The vertical decoded height of the frame as it should be scaled on output in 8x8 block units. See definition of ScalingMode below.http://multimedia.cx/mirror/vp6_format.pdfScalingMode. Internally a frame may be encoded at a different resolution to the eventual size that it is presented on output from the decoder. There are four ways to scale the frame on output MAINTAIN_ASPECT_RATIO, SCALE_TO_FIT, CENTER, OTHER.
This looks pretty interesting, although strangely I cannot find any of these properties in the Vdub Hex editor. These properties should be part of the I-frames, in the 'intra frame header'. Unfortunately I haven't been able to find such a header... Any idea?
+ Reply to Thread
Results 1 to 9 of 9
-
-
Hmmm, that's interesting.
However, in Vdub the video did look cropped
As for the "other" players you tried... are they using the "official" DirectShow decoder by On2 (vp6dec.ax) ?
If "yes", then the fault is on the filter itself --- if "no", then the fault is on the "alternative decoder" that's being used. -
Possibly it's because VirtualDub uses the VfW version of the VP6 codec.
http://forum.doom9.org/archive/index.php/t-151123.html
In a way, it doesn't matter because I upload most of them to Youtube, which would decode it incorrectly anyway... I'm hoping there's a way to crop the video that is picked up by the unofficial decoders out there. -
FWIW, MPlayer supports both the VfW and the DirectShow VP6 codecs.
Not sure if this will be helpful though.
Hummm, I didn't know that the reverse-engineering of the On2 codecs by the FFMPEG/LIBAV teams is a half-assed job
Just for the record, their RealVideo decoders still suck a lot, if I am not mistaken.
-
Hummm, I didn't know that the reverse-engineering of the On2 codecs by the FFMPEG/LIBAV teams is a half-assed job
But getting back to the second point in my first post: Do you know if and where I can found the properties listed in the documentation? -
You'd better read again the Section #9 (page 23) of the file vp6_format.pdf
And probably you'll need an ACTUAL hex-editor (XVI32 for example), so that:
a) you could view and edit the bits inside each byte, AND ...
b) ... perform a precise "Replace All" operation
C) Possibly you will find out that the open-sourced VP6 decompressors are even more b0rked than you thought:–/
Last edited by El Heggunte; 4th Nov 2011 at 10:39. Reason: update
-
You'd better read again the Section #9 (page 23) of the file vp6_format.pdf
-
You've got to look for some, let's say, "repetition patterns"
( apologies if this sounds strange to your ears and eyes, my English is both non-native and somewhat weak)
It would be easier to identify them if you were dealing with a "well-marked" format like, for example, DTS:
However, according to what I managed to understand from the 'VP6 PDF', the "constant bytes" for each encoded frame may vary too much
I mean, the "magic byte sequence" for VP6-file-#1 will differ from the "m.b.s." for VP6-file-#2
So the zeroth problem to be solved in this case is, one has to determine what is the file-specific "fixed byte sequences" which identify the beginning of every VP6 video frame inside the container (AVI, FLV, whatever).Last edited by El Heggunte; 5th Nov 2011 at 10:49.
-
You've got to look for some, let's say, "repetition patterns"
Well, I've attached the byte sequence file for ya, so you can have a look. I only took the first 125 frames (until the second key frame) with Vdub (direct stream copy). You can open it with XVI32. To me, it looks like one complete MESS of bytes...
Similar Threads
-
Smooth frame by frame accelerated video playback?
By Malachaidc in forum Newbie / General discussionsReplies: 10Last Post: 30th Jul 2012, 11:40 -
how do you crop a video frame?
By kr236rk in forum EditingReplies: 12Last Post: 18th Oct 2008, 10:02 -
How to edit MP4 header frame size?
By Darney76 in forum Portable VideoReplies: 4Last Post: 7th Jan 2008, 21:58 -
Anyone know how to fudge the frame size in an MP4 header?
By Darney76 in forum Video ConversionReplies: 1Last Post: 23rd Dec 2007, 18:48 -
Video codec VP6/7
By cheerful in forum Software PlayingReplies: 2Last Post: 11th Sep 2007, 18:09