View Full Version : Encoding Skateboarding Videos
endtroducing
30th April 2009, 02:00
I've set on a project to encode some skateboarding videos in x264. The sources are a complete disaster as all the footage is taken with mobile cameras and end up pure interlaced. I'm wondering if anyone has any tips on some methods of maximizing transparency for these types of sources.
I'm using MeGUI to encode and AvsP to write my script. Below are some screen shots I've taken of the source with the encode.
For the encode here's my command line for MeGUI:
program --pass 2 --bitrate 2500 --stats ".stats" --level 4.1 --ref 5 --mixed-refs --no-fast-pskip --bframes 6 --b-adapt 2 --weightb --direct auto --deblock -1:-1 --subme 8 --trellis 2 --psy-rd 0.8:0.5 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --vbv-bufsize 14000 --vbv-maxrate 17500 --b-bias 4 --me umh --merange 24 --threads auto --thread-input --aq-strength 1.2 --progress --no-dct-decimate --output "output" "input" --sar 10:11
If anyone needs clarification on those values, feel free to ask.
Thanks in advance.
Sagekilla
30th April 2009, 02:15
Preprocessing can do wonders. Have you done any in avisynth yet?
Inspector.Gadget
30th April 2009, 02:17
The general advice around here for pure interlaced is to use a high-quality bobber; if you do a forum search for "high-quality bob" you'll find a plethora of suggestions. With MeGUI and x264, I'd use one of the DXVA presets if I had a compliant graphics card that I planned to use or else use one of the Unrestricted presets. The included MeGUI presets are well-tuned.
video_magic
30th April 2009, 02:56
Preprocessing can do wonders. Have you done any in avisynth yet?
Sometimes, I feel one is better 'leaving well alone' - I mean that as not losing the detail of the original footage:: as in forget debobbing etc: I wonder if the original poster wants to preserve the original detail as much as he would prefer advice to alter it for a more 'pleasing result' (aha!?)?
Sagekilla
30th April 2009, 03:33
Personally, I would remove all interlacing all together since x264 handles progressive sources much better than interlaced. Plus, with some of the very good bobbers for double rate bobbing, the results are very pleasing.
video_magic
30th April 2009, 03:48
Sorry, but as an amateur, I feel obligfed to ask what you presume to know: do you prefer somebody to deal with their capturing problems (interlaced field lines) or deal with it after - I'm not hostile, just a sick-0f-it-amateur
but I reallly appreciate the advice and I don;t wanna sound horrible
I just want my videos in h.264 to llok the same as my captures sub - 2000 KBps encodes - is this possible or not, settings givien please.
Dark Shikari
30th April 2009, 03:51
Sorry, but as an amateur, I feel obligfed to ask what you presume to know: do you prefer somebody to deal with their capturing problems (interlaced field lines) or deal with it after - I'm not hostile, just a sick-0f-it-amateur
but I reallly appreciate the advice and I don;t wanna sound horrible
I just want my videos in h.264 to llok the same as my captures sub - 2000 KBps encodes - is this possible or not, settings givien please.Your simultaneous flooding of a ~half-dozen threads on the forum with comments about how people shouldn't modify their sources is not really welcome. Let people do what they want.
video_magic
30th April 2009, 03:53
OK. I feel like a fool, but how not to 'alter' but to preserve in h264 or another AVC h264. Isn't degraining etc losing detail?
Sagekilla
30th April 2009, 03:53
That's a bit off topic and deserves it's own thread in avisynth -- But the discussion of deinterlace before or after encode is a valid one here.
If you do 25i -> 25p, it will encode more efficiently in x264 at the loss of temporal information (choppier looking video). Doing 25i -> 50p will give smoother looking video at the cost of coding efficiency since you now have twice as many frames in one second. 50p is ideal, but sometimes you don't need that much information. Here, I would opt for 50p since skateboarding videos would likely have a lot of movement (higher temporal resolution here would be helpful).
But, if you had a very high quality deinterlacer that could be used during decoding, you could just encode as 25i and take advantage of good bobbing later.
video_magic
30th April 2009, 03:57
Ok guys, I was lost with your advanced talk.
I just feel that some other than me, wants to capture their videos,
They will (PAL) want to capture at 720x576 etc
They will want their final video to be 520x756
They don't want to mess around, just want to encode at sub-2000 bitrates without further loss - I feel we are being looked-over - sorry. any advice apprecitedfor this aim?
video_magic
30th April 2009, 04:01
Thanks sagekilla - just want you to know that I appreciate in a long search, your response (and Dark Shikaris' in a more remote sense. thanks)
endtroducing
30th April 2009, 04:16
Okay, so if I'm correct by what you mean "bobber" by that is the filter that will de-interlace the video.
For that I'm using the filter: YADIFMod(edeint=NNEDI())
This has done an excellent job to get rid of the interlacing as you can see by the screens.
Sagekilla, what do you mean by pre-processing? Is that something I can do within my script via AvsP?
What are some of the general settings in MeGUI that I can alter for my test runs to see if I can get some good results?
video_magic
30th April 2009, 04:23
Ok, forget me if I am beneath you, but if one wants to preserve rather than 'enhance' what should one select??? (and damn me for annoying you if I am uncool and challenging)
Dark Shikari
30th April 2009, 04:33
Ok, forget me if I am beneath you, but if one wants to preserve rather than 'enhance' what should one select??? (and damn me for annoying you if I am uncool and challenging)This isn't your thread. Ask this in your own thread; stop hijacking others'.
Blue_MiSfit
30th April 2009, 04:33
Okay... stop everything :)
You need to know something, set in stone before you make any other decisions. How you're going to code the fields!
Are you going to:
A) Keep it interlaced
or
B) Deinterlace (to 25p or 50)
Deciding between A and B depends on how your video will be played!
Are you planning on putting this on the web, so people watch it through Flash? Just want an MP4 / MKV that people can download and play in whatever player? QuickTime compatibility?
Decide on your distribution method, then we can help you with tweaking encoding settings to optimize for that.
Regarding preserving the source - this is kind of a moot point. You're not preserving anything when you re-encode. If you can do some careful pre-processing (like degraining usually noisy chroma planes etc), you will end up with a better net result (closer to the source) than your unfiltered encode. The objective here is to improve any glaring problems with the source, and in doing so create a more compressible video.
Important to realize that pre-processing via AviSynth allows greater control over which aspects of the image will be preserved - as opposed to blindly encoding and hoping the results will look good.
A general question - any reason you're using VBV? I guess this figures into the target question ;)
Oh, and let's see a sample!
~MiSfit
endtroducing
30th April 2009, 04:49
I indicated above that I was deinterlacing. Beyond that, I don't know what those 2 values mean. The video is intended to be played at the user's discretion and not online.
Is there a guide I can look at for pre-processing as I've never heard of this before. However, I'm quite interested.
As for VBV, I'm not sure what it is, but it was default in my script. I've been using a guide to do most of my encoding, so these are some new techniques I'm learning here.
Inspector.Gadget
30th April 2009, 05:08
The VBV in that command line appears to be for DXVA compatibility, so it's nothing out of the ordinary. "Pre-processing" can be anything from denoising/sharpening/restore functions etc. to the usual color correction/deinterlacing/IVTC/cropping/resizing. MeGUI walks you through the basics, it's up to you if anything further needs to be done (IMO, better to underprocess and have things you can correct on playback than apply the wrong functions and screw up the encode).
Blue_MiSfit
30th April 2009, 06:57
Post a sample clip :) I can't offer any more advice without seeing one.
If you're planning on doing a download based encode, then you don't really need VBV, but no harm in having it on. Forget I said anything. It's for stand-alone player compatibility - think iPod, BluRay player, etc...
~MiSfit
Selur
30th April 2009, 07:29
little question about the bobbing to 50p and coding efficiency: I posted (http://forum.doom9.org/showthread.php?t=128545) a while back about my surprise that bobing really is doubling the filesize and I wanted to ask if anything changed regarding this. :)
Cu Selur
endtroducing
30th April 2009, 23:29
Here's a link to my encoded sample with the script I posted above:
http://www.mediafire.com/?2mnnnzizkom
When you mention bobbing, is that deinterlacing? I don't really understand the point of it / what it does, which also means I have no idea how to use it.
Sagekilla
1st May 2009, 00:24
Yes. There's two kinds though: single rate (25i -> 25p) and double rate (25i -> 50p) bobbers. Double rate is better in the sense that you have more temporal information, but it takes a lot more bits.
endtroducing
1st May 2009, 01:05
Yes. There's two kinds though: single rate (25i -> 25p) and double rate (25i -> 50p) bobbers. Double rate is better in the sense that you have more temporal information, but it takes a lot more bits.
With my deinterlacing filter is that 25i to 25p or 25i to 50p?
My filter is: YADIFMod(edeint=NNEDI())
benwaggoner
1st May 2009, 04:37
Yes. There's two kinds though: single rate (25i -> 25p) and double rate (25i -> 50p) bobbers. Double rate is better in the sense that you have more temporal information, but it takes a lot more bits.
Well, I don't know if it's a LOT more bits. Higher frame rate means smaller change between frames. Also, artifacts aren't as visible as longer and so have lower visual impact.
My rule of thumb has been doubling framerate requires more like 40-50% more bits to keep the same subjective image quality.
Sagekilla
1st May 2009, 05:20
Yes, there is a smaller difference frame to frame, and each artifact can stay on the screen for half as long as before by virtue of double frame rate. I certainly wouldn't call "40 - 50%" more bits insignificant though ;) that's certainly a lot more than single rate.
But, If you do things properly, the bitrate jump isn't too bad. Most of the time I wouldn't expect lower than a 30% jump though.
With my deinterlacing filter is that 25i to 25p or 25i to 50p?
My filter is: YADIFMod(edeint=NNEDI())
AFAIK, yadifmod defaults to mode=0, so that's 25p. Use mode=1 for 50p:AssumeTFF() # or AssumeBFF()
yadifmod(mode=1,edeint=nnedi())
poisondeathray
1st May 2009, 14:30
AFAIK, yadifmod defaults to mode=0, so that's 25p. Use mode=1 for 50p:AssumeTFF() # or AssumeBFF()
yadifmod(mode=1,edeint=nnedi())
I think you would have to adjust nnedi to reflect the bob mode as well, nnedi(field=2) for alternating, starting with bottom , nnedi(field=3) for alternating, starting with top field
endtroducing
1st May 2009, 20:15
Okay, correct me if I did it wrong, but here's my script: YADIFMod(edeint=NNEDI(field=-2),mode=1)
It didn't really yield any better results... the bitrate is still 2500 and there's still some pretty heavy detail loss. YADIFMod in my experience has done a superb job even at default, so this alternation of modes didn't change much. Which leads me back to my original question: are there any values that I can change in MeGUI to help clean up some pretty grainy, less detailed sources, or am I forced to start the odyssey of learning how to pre-process?
It didn't really yield any better results... the bitrate is still 2500 and there's still some pretty heavy detail loss.
Bobbing only makes motion smoother, it doesn't improve spatial quality. Also, as others already explained, encoding more frames requires a higher bitrate to get the same quality within each frame. If you don't need smooth motion, you can save bits by deinterlacing to 25p. However, considering the type of the video, I'd personally deinterlace to 50p or encode as interlaced.
YADIFMod in my experience has done a superb job even at default, so this alternation of modes didn't change much.
Did you compare the videos by playing them at normal speed, or did you only look at still frames?
Which leads me back to my original question: are there any values that I can change in MeGUI to help clean up some pretty grainy, less detailed sources, or am I forced to start the odyssey of learning how to pre-process?
Learning is always a good idea. You could also post a sample clip of the source video and ask for advice on the AviSynth Usage (http://forum.doom9.org/forumdisplay.php?f=33) forum.
benwaggoner
2nd May 2009, 05:44
Bobbing only makes motion smoother, it doesn't improve spatial quality. Also, as others already explained, encoding more frames requires a higher bitrate to get the same quality within each frame. If you don't need smooth motion, you can save bits by deinterlacing to 25p. However, considering the type of the video, I'd personally deinterlace to 50p or encode as interlaced.
And if you don't mind reducing frame size some, the optimum experience with 2500 Kbps could be 50p at a lower frame size over 25p at the original. Particularly if a lot of the detail is actually noise, as you suggest. Noise reduction can also save a whole lot of bits, possibly making your original frame size at 50p look better.
I've had cases where noise reduction helped final quality more than doubling to bitrate would have.
Did you compare the videos by playing them at normal speed, or did you only look at still frames?
Yeah, critical when doing a bob. since the fields are actually different spatial areas, a less-than-awesome deinterlace can often cause pulsing when there's sharp horizontal or shallow diagonal details, since every other frame preserves a different part of that.
Interlaced is the new black and white...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.