Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th November 2018, 13:46   #1  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Encode hazy/foggy/dark comes out pixelated/appears to "jump" to keyframes

Source video is MOV/quicktime from digital camera, mostly of "foggy" hazy/clouds and mostly dark, which is fine..

however, when trying to encode using X264, it becomes heavily pixelated, and every second or two scene appears to JUMP as if there is a "keyframe" or something..

Tried multi-pass using Virtualdub2/latest, but that still has this jumping/pixelation.. raised target bitrate to 10000, with not much of a difference.

noticed keyframes by default come every 15 frames, so ran 2-pass with "force keyframes every" 5, and every 2, and even every "1"!!

and I can't really tell the difference, other than filesizes do change , so it does do something different

ironically, the force-keyframe every "1" produced a SMALLER file-size than the every 2 or 5....

Are there any "presets" for such dark/foggy/cloudy scenes? or maybe a different codec? the original video is very smooth, size wise it is about ~2GB, and the compressed goes down to roughly 200MB.

Thanks.
S
stormy1777 is offline   Reply With Quote
Old 11th November 2018, 15:13   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,196
First of all, be sure you are using the latest version of x264, which is r2935 by now.

Also, I'd recommend to use CRF mode and set the CRF value to the highest value that still produces "good enough" quality; if quality is unsatisfactory, lower CRF value some more.

Set preset to the slowest one that you are willing to accept. And set the tune to "film" for real world footage; maybe give tune option "grain" a try.

Furthermore, x264 places key-frames (IDR frames) dynamically, which means at "scene changes". The default --keyint value is 250, and the default --min-keyint is equal to the frame-rate.

Keep in mind that those options just specify the minimum and maximum key-frame distance, not a fixed key-frame distance!

Last but not least, AQ mode “3” (aka "Auto-variance AQ with bias to dark scenes") may be worth a try, if you are seeing block artifacts specifically in "dark" areas/scenes.

(As a rule of thumb, I would recommend to not touch any options, unless you know exactly what you are doing and why it is needed; instead just rely on the preset and tune system)
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 11th November 2018 at 16:36.
LoRd_MuldeR is offline   Reply With Quote
Old 12th November 2018, 15:45   #3  |  Link
SaurusX
Registered User
 
Join Date: Feb 2017
Posts: 89
AQ-strength plays a large part in detail retention in flat areas with subtle color changes, like fog or clouds. Make sure that value is at least 1 and then edge it higher (1.05, 1.1, etc) to your liking. It should go without saying, but the higher it goes the larger the resulting file.
SaurusX is offline   Reply With Quote
Old 12th November 2018, 20:55   #4  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,634
Good advice above. Adding on, using --open-gop can also reduce keyframe strobing. Lowering ipratio can also help. Having a keyframe ever 15 frames is really short. 2 seconds is about the minimum that gets used for IP delivery. 1 sec gets used for Blu-Ray at high bitrates. For making a standalone file, something between 4-10 seconds is good; higher values make for more efficiency but slower random access.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 13th November 2018, 20:54   #5  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
very interesting suggestions.. Still on the FIRST one though

Tried to find the right "x264" encoder:

1) Attempted to d/l from sourceforge: https://sourceforge.net/projects/x264vfw/files/
but latest there is from 2017....
https://sourceforge.net/projects/x26..._2851bm_44825/

it is ~2MB and installed OK, so now I'm on r2851

2) Later found: http://download.videolan.org/x264/bi...35-545de2f.exe

linked from here: https://www.videohelp.com/software/x...coder#download

This is a ~20MB file...

Running it is just a CLI (black window starts and disappear how does one hook this into VD2?

3) Went to sourceforge again for "latest":

https://sourceforge.net/projects/x26...atest/download

again that takes build 2851, not the newer one.... this appears to be the GUI installer...

same with other websites, they have the 20mb download: https://www.majorgeeks.com/files/det...deo_codec.html

any chance someone can post a link to the latest x264 bits that can hook up to VD2?

Will re-test once the newer build is found
Thanks much!!
stormy1777 is offline   Reply With Quote
Old 13th November 2018, 21:09   #6  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,196
Just do yourself a favor and don't use x264 VfW encoder, which has been dropped by "official" x264 developers ages ago.

Simply download the latest x264 CLI encoder, e.g. from here:
https://www.mediafire.com/?bxvu1vvld31k1

If you don't like encoding from the command-line, then there is like a zillion of GUI front-ends available that you can choose from:
https://forum.doom9.org/forumdisplay.php?f=78

Even VirtualDub can use the x264 CLI encoder, as an "external encoder", if you really need to stick with VirtualDub:
* https://forum.videohelp.com/attachme...%20Encoder.gif
* https://forum.videohelp.com/threads/...ncoder-feature


Quote:
Originally Posted by stormy1777 View Post
Running it is just a CLI (black window starts and disappear
If you want to manually invoke the CLI encoder, you have to start it from a terminal. With a command-line like this:

x264.exe --crf 20 --preset slower --tune film --output "c:\some\path\your_output.mkv" "c:\some\path\your_input.{avs,mp4,mov}"


Quote:
Originally Posted by stormy1777 View Post
how does one hook this into VD2?
If you really want to go that route, as an "external encoder" (see above).
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 13th November 2018 at 21:48.
LoRd_MuldeR is offline   Reply With Quote
Old 14th November 2018, 13:33   #7  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
LoRd_MuldeR -

Thanks SO much for your time!!!


Not fixated on VirtualDub, been using it for years, but certainly open to new tools.

Since this video stuff is not my full-time, just a hobby, need basic (single tool) built-in editing abilities - just load video, clip front/end, and add audio (music/voice) and sync length of these two, more or less.

The link you sent seems mostly "encoders" (MeGUI, Handbrake, etc.) with a GUI front-end, so they help construct the CLI for user.

these tools don't really "handle" the video file in the sense that they allow basic trim/preview.

But that got me to re-visit and evaluate other options, while at it.

Tried: Blender.. boy.. that is an *overkill* for my needs, it seems like a huge learning curve, just the editor... need to learn keyboard shortcuts, etc. Maybe one day when i can block a week or two to really learn it.

Next tried: KDEnLIVE, not deterred by the known issues on Windows

https://userbase.kde.org/Kdenlive/Manual/Windows_Issues

SIDENOTE:
Quote:
added a single MOV and MP3 into project, pulled both down so they are on timeline, took a while to get it to play (due to known issues), but the AUDIO started playing *after* all the video finished even though *visually* they are aligned..

Decided to render, got a 6 min video, first 3 min are the video, with no audio, and last 3 min are the audio with black screen

also, it was not clear how to 'decouple' audio/video compression, i.e. 'copy audio' as-is (with no compression).

Tried another rendering, changed Quality to 20, and audio to 160, got an identically long "video", all 6 minutes are BLACK, and last 3 minutes have the audio track

This is all using latest 18.08.2 on Windows 7....
Just funny.. decided to give a second try, deleted all tracks, added MOV and MP3 again, this time it went OK.. although Codec code came as AVC1 not sure if this is as 'compatible' as 'x264' (with virtualdub).

I may revisit this KDEnLive b/c it might work, although it does have way too many features for my needs


For old-time sake, tried: Avidemux, wow, that GUI is pretty dated and very hard to move around, so abandoned it pretty quickly.

LiVES is a Linux only.....


Decided that VD2 is not that bad after all few MB binary, lightweight, no learning curve


IMPORTED the VD external profiles, from here:

https://forum.videohelp.com/threads/...e3#post2390309

They appear OK, however could not figure how to actually USE them.. ctrl-P (Compression) opens the built-in (plugins) encoders.. It's funny, anyways, after about an hour of battling with the virtualdub forums and the GUI, finally found the option to:

EXPORT -> USING EXTERNAL ENCODERS

Then chose the "ACV [Film] (10bit)", it ran for about 30 seconds, with projected filesize as 16GB (source file is roughly 1GB , then crashed with:

Code:
---------------------------
VirtualDub Error
---------------------------
Write error occurred on file "<anonymous pipe>": Insufficient system resources exist to complete the requested service.
---------------------------
OK   
---------------------------
Figure the 'projected size' is not known to VD so large value is normal, since it puts out the raw video for the external encoder to handle.. but not sure what "system resource" is missing Maybe more memory, not sure..

Decided to try the "ACV [Film] (8bit)" instead, and wow, it went through all the way, but, at the very end, probably when it "mixes" audio/video or something it crashed with this:


---------------------------
VirtualDub Error
---------------------------
CLI: The multiplexing process failed with error code 1 (00000001). Check the log for possible error messages.
---------------------------
OK
---------------------------


Found this post: https://forum.videohelp.com/threads/...s-at-multiplex

Tried without the .mp4 at the end, and still same failure...

I suspect that this is b/c the encoders in that "pack" are very old, also noticed the "bin/x265" has "x265-8bit" whereas the "bin/x264" has the "x264-10bit", shouldn't it be other way around?

anyways, need to find the right/recent/current External encoders then maybe that will be it, until then, using the plugins in VD2, they are at r2851 from OCT2017, so not that bad.

Sorry for the long post, I don't expect an "answer", let me do some homework and followup in the respective place

Stormy.
stormy1777 is offline   Reply With Quote
Old 17th November 2018, 01:28   #8  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,474
Quote:
Originally Posted by stormy1777 View Post
The link you sent seems mostly "encoders" (MeGUI, Handbrake, etc.) with a GUI front-end, so they help construct the CLI for user.

these tools don't really "handle" the video file in the sense that they allow basic trim/preview.
MeGUI has an AVS Cutter under the Tools menu. After creating a script, you can open it with the AVS Cutter and select which sections of the video you wish to encode on a frame accurate basis. It can apply fades and dissolves. It has a preview and is much like cutting/editing with VirtualDub.
The AVS Cutter can save a "cuts file" for loading into the audio section so it's re-encoded to match the video, or the Audio Cutter under the Tools menu can load the cuts file to cut the audio losslessly.

hello_hello is offline   Reply With Quote
Old 15th November 2018, 10:03   #9  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
btw, got the VD2 working with the external encoder, it simply boils down to matching the actual called/underlying binaries, ffmpeg, etc. with the right command line flags.. tricky part is there are many "flavors" of these tools, with various "options" built into them.

Pressing F8 shows the Vdub LOG, then one can extract the cmd lines from there, running them separately produces the actual error, for example:

Code:
x264 [error]: not compiled with MP4 output support
VD2 does not capture this output, it just gets to show as a 'broken pipe' or some generic/random failures as posted earlier.

Once u got the right bits, with right flags, and sequence of tools, it works.. not trivial though

For the above 'not compiled with mp4' ended up switching to Multiplexing with MP4Box using such flags:

Code:
-add "%(tempvideofile)" -add "%(tempaudiofile)" -fps %(fps) "%(outputname)"
then can use the "official" x264 from:

http://download.videolan.org/pub/vid...x264/binaries/

moving on to implement the suggestions of the original post made following changes:
- film in 60fps on source material
- latest X264, with preset Slower, Tuning Film, and CRF 15, and going down further..

so far looks better... I'm sure it'll improve with time,

thanks for the support/suggestions.
Stormy.
stormy1777 is offline   Reply With Quote
Old 16th November 2018, 19:59   #10  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,634
I find MeGUI a great tool for using the open-source tools for both preprocessing and encoding with x264. It feels like an app while using it. The part that is easily missed is going to Tools > AVS Script creator, or control-R. That'll make the avs file to use as input for the encoder session. That should be a big button in the main UI!

If you use MeGUI from the Development server (Settings > Extra Configuration > Auto Update) you'll get the latest and greatest versions of the components pretty regularly.

Alas, the x265 GUI is still mostly theoretical.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 18th November 2018, 18:46   #11  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Thanks... I did try MeGUI, but I'm not that keen on writing scripts to open/edit/process video files - unless in very special cases where there is no choice In VD, just drag-drop, cut, add audio, and save, that is quick and easy.. btw, MeGUI also did not open the MOV/Quicktime, and so i guess it too needs some plugins, but I just don't see myself writing scripts for each video file, so for now will stick with VD2
stormy1777 is offline   Reply With Quote
Old 19th November 2018, 02:16   #12  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,474
If you're happy with VD2 that's fine, but MeGUI should have no problem opening MOV files (I'm fairly sure, I never work with them). You don't need to write scripts. MeGUI will do it for you.

Use the File/Open menu to open a file. MeGUI might ask how it should open it. If it does, choose the File-Indexer. Add the indexing job to the queue and run it. When it's done, the Script Creator should open with a preview. You can use the Script Creator to apply the usual stuff like cropping or resizing etc, but if you don't want to do that, just click the Save button, then you can open the script MeGUI created with the AVS Cutter.

Just thought I'd let you know, maybe for future reference.
hello_hello is offline   Reply With Quote
Old 19th November 2018, 09:08   #13  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Hello Hello, thanks...

Ineeded with this sequence of "open" it does open, but takes 20 sec to SEVERAL minutes (opening bunch of windows, for updates, jobs, etc.)!!! for 5-8min clips.. Also, opened several AVI, on the preview window the PLAY button only advanced ONE frame each time

anyways, good to know of other options.. time to leave this thread until/when i got more data on the actual encoding/fuzzy/clouds stuff which was the original post

Thanks!

Stormy.
stormy1777 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:49.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.