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 6th January 2009, 21:43   #41  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
After turning off some options, I found that just turning off B-Frame mode (--direct none) has fixed the problem.

I'm not sure how to use --dump-yuv as the x264.exe doesn't even list it as an option. Can you give an example Dark?

I have not tried decoding with CoreAVC yet.

I will try with no --direct parameter (Spatial) and --direct temporal.
Aktan is offline   Reply With Quote
Old 6th January 2009, 21:54   #42  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 957
Sure it does: --dump-yuv <string> Save reconstructed frames
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Old 6th January 2009, 21:59   #43  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
oops, it was in longhelp.. I am still unsure how to use it, I tried something like this and got an error:

x264.exe --dump-yuv "C:\Temp DVD\Test.264" "C:\Temp DVD\VTS_01.avs"
x264 [error]: No output file. Run x264 --help for a list of options.

Edit:

Nevermind I think I know what I did wrong... which makes sense now

Last edited by Aktan; 6th January 2009 at 22:03.
Aktan is offline   Reply With Quote
Old 6th January 2009, 22:03   #44  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 957
It is no subsitute for normal output. Use x264 as normal and add the dump-yuv option. Use NUL for the output file if you don't want one.
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Old 6th January 2009, 22:04   #45  |  Link
Sagekilla
x264aholic
 
Join Date: Jul 2007
Location: New York
Posts: 1,752
x264.exe "C:\Temp DVD\VTS_01.avs" --output "NUL" --dump-yuv "C:\Temp DVD\yuv_dump.yuv"

I'm not sure what extension is the proper one to use for a raw yv12 file but that's trivial.
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame.
Sagekilla is offline   Reply With Quote
Old 6th January 2009, 22:15   #46  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
If direct none fixes it, then that means direct is broken (either encoder or decoder side).

Try setting to "spatial" just to make sure it isn't temporal that's broken.

Last edited by Dark Shikari; 6th January 2009 at 22:17.
Dark Shikari is offline   Reply With Quote
Old 6th January 2009, 22:45   #47  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
Okay, a few more tests:

direct = 1 (Spatial) (aka no --direct parameter specified at all) has no problems

direct = 2 (Temporal) (aka --direct temporal) has no problems

Old results:

direct = 0 (None) (aka --direct none) has no problems

direct = 3 (Auto) (aka --direct auto) has problems

I tried using CoreAVC decoder but it is worse off. My clip that was not encoded with B-Frames outputted with CoreAVC is not lossless in certain areas while outputting with FFDShow was. I'm not sure if it is due to a setting in CoreAVC, but I didn't think so since parts of the clip was outputted the same as the source.

The version of CoreAVC is 1.8.5 (Trial Edition)
Aktan is offline   Reply With Quote
Old 6th January 2009, 22:48   #48  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
In the case where it "has problems", does --dump-yuv's stream have problems, or is it exactly correct?
Dark Shikari is offline   Reply With Quote
Old 6th January 2009, 22:54   #49  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
You're right, direct auto is bugged, the code as written assumes non-lossless.

Solution coming soon.

Edit: solution applied.

Last edited by Dark Shikari; 6th January 2009 at 23:04.
Dark Shikari is offline   Reply With Quote
Old 6th January 2009, 23:21   #50  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
Cool thanks Dark!

Well I did the YUV Dump anyway and got a big file (which is obvious) but I have no idea how to load it into AviSynth, sorry for the OT, but any ideas?
Aktan is offline   Reply With Quote
Old 6th January 2009, 23:22   #51  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Aktan View Post
Cool thanks Dark!

Well I did the YUV Dump anyway and got a big file (which is obvious) but I have no idea how to load it into AviSynth, sorry for the OT, but any ideas?
No need, as the problem has already been pinpointed and resolved. It was an x264 bug.

(You'd use RawSource if you wanted to load it into AviSynth).
Dark Shikari is offline   Reply With Quote
Old 6th January 2009, 23:32   #52  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
Yep I already knew you've already pinpointed and resolved the issue, I was just curious as to how to load it, which you've told me how. Thanks!
Aktan is offline   Reply With Quote
Old 10th April 2024, 14:21   #53  |  Link
damian101
Registered User
 
damian101's Avatar
 
Join Date: Feb 2021
Location: Germany
Posts: 21
Quote:
Originally Posted by Dark Shikari View Post
Ultra-fast: --subme 1 --no-cabac --partitions none --me dia

Normal: --subme 5 --partitions all

Slow: --subme 6 --8x8dct --partitions all --ref 2

Slower: --subme 8 --8x8dct --partitions all --ref 4 --me umh --mixed-refs

Slowest: --subme 8 --8x8dct --partitions all --ref 16 --me esa --mixed-refs

Note that no-cabac loses about 10-15% compression but massively speeds up playback. Other things that hurt compression the most are subme=0 (vs other values) and partitions=none.
Code:
--partitions all
is usually harmful on noisy camera content, especially with subme < 6

Also,
Code:
--8x8dct
should be default anyway with all presets except ultrafast.
damian101 is offline   Reply With Quote
Old 11th April 2024, 00:33   #54  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,819
In her defense, Dark Shikari's answer was from over fifteen years ago.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 15th April 2024, 09:08   #55  |  Link
Tlen
Registered User
 
Join Date: Apr 2020
Posts: 23
Just for the records,
because i had to make a lossless compression of a 4 hours film
I always used Lagarith as default,
so i tried x264 lossless to see what happens.

4 Hour, 1920 * 1080 YV12

x264 (qp 0 very slow)
210 GB @ 13.4 fps
Decoding speed ok (no frame lost) on a Low TDP CPU (i5) but CPU stuck at 100%

Lagarith
264 GB @ 120 fps
Decoding speed ok (no frame lost) on a Low TDP CPU (i5) - CPU 88%

Ssso I think that the only pro of x264 would be a compatibility side
(you can use Lag only on PC while you could teorically be able to run x264 on a NAS too)
and a little better compression but that costs an incredibly huge amount of time.

So all in all Lags remains the choice (generally).
Tlen is offline   Reply With Quote
Old 15th April 2024, 12:34   #56  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,957
Lagarith is ok but it's getting older and it doesn't support high bit depth which you don't need in this case as you're working in yv12 but if you'll ever need it then you're gonna be out of luck.
x264 is of course much slower in encoding time, but it does compress better and it also supports 10bit, while x265 supports up to 12bit and it's gonna be much slower again.
As to x264 vs x265, going back to summer 2013, the x265 lossless mode wasn't very optimized and it sometimes produced larger files compared to x264.
A lot of time has passed since then (11 years) so it probably improved but I haven't done a significant benchmark for a long time (although I feel like I should).
Another one that supports up to 10bit is UTVideo which has been a good alternative for a while.
If you need something that supports high bit depth up to and including 16bit planar, you can use HuffYUV which is my de facto choice for lossless encoding nowadays.
HuffYUV is still maintained and it's ridiculously fast on modern CPUs to both encode and decode.
If you want something that has the same bit depth support as HuffYUV (i.e up to 16bit) but has a better compression efficiency there's always FFV1 which is very very good and has CRC checks per slice.
I'll probably make a new comparison if I have time.
FranceBB is offline   Reply With Quote
Old 15th April 2024, 15:58   #57  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,330
HuffYUV is still maintained...? I'll search... I thought it stopped a looong time ago at version 2.1.1
There is also MagicYUV.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 15th April 2024, 16:05   #58  |  Link
Tlen
Registered User
 
Join Date: Apr 2020
Posts: 23
I remember that huffyuv was way beyond compression ratio than lagarith although very much faster,
but for archival needs, compression ratio has more weight in the equation.

I remember testing FFV1 long time ago and not remembering why i discarded ahaha
Same as MagicYUV which i tested but didn't choose.

Next time pheraps I'll re-evaluate MagicYUV which I vaguely remember had good ratio and high speed.

Concerning high bit depth, yes atm I don't deal with that so it's out of the requirements.

Last edited by Tlen; 15th April 2024 at 16:09.
Tlen is offline   Reply With Quote
Old 15th April 2024, 21:05   #59  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,819
Quote:
Originally Posted by Tlen View Post
I remember that huffyuv was way beyond compression ratio than lagarith although very much faster,
but for archival needs, compression ratio has more weight in the equation.

I remember testing FFV1 long time ago and not remembering why i discarded ahaha
Same as MagicYUV which i tested but didn't choose.

Next time pheraps I'll re-evaluate MagicYUV which I vaguely remember had good ratio and high speed.

Concerning high bit depth, yes atm I don't deal with that so it's out of the requirements.

IDR-only HEVC lossless is more efficient than anything you’ve listed, and has HW decode support.


Sent from my iPhone using Tapatalk
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 15th April 2024, 22:38   #60  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,957
Quote:
Originally Posted by jpsdr View Post
HuffYUV is still maintained...? I'll search... I thought it stopped a looong time ago at version 2.1.1
yeah, the original version did stop at 2.1.1 and it's 8bit only, but it got forked several years ago and led to the creation of ffvhuff which supports 8bit, 10bit, 12bit, 14bit and 16bit planar and it's still maintained to this very day.
FranceBB 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 07:34.


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