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 > New and alternative video codecs

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd January 2019, 14:50   #121  |  Link
jonatans
Registered User
 
Join Date: Oct 2017
Posts: 56
Thanks kanaka for testing and reporting!

Please note that the quantization scale is different in AV1 and xvc, so a lower qp in xvc might still produce lower rate (and worse quality) than AV1.

Without a completed encoding and matching file sizes I'm afraid screenshot comparisons doesn't provide much information.

If you are interested in still image comparisons you could perhaps start with encoding a single frame and make sure the file sizes are roughly the same.

Indication of command line settings and encoding times is of course also helpful to better understand what is being compared.

Regarding support for repacking .xvc files to .mp4 and vice versa, we have not yet added support for this in our ffmpeg version but it is on our todo list.

I hope the xvc-in-mp4 support in ffplay is sufficient for the time being, as suggested by LigH.
__________________
Jonatan Samuelsson
Co-founder and CEO at Divideon

www.divideon.com | xvc.io
jonatans is offline   Reply With Quote
Old 23rd January 2019, 15:53   #122  |  Link
kanaka
Registered User
 
Join Date: Jan 2019
Posts: 13
Quote:
Originally Posted by jonatans View Post
Indication of command line settings and encoding times is of course also helpful to better understand what is being compared.
I uploaded movies to gdrive:
https://drive.google.com/drive/folde...vX42bYkM5cp855

Quote:
./xvcenc -input-file 0007QDNTE7P37UMM.y4m -output-file 0007QDNTE7P37UMM_q30.xvc -internal-bitdepth 8 -max-keypic-distance 120 -qp 30 -threads 8 -verbose 1

./aomenc --frame-parallel=0 --tile-columns=3 --auto-alt-ref=1 --cpu-used=4 --tune=psnr --passes=2 --threads=8 --end-usage=q --cq-level=36 --test-decode=fatal -o 0007QDNTE7P37UMM-av1opus.webm 0007QDNTE7P37UMM.y4m
I wanted to get medium quality movies so I started xvcenc with qp 32, next 31, and finally 30.
What qp should I set to get similar quality?
kanaka is offline   Reply With Quote
Old 23rd January 2019, 22:41   #123  |  Link
jonatans
Registered User
 
Join Date: Oct 2017
Posts: 56
Thanks for sharing the command lines.

A couple of recommendations:
- Do not use "-internal-bitdepth 8". It will make the quality worse for no real benefit.
- Make sure to use corresponding key-frame interval (I believe it would be "--kf-max-dist=120" in aomenc if you want to have at most 120 picture interval between access points).

Regarding what -qp to use to end up with similar quality, it is a bit difficult to guess since it can be quite sequence dependent. Is the sequence you are using available anywhere in uncompressed form? One approach is to start with a faster -speed-mode to get an indication of the bitrate a certain -qp value gives for a certain sequence, and then encode with a slower speed mode.

Perhaps around -qp 25 would be a good starting point for finding correspond quality and/or bitrate for this test case.
__________________
Jonatan Samuelsson
Co-founder and CEO at Divideon

www.divideon.com | xvc.io
jonatans is offline   Reply With Quote
Old 24th January 2019, 08:23   #124  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Code:
C:\>ffmpeg_xvc_enc.exe -i z:/x.mov -c:v libxvc -speed-mode 3 -qp 30 -threads 1 z:/x.mp4
ffmpeg version N-85113-g298f56e Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.3.1 (GCC) 20160211
  configuration: --enable-gpl --enable-nonfree --enable-ffplay --enable-libxvc --extra-ldexeflags=-static --pkg-config-flags=--static --arch=x86_64 --target-os=mingw32 --cross-prefix=x86_64-w64-mingw32-
  libavutil      55. 59.100 / 55. 59.100
  libavcodec     57. 90.100 / 57. 90.100
  libavformat    57. 72.100 / 57. 72.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 83.100 /  6. 83.100
  libswscale      4.  7.100 /  4.  7.100
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'z:/x.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2019-01-24T07:05:07.000000Z
    encoder         : FFmbc 0.7
  Duration: 00:00:04.71, start: 0.000000, bitrate: 144682 kb/s
    Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le(smpte170m/unknown/unknown, progressive), 1920x948, 144708 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 24k tbc (default)
    Metadata:
      creation_time   : 2019-01-24T07:05:07.000000Z
      handler_name    : DataHandler
Stream mapping:
  Stream #0:0 -> #0:0 (prores (native) -> xvc (libxvc))
Press [q] to stop, [?] for help
[libxvc @ 0000021db5dca360] Using 0 encoder threads
Output #0, mp4, to 'z:/x.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    encoder         : Lavf57.72.100
    Stream #0:0(eng): Video: xvc (libxvc) ([37][0][0][0] / 0x0025), yuv422p10le, 1920x948, q=2-31, 200 kb/s, 23.98 fps, 24k tbn, 23.98 tbc (default)
    Metadata:
      creation_time   : 2019-01-24T07:05:07.000000Z
      handler_name    : DataHandler
      encoder         : Lavc57.90.100 libxvc
Assertion failed!

Program: C:\ffmpeg_xvc_enc.exe
File: /home/jonatan/xvc/src/xvc_common_lib/resample.cc, Line 90

Expression: 0

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
He does not like the resolution of 1920x948.
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 24th January 2019, 11:08   #125  |  Link
kanaka
Registered User
 
Join Date: Jan 2019
Posts: 13
Quote:
Originally Posted by jonatans View Post
Perhaps around -qp 25 would be a good starting point for finding correspond quality and/or bitrate for this test case.
Thanks jonathans. It means that qp is variable and should be adapted for every movie? If yes, then this is big disadvantage. Business wants one settings for all movies, which give similar quality (like crf).

I've made test again. Different sample of this movie. (I know that this movie is not HQ, specially)

I've uploaded xvc, av1 and y4m to : https://drive.google.com/drive/folde...vX42bYkM5cp855

It seems that qp25 is ok
http://screenshotcomparison.com/comparison/128563

xvc encoded with params
Code:
./xvcenc -input-file 0007QDNTE7P37UMM-sample.y4m -output-file 0007QDNTE7P37UMM-sample_q25.xvc -max-keypic-distance 120 -qp 25 -threads 8 -verbose 1
av1:
Code:
aomenc.exe --frame-parallel=0 --tile-columns=3 --auto-alt-ref=1 --cpu-used=4 --tune=psnr --passes=2 --threads=4 --end-usage=q --cq-level=36 --kf-max-dist=120 --bias-pct=75 --test-decode=fatal -o 0007QXNOHNT8PWFC-sample_q36_c4_kf120.webm 0007QXNOHNT8PWFC-sample.y4m
And the result... xvc give better compression, but it is not so amazing.

0007QDNTE7P37UMM-sample_q25.xvc - 562.9 kB
0007QDNTE7P37UMM-sample_q36_c4_kf120.webm - 744,9 kB

Last edited by kanaka; 24th January 2019 at 12:58.
kanaka is offline   Reply With Quote
Old 24th January 2019, 16:13   #126  |  Link
jonatans
Registered User
 
Join Date: Oct 2017
Posts: 56
Quote:
Originally Posted by Gravitator View Post
He does not like the resolution of 1920x948.
Thanks Gravitator for pointing this out. The problem should be fixed in this version: https://drive.google.com/file/d/1uEy...ew?usp=sharing

/ Jonatan
__________________
Jonatan Samuelsson
Co-founder and CEO at Divideon

www.divideon.com | xvc.io
jonatans is offline   Reply With Quote
Old 24th January 2019, 17:45   #127  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Quote:
Originally Posted by kanaka View Post
And the result... xvc give better compression, but it is not so amazing.

0007QDNTE7P37UMM-sample_q25.xvc - 562.9 kB
0007QDNTE7P37UMM-sample_q36_c4_kf120.webm - 744,9 kB
Привет!
This lack of regulation of decimals...
Why not 2-pass for AOM?
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 24th January 2019, 18:32   #128  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by kanaka View Post
And the result... xvc give better compression, but it is not so amazing.

0007QDNTE7P37UMM-sample_q25.xvc - 562.9 kB
0007QDNTE7P37UMM-sample_q36_c4_kf120.webm - 744,9 kB
It is really hard to draw useful comparisons when both bitrate and subjective aspects are different between two encodes. In the absence of a highly accurate objective metric, double-blind subjective rating of different encodes that then get BD-rate calculated are the gold standard.

For someone doing private testing where that's not feasible, I recommend using 2-pass encoding and compare encodes at the same bitrate.

Also, remember we are comparing encoders, not the actual bitstream formats. The bitstream's capabilities provide an upper bound on what an encoder can do. But the psychovisual and rate control features of a given encoder can make a bigger difference than those between bitstreams. Hence x264 beating libaom in lots of real-world scenarios even though AV1 is inarguably the more capable bitstream. But x264 is just a much more mature and tuned encoder than libaom.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 24th January 2019, 20:17   #129  |  Link
kanaka
Registered User
 
Join Date: Jan 2019
Posts: 13
Quote:
Originally Posted by benwaggoner View Post
For someone doing private testing where that's not feasible, I recommend using 2-pass encoding and compare encodes at the same bitrate.
I test posibility to use new codecs in business.
First we encoded x264 with 2pass, but 2pass with the same bitrate is not good solution for encoding different movies. I have 2 movies: one is single continuos shot (interview) and the second is movie from car's camera.
Encoding with constant quality: first movie save 70% of size... and second is bigger (with crf) becouse movie is very dynamic.

Encoding with constant quality we save about 20% of network bandwith (becouse we have a lot of interviews) and give us sure of quality.

Quote:
Originally Posted by benwaggoner View Post
Also, remember we are comparing encoders, not the actual bitstream formats. The bitstream's capabilities provide an upper bound on what an encoder can do. But the psychovisual and rate control features of a given encoder can make a bigger difference than those between bitstreams. Hence x264 beating libaom in lots of real-world scenarios even though AV1 is inarguably the more capable bitstream. But x264 is just a much more mature and tuned encoder than libaom.
I understand that these codecs are in development ... so I made my own tests. Both codecs are great and will be better, but they are terribly slow. I do not know how to speed up these encoders. processor with AVX2?, faster clock? I tested scalability. The growing number of threads does not give noticeable acceleration
kanaka is offline   Reply With Quote
Old 25th January 2019, 10:14   #130  |  Link
jonatans
Registered User
 
Join Date: Oct 2017
Posts: 56
Quote:
Why not 2-pass for AOM?
I guess aomenc was used with 2-pass encoding for this test since "--passes=2" was set.

Quote:
..but they are terribly slow. I do not know how to speed up these encoders.
In xvcenc you can try -speed-mode 2 or even the experimental -speed-mode 3 to increase encoding speed, but it will also result in reduced compression performance. Increasing number of -threads should also speed up encoding, at least if you are encoding a "long enough" sequence.
__________________
Jonatan Samuelsson
Co-founder and CEO at Divideon

www.divideon.com | xvc.io
jonatans is offline   Reply With Quote
Old 25th January 2019, 14:30   #131  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Quote:
Originally Posted by jonatans View Post
I guess aomenc was used with 2-pass encoding for this test since "--passes=2" was set.
What does the union give? --passes=2 --cq-level=36
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 25th January 2019, 14:50   #132  |  Link
kanaka
Registered User
 
Join Date: Jan 2019
Posts: 13
Quote:
Originally Posted by jonatans View Post
In xvcenc you can try -speed-mode 2 or even the experimental -speed-mode 3 to increase encoding speed, but it will also result in reduced compression performance. Increasing number of -threads should also speed up encoding, at least if you are encoding a "long enough" sequence.
Thanks again.

I made another test - very dynamic movie.
https://drive.google.com/drive/folde...vX42bYkM5cp855

0007QXNOHNT8PWFC-sample_q36_c4_kf250.webm - 655.9 kB
0007QXNOHNT8PWFC-sample_q25_kf250.xvc - 824.5 kB
0007QXNOHNT8PWFC-sample_q30_kf250.xvc - 402.2 kB

q 30 is too bad, but q 25 is bigger than av1 qp 36. Strange
kanaka is offline   Reply With Quote
Old 25th January 2019, 14:55   #133  |  Link
kanaka
Registered User
 
Join Date: Jan 2019
Posts: 13
Quote:
Originally Posted by Gravitator View Post
What does the union give? --passes=2 --cq-level=36
It's from https://forum.doom9.org/showthread.p...75#post1860475

According hvmaf-720 (https://ibb.co/6ZQ6sTn)
av1 gp 36 shuld give similar quality to h264 crf 23.
kanaka is offline   Reply With Quote
Old 26th January 2019, 12:22   #134  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Shows different bitrates
Code:
ffmpeg_xvc_enc.exe -i z:/1.y4m -pix_fmt yuv422p -c:v libxvc -speed-mode 3 -qp 30 z:/test.mp4
ffmpeg version N-85113-g298f56e Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.3.1 (GCC) 20160211
  configuration: --enable-gpl --enable-nonfree --enable-ffplay --enable-libxvc --extra-ldexeflags=-static --pkg-config-flags=--static --arch=x86_64 --target-os=mingw32 --cross-prefix=x86_64-w64-mingw32-
  libavutil      55. 59.100 / 55. 59.100
  libavcodec     57. 90.100 / 57. 90.100
  libavformat    57. 72.100 / 57. 72.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 83.100 /  6. 83.100
  libswscale      4.  7.100 /  4.  7.100
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, yuv4mpegpipe, from 'z:/1.y4m':
  Duration: 00:00:05.20, start: 0.000000, bitrate: 276481 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(progressive), 1280x720, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> xvc (libxvc))
Press [q] to stop, [?] for help
[libxvc @ 00000138a6d74480] Using -1 encoder threads
Output #0, mp4, to 'z:/test.mp4':
  Metadata:
    encoder         : Lavf57.72.100
    Stream #0:0: Video: xvc (libxvc) ([37][0][0][0] / 0x0025), yuv422p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.90.100 libxvc
frame=  130 fps=1.0 q=-0.0 Lsize=     496kB time=00:00:04.52 bitrate= 898.2kbits/s speed=0.0349x
video:493kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.470185%

C:\>ffmpeg_xvc_enc.exe -i z:/test.mp4
ffmpeg version N-85113-g298f56e Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.3.1 (GCC) 20160211
  configuration: --enable-gpl --enable-nonfree --enable-ffplay --enable-libxvc --extra-ldexeflags=-static --pkg-config-flags=--static --arch=x86_64 --target-os=mingw32 --cross-prefix=x86_64-w64-mingw32-
  libavutil      55. 59.100 / 55. 59.100
  libavcodec     57. 90.100 / 57. 90.100
  libavformat    57. 72.100 / 57. 72.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 83.100 /  6. 83.100
  libswscale      4.  7.100 /  4.  7.100
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
[libxvc @ 000002412dad4280] Using 0 decoder threads
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'z:/test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf57.72.100
  Duration: 00:00:05.20, start: 0.000000,  bitrate: 780 kb/s
    Stream #0:0(und): Video: xvc (xvc1 / 0x31637678), yuv422p10le(progressive), 1280x720, 777 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
    Metadata:
      handler_name    : VideoHandler
At least one output file must be specified
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 8th February 2019, 17:22   #135  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
It is necessary to update the ffmpeg
Code:
C:\>ffmpeg_xvc_enc.exe -i z:\4K1.mkv -vf zscale=tin=smpte2084:min=bt2020nc:pin=bt2020:rin=tv:t=smpte2084:m=bt2020nc:p=bt2020:r=tv,zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0.000:peak=0.000,zscale=t=bt709:m=bt709:r=tv -pix_fmt yuv420p10le -strict -1 -c:v libxvc -speed-mode 3 -qp 30 -threads 1 z:\test.mp4
ffmpeg version N-85113-g298f56e Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.3.1 (GCC) 20160211
  configuration: --enable-gpl --enable-nonfree --enable-ffplay --enable-libxvc --extra-ldexeflags=-static --pkg-config-flags=--static --arch=x86_64 --target-os=mingw32 --cross-prefix=x86_64-w64-mingw32-
  libavutil      55. 59.100 / 55. 59.100
  libavcodec     57. 90.100 / 57. 90.100
  libavformat    57. 72.100 / 57. 72.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 83.100 /  6. 83.100
  libswscale      4.  7.100 /  4.  7.100
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, matroska,webm, from 'z:\4K1.mkv':
  Metadata:
    creation_time   : 2018-07-22T13:06:52.000000Z
    ENCODER         : Lavf58.2.103
  Duration: 00:00:02.31, start: 0.000000, bitrate: 21316 kb/s
    Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x1600 [SAR 1:1 DAR 12:5], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Metadata:
      DURATION        : 00:00:02.293000000
    Stream #0:1(rus): Audio: aac, 48000 Hz, stereo, fltp (default)
    Metadata:
      title           : ╨Ф╤Г╨▒╨╗╨╕╤А╨╛╨▓╨░╨╜╨╜╤Л╨╣
      ENCODER         : Lavc58.9.100 libfdk_aac
      DURATION        : 00:00:02.307000000
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> xvc (libxvc))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[AVFilterGraph @ 000002064b194140] No such filter: 'zscale'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 8th February 2019, 21:36   #136  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by kanaka View Post
It's from https://forum.doom9.org/showthread.p...75#post1860475

According hvmaf-720 (https://ibb.co/6ZQ6sTn)
av1 gp 36 shuld give similar quality to h264 crf 23.
Is that for just this clip, or a more general prediction? QP has some correlation with CRF, but CRF works as a psychovisually tuned offset to QP.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 15th February 2019, 09:56   #137  |  Link
kanaka
Registered User
 
Join Date: Jan 2019
Posts: 13
Quote:
Originally Posted by benwaggoner View Post
Is that for just this clip, or a more general prediction? QP has some correlation with CRF, but CRF works as a psychovisually tuned offset to QP.
It's only general prediction. I started encoding with qp 36 but now I encode with qp 32 because 36 is not enough for some movies.

Encoding Xvc or av1 takes too much time so i have i shot to quess what qp should I use.
kanaka is offline   Reply With Quote
Old 4th March 2019, 10:03   #138  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
The quality is amazing! Even in -speed-mode 3 mode! Are you planning to release a decoder to the masses?
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 5th March 2019, 08:52   #139  |  Link
jonatans
Registered User
 
Join Date: Oct 2017
Posts: 56
Quote:
Originally Posted by Gravitator View Post
The quality is amazing! Even in -speed-mode 3 mode! Are you planning to release a decoder to the masses?
Thanks Gravitator for testing and reporting about the amazing quality!

The source code for the xvc decoder is available as open source under LGPL license: https://github.com/divideon/xvc

We have also developed integrations with different frameworks and players such as FFmpeg and ExoPlayer, available on request.
__________________
Jonatan Samuelsson
Co-founder and CEO at Divideon

www.divideon.com | xvc.io
jonatans is offline   Reply With Quote
Old 7th March 2019, 14:21   #140  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Give the opportunity to regulate the quantfactor I>P/P>B ?
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Reply

Tags
codec, compression, video codec, video encoding, xvc

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 21:41.


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