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 26th December 2008, 17:35   #1  |  Link
stpdrgstr
Registered User
 
Join Date: Oct 2008
Posts: 37
x264 Lossless question

Hi, good day.

I was wondering if is safe to use x264 lossless, and is comparable to Lagarith.

I mean, if I reencode this x264 lossless to x264 lossy, it's the same as to reencode a Lagarith to a x264 lossy?

And, should I be using CoreAVC or libavcodec to decode this lossless through DSS2()?

These question had been retaining my sleep these days, so I would be very gratefull if they could be answered

Thanks.
stpdrgstr is offline   Reply With Quote
Old 26th December 2008, 17:49   #2  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
x264 lossless has pretty much strictly superior compression to Lagarith, even in intra-only mode IIRC.

Unlike Lagarith, it only supports the YV12 colorspace.

To decode it correctly, you need a libavcodec from within the past ~2-3 weeks (as that's when support was added) or CoreAVC 1.8.5.
Dark Shikari is offline   Reply With Quote
Old 26th December 2008, 18:19   #3  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,870
How to encode to lossless?
Atak_Snajpera is offline   Reply With Quote
Old 26th December 2008, 18:33   #4  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 957
Atak_Snajpera, huh? --qp 0 is that what you mean?

stpdrgstr, lossless is lossless, the input to "x264 lossy" in both cases should be the same.
__________________
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.

Last edited by J_Darnley; 26th December 2008 at 18:36.
J_Darnley is offline   Reply With Quote
Old 26th December 2008, 18:34   #5  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,870
Quote:
Huh? --qp 0 is that what you mean?
yep! I meant switch. Thanks
Atak_Snajpera is offline   Reply With Quote
Old 26th December 2008, 19:53   #6  |  Link
stpdrgstr
Registered User
 
Join Date: Oct 2008
Posts: 37
Thank you very much. Now I can keep encoding at ease
stpdrgstr is offline   Reply With Quote
Old 27th December 2008, 17:23   #7  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,250
Note that for frame-accurate access to H.264 streams (lossless or not) you should use DGAVCIndex/AVCSource() instead of DirectShow.

I'm not sure whether AVCSource() already has an updated libavcodec with support for x264 lossless mode though...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th December 2008, 17:37   #8  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by LoRd_MuldeR View Post
Note that for frame-accurate access to H.264 streams (lossless or not) you should use DGAVCIndex/AVCSource() instead of DirectShow.
Frame-accurate access should never be an issue with lossless regardless of the decoder being used... since you shouldn't be using B-frames with lossless, so there is no frame delay.
Dark Shikari is offline   Reply With Quote
Old 27th December 2008, 17:45   #9  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,250
Quote:
Originally Posted by Dark Shikari View Post
you shouldn't be using B-frames with lossless
Didn't know that. Why is it like that? And does x264 automatically set "--bframe 0" when "--qp 0" is used?

(Could check the sources, but I'm too lazy right now ^^)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th December 2008, 17:47   #10  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by LoRd_MuldeR View Post
Didn't know that. Why is it like that?
It always reduces compression.
Quote:
Originally Posted by LoRd_MuldeR View Post
And does x264 automatically set "--bframe 0" when "--qp 0" is used?
No, because x264 isn't designed to protect you from your own stupidity.

A warning might be useful though.
Dark Shikari is offline   Reply With Quote
Old 27th December 2008, 17:48   #11  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,250
Quote:
Originally Posted by Dark Shikari View Post
It always reduces compression.
With "always" you mean "B-Frames always reduce compression in lossless mode". Not in general. Right?

Quote:
Originally Posted by Dark Shikari View Post
No, because x264 isn't designed to protect you from your own stupidity.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th December 2008, 17:50   #12  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by LoRd_MuldeR View Post
With "always" you mean "B-Frames always reduce compression in lossless mode". Not in general. Right?
Yes, hence the "lossless" in the thread title.
Dark Shikari is offline   Reply With Quote
Old 27th December 2008, 17:52   #13  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
Join Date: Jan 2007
Posts: 1,348
i thought the h.264 spec declared that predictive lossless profile was to only consist of IDR frames?

Edit:
nope, confirmed against the spec... it does allow I,P,B.

what's the point of allowing B frames in the first place if it reduces the compression?
__________________
custom x264 builds & patches | F@H | My Specs

Last edited by kemuri-_9; 27th December 2008 at 17:56.
kemuri-_9 is offline   Reply With Quote
Old 27th December 2008, 17:56   #14  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,250
I created streams with x264's mode "predictive lossless" mode using P-Frames and even B-Frames (didn't know b-frames are bad for lossless) and CoreAVC as well as recent ffdshow do handle it properly.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th December 2008, 17:57   #15  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by kemuri-_9 View Post
what's the point of allowing B frames in the first place if it reduces the compression?
What is the point of prohibiting them if it requires an extra line of text in the spec?

(Furthermore, one theoretically could improve lossless compression by doing the "every frame is a B-frame" trick and then the "duplicate frames in both reference lists", because that would allow for 8thpel MC, which would help lossless.)
Dark Shikari is offline   Reply With Quote
Old 27th December 2008, 18:01   #16  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,250
Quote:
Originally Posted by Dark Shikari View Post
What is the point of prohibiting them if it requires an extra line of text in the spec?
Reduce the number of cases a decoder needs to be prepared for ...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th December 2008, 18:06   #17  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by LoRd_MuldeR View Post
Reduce the number of cases a decoder needs to be prepared for ...
What, by making things even more complicated by not making High 4:4:4 Predictive profile a strict superset of High Profile?
Dark Shikari is offline   Reply With Quote
Old 28th December 2008, 14:49   #18  |  Link
vmrsss
Registered User
 
Join Date: Mar 2008
Posts: 144
so what's a sensible command line for lossless?
vmrsss is offline   Reply With Quote
Old 28th December 2008, 14:55   #19  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by vmrsss View Post
so what's a sensible command line for lossless?
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.
Dark Shikari is offline   Reply With Quote
Old 28th December 2008, 16:20   #20  |  Link
vucloutr
Registered User
 
vucloutr's Avatar
 
Join Date: Nov 2008
Posts: 64
no --subme 9 for Slowest ?
typo or is there actually something to it ?
vucloutr 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 22:59.


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