@chrisofsweden, you've received some fantastic advice to keep you busy for some time. In case there's any danger of getting sleep at night, here's some more stuff about chosing x264 encoding settings to keep you awake:
Note that some of the above is tailored to size-constrained encodes like Blu-Ray where controlling output filesize is important and often achieved through 2-pass encoding as mentioned.http://en.wikipedia.org/wiki/H.264
http://forum.doom9.org/showthread.php?t=96059
http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
https://sites.google.com/site/x264bluray/
http://git.videolan.org/?p=x264.git;a=blob_plain;f=doc/ratecontrol.txt;hb=HEAD
http://www-ee.uta.edu/dip/courses/ee5351/h.264spic.pdf
Cheers,
Francois
+ Reply to Thread
Results 61 to 90 of 116
-
-
Thanks. More evening literature
But seriously, thanks everyone for contributing. I'm not a total lazyboy that don't google my shit first. But when it came to this topic I needed it explained in simple ways.
Alot of tutorial info on encoding settings just says stuff like "Use LancZoz muxelizer for better quality when quantisizing lower than the plexatron is set to..."
Sometimes it's just neccessary to ask human beeings... You were all excellent human beeings btw
I still have ALOT to learn though. Maybe in 5 years I'll be giving out advice to another rookie... -
Just the fact that you seem to be:
1. Patient
2. Responsive
3. Open to learning
4. Respectful
...means you will probably go far and learn much.
Scott -
Naturally you might start to think how to get video from Vegas timeline directly into x264 encoder, without having it render first into some lossless codec. You can do it with Debugmode frame server and Avisynth to load timeline into encoder directly (to simply put it) . But Handbrake will not load Avisynth file, so you cannot do this using Handbrake. This software is highly praised but it lacks just this important feature. Avisynth can do some real interesting magic with videos. Most other x264 encoders can load Avisynth file.
-
What sort of CRF value/bitrate is required to eliminate the banding?
Are you using the HandBrake High Profile preset or something else? The High Profile Preset is the only one which uses the x264 default settings (or close to) so I wouldn't use anything else.
Not if you're going to use HandBrake. You'd probably need to use an AVISynth based encoder GUI. I've not used it much for preventing banding myself, but the Gradfun3 filter on this page includes dithering (since discovering it I'm yet to encode a source where banding has been an issue, so I've only played around with it). http://avisynth.org/mediawiki/External_filters#Debanding
It dithers the 8 bit source to 16 bit and then back again, hopefully eliminating most of the banding in the process. You'd need to use a GUI which creates AVISynth scripts for encoding though, and then install the filters required for Gradfun3 and manually add it to the script. Easy for me as I use MeGUI and I'm familiar enough with AVISynth scripts. Someone else may be able to suggest an alternative unless you're happy to spend an afternoon (or two) familiarising yourself. I don't think you can use external filters with HandBrake. -
Thank you for those kind words. I'd like to agree with you that I am those things
You all have had a great attitude as well towards an inquisitive newbie as myself. Very appreciated!
I tried both. No difference. I was wondering about this though. Selecting High Profile in Handbrake seemed to want to save the output file to .m4v and not mp4. What's the difference here?
I'm sorry. A typo snuck itself in. I meant to say that increasing the CRF value or choosing a really high bitrate and doing a 2-pass VBR DOES NOT eliminate the banding.
Offcourse. I actually tried the debugmode frameserver last night a quick session. Someone mentioned it earlied in this thread, so I had it fresh in memory. Now I had to use MeGUI as I discovered Handbrake would not accept input from the frameserver.
Now MeGUI was far more cluttery and difficult to get a hang of. Didn't quite get a grip of the difference between the One Click Encode-button and the Automatic Encode-buttons and the dialogs that pops up when you click them.
I read a little about AviSynth but I don't quite understand what it does either. It said that it's a frameserver as well, but why do I need to frameserve from vegas -> avisynth frameserver -> x264? If some kind soul could explain the workflow chain here in an easy way and what actually happens when it passes avisynth, it would be greatly appreciated.Last edited by chrisofsweden; 5th Apr 2013 at 02:29.
-
I always think of Avisynth like a must because video behind it is a fixer-upper. There is always something needing to be fixed before encoding. Always. Take Vegas' frame server for example. Vegas might shrink levels in RGB (original camera video is YUV, Vegas works with RGB). So if you did not fix it with Vegas effects you can do it in Avisynth with one line and make video YUV for Megui as well:
avisource("server.avi")
ConvertToYV12(matrix="PC.709")
If you export for YouTube you should do that, otherwise colors would be washed out. You might not do that if you are making Blu-Ray, you just convert your RGB into YUV, better always test it first, Vegas might behave differently with different videos:
avisource("server.avi")
ConvertToYV12()
You need to downsize you you do it right there also:
avisource("server.avi")
ConvertToYV12(matrix="PC.709")
LanczosResize(640,360)
And I do not even start with fixing damaged videos, like VHS sources, there is Avisynth plugins to restore such videos. De-noisers also, you can save bitrate doing this for streaming etc.
I completely go around those one click encoder tool (megui) or will not let Avisynth to create scripts ( in megui ), better to do it yourself, it is quite simple, and then drop Avisynth script as input for video in Megui interface.
If you have more audio tracks in Vegas check "Write audio as PCM samples in signpost avi" in Debugmode export, otherwise audio might be a problem. I do this automatically anyway to prevent some audio problems. Debugmode asks Vegas to give him one mixed PCM track first and saves it into that signpost.avi
Other IMPORTANT think remember DebugMode frame server exports ALWAYS project properties in Vegas, not properties of clips in it.
So think of it that video is just ready to be encoded upon loading into encoder, so you can go further and use command line for x264 encoder, where the input is Avisynth script. Suddenly you can make your own encoder writing couple of lines in BAT file. We mostly encode always only same things for ourselves, all over again and again. This you do not have to do, but certainly it opens door to do processes automatically.
like this one, encodes debugmode frame server into H.264, AAC, with CRF,..., of course you need all files that are needed even for mp4box muxer (and files it needs), nero encoder, Bepipe in the same folder:
Code:@echo off @x264 --crf=18 --profile High --level 4.1 --ref 5 --output raw_video.h264 progressive_projekt.avs @echo+ @Bepipe --script "Import(^progressive_projekt.avs^)" | neroAacEnc.exe -lc -cbr 224000 -if - -of "audio.m4a" @echo+ if exist _video.mp4 (del _video.mp4) @mp4box -add raw_video.h264 -add audio.m4a _video.mp4 @echo+
Last edited by _Al_; 5th Apr 2013 at 09:11.
-
Thanks for that _Al_. When I tried to do an encoding today I ended up with an MP4 file and the audio in a separate AC3 file. Now that aint good. What did I do wrong?
-
It is just not muxed together, as I said I do not use one click encoder in Megui, I go through main gui - input TAB,
-drop Avisynth Script on "Avisynth script input",
-setting encoder settings for both video and audio
-click AutoEncode and NO target Size (because I'd use CRF in settings I do not want to override it or something)
-click queue, start -
Right, got it. When you click the AutoEncode button the muxing is done right away.
-
You can skip the whole frameserver thing and use the x264 encoder straight out of Vegas.
Choose Video for Windows (*.avi) as your output format.
Choose any template then choose customize template.
Set up your frame size, farme rate , filed order and pixel aspect ratio.
The dropdown under video format will show x264 as as option (assuming you have x264 loaded on your system)
The only drawback to this is that AAC audio is not an option (in Movie Studio, can't speak for the big boys)
You still must output the audio separately and mux it into mp4
Or use ffmpeg or AviDemux or Megui to passthrough the video and convert the pcm audio to aac in mp4. -
Where do I put x264 so Vegas will detect it?
I've done a few short encodes with DebugMode FrameServer and the video quality vs file size turns out great! BUT there seem to be some audio issues. Seems like in every final MP4 the audio is leading the video with about 2-300ms. What do do about that? -
You need x264vfw in order for vegas to recognize it (it's not the same thing as x264cli) . You need to install the 64bit version with 64bit vegas
RE: Debugmode, sync issues - was the preview in sync in vegas before frame serving ? What program were you using afterwards ? If you preview the avs script referencing the sign post are there any sync issues ? If its a constant sync issue (e.g. 100ms all the way through, not progressively worsening) you can mux it with a delay -
I solved the problems with audio becoming out of sync. When unticking "Create Audio as PCM Samples in AVI", or something like that, in the Frameserver options, the problem went away.
I thought about using x264vfw as suggested but generally Vegas rendering is awfully unstable. Crashes 50% of the times at 99% or sooner. Dont know if it has something to do with the codecs supplied with it but when choosing to render to Frameserver AVI it just works, which is nice for a change. -
Hmm, do you have only one audio track?
There is problem with audio project setting frequency, PCM frequency (always 48000?) and target audio frequency. Not sure what, Vegas recalculates to 48000 when it is checked - project is not 48000, it gets out of sync.
To pre-render audio is really handy in complicated projects with more audio tracks. Well this was a while ago that I had problems with some x264 encoders and not checking that box. -
Apple. http://en.wikipedia.org/wiki/Comparison_of_container_formats
I think MP4 officially supports AC3 audio these days so that bit's probably wrong, although it's possible not all devices support AC3 audio in MP4 files. I don't know why Handbrake defaults to M4V for certain. Maybe for AC3 compatibility or maybe to keep iDevices happy.
Was that also a typo? Increasing the CRF value actually decreases the quality/bitrate. -
Any kind of camcorder video capture nowadays is MPEG2/4 and we can assume the hardware did its job with the least amount of artifacts. You may or may not use, or choose this or that type of intermediate codec, depending on your situation and personal choice.
What is left is the final encoding of the NLE output, and as you have observed, with less than even so-so results. MainConcept is the built-in encoder in Vegas and in Premiere Pro (AME) and with such potentially crappy results we have to wonder why.
It has been mentioned by previous posters but here it is again: a realistic, cost-free, very high quality way out would be the workflow debugmode frameserver>avisynth>GUI that includes x264.exe in it (such as simple x264 launcher).
I don't know about Vegas, but Adobe has defended the "high quality" output of AME, saying in forums that it's all about enabling the mercury engine and shit. Beginners almost always go through that first, until they eventually couldn't care less, finally acquaint themselves with debugmode, avisynth, and x264, and wonder why it couldn't have been as simple as that to begin with.
Since x264 will only create elementary video streams, export video only from Vegas, and uncheck anything to do with audio in debugmode frameserver. Separately export the audio from Vegas directly as an *.aac, *.m4a, or *.mp3 file, then mux the two together (with My MP4Box GUI, for example) to create the final *.mp4 file. Doing it this way ensures perfect sync is maintained between audio and video throughout. If making a blu-ray disc, the separate *.264 and *.aac/wav/m4a/mp3 files can be submitted to the authoring program as they are without muxing.
Someone somewhere sometime has to write a plug-in for Premiere Pro and Vegas that will include options for directly exporting with x264. It may be free or cost an arm and a leg but that's another argument.Last edited by turk690; 6th Apr 2013 at 15:26.
For the nth time, with the possible exception of certain Intel processors, I don't have/ever owned anything whose name starts with "i". -
Someone has for Adobe , for some people the convenience might be worth the price (again, another topic....)
http://www.x264pro.com/
Since x264 will only create elementary video streams,
https://astrataro.wordpress.com/category/encode/x264/ -
I was blissfully unaware of this. Thanks poison for the heads up.
But that didn't turn out badly: I'm now well armed with debugmode, as well as binders for avisynth internal and external plug-ins, and x264 arguments.
Using debugmode means exporting directly, which never invokes AME, and therefore ties up Premiere during frameserving-encoding. This does negate the "go on and edit while encoding" feature of Premiere, which creates xml files for AME if export is queued. I wonder if x264pro restores this feature.For the nth time, with the possible exception of certain Intel processors, I don't have/ever owned anything whose name starts with "i". -
Yes that was indeed again a typo, sorry. Offcourse I meant the opposite. Lowering the CRF value even to 1 or 0 does not eliminate the banding.
As an acknowledgement to the posters after, I can't do anything but agree with you. X264 encoding should be native to Vegas. And my opinion is it should be cost free. -
It's the 8bit color depth of standard h.264 that causes or exacerbates the banding, though inefficient bitrate always worsens this.
If you truly want to avoid or remove banding, you would use a combination of higher color bitdepth and/or dithering (with possible blurring). This usually necessitates a higher bitrate to maintain the same overall quality.
Scott -
When you get confused, just remember, the human eyes see in RGB. That's why it's so popular.
-
Another alternative to consider is using an encoder that produces multiplexed output but which uses x264 for the video stream, such as ffmpeg. Because it also provides access to x264 presets command lines are wonderfully simple: http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide.
Cheers,
Francois -
So I've run into some problems again. I've gotten a hang of using MP4 Muxer in MeGUI. I now have a .264 video file and an .ac3 file which I need to mux together to an MP4 file. Thing is, when I do, this there is a slight audio offset. I'd need to offset/delay the audio with 100ms.
I've noticed there is a setting in MPC-HC to delay the audio by a custom amount of ms's but this is not a valid option imo.
I want to be able to give my friends a copy and they shouldnt have to rely on MediaPlayer know-how to have a great result.
There is an option in the MP4 Muxer to delay the audio, but as I understand it, it doesnt physically do anything except set a flag in the MP4 to delay the audio. Many players does not comply with this (I've tried with MPC-HC). How do I do to physically offset the audio by 100ms?
Is my only option to somehow convert the ac3 file to a WAV file (possible?) and add 100ms of nothing at the start of the track and then convert it back to .ac3 and then mux with mp4 muxer?
I'm a bit worried now since the screening of my film with my friends are tomorrow and reencoding takes about 8h... Please help!Last edited by chrisofsweden; 12th Apr 2013 at 05:25.
-
Yes, that's the sure-fire way. If you don't have a dedicated audio editor, even Windows Movie Maker (pre-Live) does the job for something like this. I've used it with .mp3 and .wma source; see if you can get away with loading .ac3 directly without needing to convert to PCM .wav first.
Edit: an alternative if you have control over the player used at the screening, is to see if you can pre-configure that to delay audio by the required 100ms.
Enjoy the screening.
Cheers,
Francois -
I thought the MP4 container lets you specify an audio or video delay. Mp4 Muxer doesn't seem to support the feature. YAMB lets you specify the delay but I don't think the program can handle AC3 audio. And when I tried it with AAC audio it didn't add a delay.
MP4Box (the command line program used by YAMB) appears to support the option. ffmpeg supports the option but it's another command line program:
https://forum.videohelp.com/threads/346293-Insert-Audio-Delay-With-ffmpeg?p=2163255&vie...=1#post2163255Last edited by jagabo; 12th Apr 2013 at 06:46.
-
Sure, worst case scenario I can just use the player controlled delay, but thats just a temporary solution for tomorrows screening. I want to be able to give my friends a solid copy that's 100%. But this issue have to be fixed before I can do that.
Furtermore, if I were to do it like suggested, to edit the audio and add a 100ms silence in the beginning, that would mean there is in fact going to create a 100ms empty "space" in the end of the video track. Is this doable? Will the MP4 not complain about the audio and video track not beeing the same duration? -
Many players does not comply with this (I've tried with MPC-HC)
Furtermore, if I were to do it like suggested, to edit the audio and add a 100ms silence in the beginning, that would mean there is in fact going to create a 100ms empty "space" in the end of the video track. Is this doable? Will the MP4 not complain about the audio and video track not beeing the same duration?
Muxers won't complain about different AV length (unless there is an enormous discrepancy) -
Yes I know there's an option for it and believe you me I was all "yay" but indeed it does not work. It adds a flag in the MP4 for players to read that the audio should be delayed by the amount specified. But once again, does not work.
Isn't it obvious? But yeah, didnt work. And I've googled it and got the general feeling that it's not generally supported by alot of players.
Ok great, thanks. Good to know!
Similar Threads
-
Newbie having trouble understanding how to create DVD that will play on TV
By Dorgunr in forum Newbie / General discussionsReplies: 1Last Post: 17th Nov 2012, 04:00 -
libx264 & ffmpeg (0.11.x) understanding quality options -q:v and -b:v
By feelart in forum Video ConversionReplies: 3Last Post: 19th Sep 2012, 09:39 -
ffmpeg : understanding mpeg4 encoding settings
By feelart in forum Video ConversionReplies: 0Last Post: 11th May 2012, 09:00 -
Need help with understanding video encoding.
By andilovellt in forum Newbie / General discussionsReplies: 15Last Post: 4th Jul 2011, 03:27 -
Batch encoding with a frame quality parameter instead of bitrate ?
By ronpub in forum Video ConversionReplies: 27Last Post: 21st Jul 2008, 18:42