[FFmpeg-devel] [PATCH] swscale: add unscaled copy from yuv420p10 to p010

Oliver Collyer ovcollyer at mac.com
Fri Sep 2 15:40:54 EEST 2016


> Just one note; encoding from YUV420P to P010LE is still slow. It will be
> nice a similar patch is done for YUV420P 8bits to P010LE 10 bits
> convertion. (For reason:
> http://x264.nl/x264/10bit_02-ateme-why_does_10bit_save_bandwidth.pdf)
> 

Ali

I’m curious as whether you have managed to save bandwidth this way?

In my test, my sample file went from 80mb encoded down to 69mb with the same global quality setting. (using -constq -global_quality 21)

I assume that when set to CBR mode instead that you would get a slightly higher quality for the same bitrate.

Regards

Oliver

> ffmpeg version N-81508-g99882d0 Copyright (c) 2000-2016 the FFmpeg
> developers
> built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
> configuration: --prefix=/opt/ffmpeg --enable-shared --enable-static
> --enable-nonfree --enable-gpl --extra-cflags='-I/opt/ffmpeg/include
> -I/usr/local/include' --extra-ldflags=-L/opt/ffmpeg/lib
> --bindir=/opt/ffmpeg/bin --extra-libs=-ldl --enable-libx264
> --enable-libx265 --enable-nonfree --enable-gpl --enable-nvenc
> --enable-vdpau --enable-libzvbi --enable-libfdk-aac --enable-libzimg
> --enable-avresample --enable-libnpp --enable-cuda
> libavutil      55. 29.100 / 55. 29.100
> libavcodec     57. 54.101 / 57. 54.101
> libavformat    57. 48.101 / 57. 48.101
> libavdevice    57.  0.102 / 57.  0.102
> libavfilter     6. 58.100 /  6. 58.100
> libavresample   3.  0.  0 /  3.  0.  0
> libswscale      4.  1.100 /  4.  1.100
> libswresample   2.  1.100 /  2.  1.100
> libpostproc    54.  0.100 / 54.  0.100
> Routing option err_detect to both codec and muxer layer
> Input #0, matroska,webm, from
> '/media/usb0/4K_TS/SES.Astra.UHD.Test.1.2160p.UHDTV.AAC.HEVC.x265-LiebeIst.mkv':
> Metadata:
>  encoder         : libebml v1.3.1 + libmatroska v1.4.2
>  creation_time   : 2015-10-03T13:49:42.000000Z
> Duration: 00:01:49.29, start: 0.816000, bitrate: 18484 kb/s
>  Stream #0:0: Video: hevc (Main 10), 1 reference frame, yuv420p10le(tv),
> 3840x2160 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 1k tbn, 60 tbc (default)
>  Metadata:
>    BPS             : 18497251
>    BPS-eng         : 18497251
>    DURATION        : 00:01:48.450000000
>    DURATION-eng    : 00:01:48.450000000
>    NUMBER_OF_FRAMES: 6507
>    NUMBER_OF_FRAMES-eng: 6507
>    NUMBER_OF_BYTES : 250753360
>    NUMBER_OF_BYTES-eng: 250753360
>    _STATISTICS_WRITING_APP: mkvmerge v8.0.0 ('Til The Day That I Die')
> 64bit
>    _STATISTICS_WRITING_APP-eng: mkvmerge v8.0.0 ('Til The Day That I
> Die') 64bit
>    _STATISTICS_WRITING_DATE_UTC: 2015-10-03 13:49:42
>    _STATISTICS_WRITING_DATE_UTC-eng: 2015-10-03 13:49:42
>    _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
>    _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
>  Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp (default)
>  Metadata:
>    BPS             : 124607
>    BPS-eng         : 124607
>    DURATION        : 00:01:49.267000000
>    DURATION-eng    : 00:01:49.267000000
>    NUMBER_OF_FRAMES: 4669
>    NUMBER_OF_FRAMES-eng: 4669
>    NUMBER_OF_BYTES : 1701940
>    NUMBER_OF_BYTES-eng: 1701940
>    _STATISTICS_WRITING_APP: mkvmerge v8.0.0 ('Til The Day That I Die')
> 64bit
>    _STATISTICS_WRITING_APP-eng: mkvmerge v8.0.0 ('Til The Day That I
> Die') 64bit
>    _STATISTICS_WRITING_DATE_UTC: 2015-10-03 13:49:42
>    _STATISTICS_WRITING_DATE_UTC-eng: 2015-10-03 13:49:42
>    _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
>    _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> [graph 0 input from stream 0:0 @ 0x78bfe0] w:3840 h:2160 pixfmt:yuv420p10le
> tb:1/1000 fr:60/1 sar:1/1 sws_param:flags=2
> [scaler for output stream 0:0 @ 0x78c2e0] w:3840 h:2160 flags:'bicubic'
> interl:0
> Incompatible pixel format 'yuv420p10le' for codec 'nvenc_hevc',
> auto-selecting format 'p010le'
> [scaler for output stream 0:0 @ 0x78c2e0] w:3840 h:2160 fmt:yuv420p10le
> sar:1/1 -> w:3840 h:2160 fmt:p010le sar:1/1 flags:0x4
> [graph 1 input from stream 0:1 @ 0x77f760] tb:1/44100 samplefmt:fltp
> samplerate:44100 chlayout:0x3
> -async is forwarded to lavfi similarly to -af
> aresample=async=1:min_hard_comp=0.100000:first_pts=0.
> [graph 1 aresample for input stream 0:1 @ 0x7c92a0] ch:2 chl:stereo
> fmt:fltp r:44100Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz
> [nvenc_hevc @ 0x78da80] This encoder is deprecated, use 'hevc_nvenc' instead
> [nvenc_hevc @ 0x78da80] Loaded Nvenc version 7.0
> [nvenc_hevc @ 0x78da80] Nvenc initialized successfully
> [nvenc_hevc @ 0x78da80] 1 CUDA capable devices found
> [nvenc_hevc @ 0x78da80] [ GPU #0 - < TITAN X (Pascal) > has Compute SM 6.1 ]
> [nvenc_hevc @ 0x78da80] supports NVENC
> [mpegts @ 0x798d80] Using AVStream.codec to pass codec parameters to muxers
> is deprecated, use AVStream.codecpar instead.
>  Last message repeated 1 times
> [mpegts @ 0x798d80] muxrate 30000000, pcr every 398 pkts, sdt every 9973,
> pat/pmt every 1994 pkts
> Output #0, mpegts, to 'udp://
> 233.33.33.1:5001?pkt_size=1316&buffer_size=1500&reuse=1&localaddr=192.168.2.94&bitrate=30000000&fifo_size=1000000
> ':
> Metadata:
>  service_name    : PikoEncoder
>  service_provider: PikoEncoder
>  encoder         : Lavf57.48.101
>  Stream #0:0: Video: hevc (nvenc_hevc) (Main 10), 1 reference frame,
> p010le, 3840x2160 [SAR 1:1 DAR 16:9], q=-1--1, 28000 kb/s, 60 fps, 90k tbn,
> 60 tbc (default)
>  Metadata:
>    BPS             : 18497251
>    BPS-eng         : 18497251
>    DURATION        : 00:01:48.450000000
>    DURATION-eng    : 00:01:48.450000000
>    NUMBER_OF_FRAMES: 6507
>    NUMBER_OF_FRAMES-eng: 6507
>    NUMBER_OF_BYTES : 250753360
>    NUMBER_OF_BYTES-eng: 250753360
>    _STATISTICS_WRITING_APP: mkvmerge v8.0.0 ('Til The Day That I Die')
> 64bit
>    _STATISTICS_WRITING_APP-eng: mkvmerge v8.0.0 ('Til The Day That I
> Die') 64bit
>    _STATISTICS_WRITING_DATE_UTC: 2015-10-03 13:49:42
>    _STATISTICS_WRITING_DATE_UTC-eng: 2015-10-03 13:49:42
>    _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
>    _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
>    encoder         : Lavc57.54.101 nvenc_hevc
>  Side data:
>    cpb: bitrate max/min/avg: 28000000/0/28000000 buffer size: 28000000
> vbv_delay: -1
>  Stream #0:1: Audio: mp2, 44100 Hz, stereo, s16, delay 481, padding 0,
> 384 kb/s (default)
>  Metadata:
>    BPS             : 124607
>    BPS-eng         : 124607
>    DURATION        : 00:01:49.267000000
>    DURATION-eng    : 00:01:49.267000000
>    NUMBER_OF_FRAMES: 4669
>    NUMBER_OF_FRAMES-eng: 4669
>    NUMBER_OF_BYTES : 1701940
>    NUMBER_OF_BYTES-eng: 1701940
>    _STATISTICS_WRITING_APP: mkvmerge v8.0.0 ('Til The Day That I Die')
> 64bit
>    _STATISTICS_WRITING_APP-eng: mkvmerge v8.0.0 ('Til The Day That I
> Die') 64bit
>    _STATISTICS_WRITING_DATE_UTC: 2015-10-03 13:49:42
>    _STATISTICS_WRITING_DATE_UTC-eng: 2015-10-03 13:49:42
>    _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
>    _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
>    encoder         : Lavc57.54.101 mp2
> Stream mapping:
> Stream #0:0 -> #0:0 (hevc (native) -> hevc (nvenc_hevc))
> Stream #0:1 -> #0:1 (aac (native) -> mp2 (native))
> Press [q] to stop, [?] for help
> [graph 1 aresample for input stream 0:1 @ 0x7c92a0] [SWR @ 0x7c9ac0] adding
> 1014 audio samples of silence
> [AVBSFContext @ 0x3f3c980] The input looks like it is Annex B already
> frame= 1179 fps= 74 q=11.0 Lsize=   72706kB time=00:00:19.86
> bitrate=29977.6kbits/s speed=1.24x
> video:49403kB audio:932kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: 44.444321%
> Input file #0
> (/media/usb0/4K_TS/SES.Astra.UHD.Test.1.2160p.UHDTV.AAC.HEVC.x265-LiebeIst.mkv):
> Input stream #0:0 (video): 1193 packets read (39902385 bytes); 1180
> frames decoded;
> Input stream #0:1 (audio): 856 packets read (312030 bytes); 856 frames
> decoded (876544 samples);
> Total: 2049 packets (40214415 bytes) demuxed
> Output file #0 (udp://
> 233.33.33.1:5001?pkt_size=1316&buffer_size=1500&reuse=1&localaddr=192.168.2.94&bitrate=30000000&fifo_size=1000000
> ):
> Output stream #0:0 (video): 1179 frames encoded; 1179 packets muxed
> (50588459 bytes);
> Output stream #0:1 (audio): 761 frames encoded (876672 samples); 761
> packets muxed (954200 bytes);
> Total: 1940 packets (51542659 bytes) muxed
> [nvenc_hevc @ 0x78da80] Nvenc unloaded
> Exiting normally, received signal 2.
> 
> Kind Regards,
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list