Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5899 closed defect (duplicate)

hevc_qsv does not work with MSS2017

Reported by: Milan Cizek Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: qsv
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I tested last ffmpeg with MSS2017. All samples from MSS are working including h264->hevc conversion.
But ffmpegg doesn't work with hevc_qsv. I think, is uses other plugin 2fca99749fdb49aeb121a5b63ef568f7 than is needed?

CPU0: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (family: 0x6, model: 0x5e, stepping: 0x3)

Media SDK Plugins available:
(for more info see /opt/intel/mediasdk/plugins/plugins.cfg)
--------------------------
    H264LA Encoder      = 588f1185d47b42968dea377bb5d0dcb4
    VP8 Decoder         = f622394d8d87452f878c51f2fc9b4131
    HEVC Decoder        = 33a61c0b4c27454ca8d85dde757c6f8e
    HEVC Encoder        = 6fadc791a0c2eb479ab6dcd5ea9da347

Summary of the bug:
How to reproduce:

ffmpeg version N-82007-g1a9513b Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --prefix=./ffmpeg-build --pkg-config-flags=--static --bindir=/root/bin --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-nvenc --enable-libmfx --enable-version3 --enable-pthreads --enable-runtime-cpudetect --disable-ffserver --enable-libfreetype --enable-filter=drawtext
  libavutil      55. 32.100 / 55. 32.100
  libavcodec     57. 61.103 / 57. 61.103
  libavformat    57. 52.100 / 57. 52.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 64.100 /  6. 64.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  2.100 /  2.  2.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input file with argument '/opt/intel/mediasdk/samples/streams/test_stream.264'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'hevc_qsv'.
Reading option '-preset:v' ... matched as AVOption 'preset:v' with argument 'faster'.
Reading option 'out.qsv.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file /opt/intel/mediasdk/samples/streams/test_stream.264.
Successfully parsed a group of options.
Opening an input file: /opt/intel/mediasdk/samples/streams/test_stream.264.
[file @ 0x3be19e0] Setting default whitelist 'file,crypto'
[h264 @ 0x3be10c0] Format h264 probed with size=2048 and score=51
[h264 @ 0x3be10c0] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:1
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
[h264 @ 0x3be27e0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 7, nal_ref_idc: 1
[h264 @ 0x3be27e0] nal_unit_type: 8, nal_ref_idc: 1
[h264 @ 0x3be27e0] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 5, nal_ref_idc: 1
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
[h264 @ 0x3be27e0] Reinit context to 176x96, pix_fmt: yuv420p
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
[h264 @ 0x3be27e0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 1, nal_ref_idc: 1
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
[h264 @ 0x3be27e0] Increasing reorder buffer to 1
[h264 @ 0x3be27e0] no picture
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
[h264 @ 0x3be27e0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 1, nal_ref_idc: 0
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3be27e0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 1, nal_ref_idc: 1
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3be27e0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 1, nal_ref_idc: 0
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3be27e0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 1, nal_ref_idc: 1
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3be27e0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 1, nal_ref_idc: 0
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3be27e0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3be27e0] nal_unit_type: 1, nal_ref_idc: 1
[h264 @ 0x3be27e0] ct_type:0 pic_struct:0
    Last message repeated 93 times
[h264 @ 0x3be10c0] After avformat_find_stream_info() pos: 267554 bytes read:267554 seeks:0 frames:101
Input #0, h264, from '/opt/intel/mediasdk/samples/streams/test_stream.264':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 101, 1/1200000: Video: h264 (High), 1 reference frame, yuv420p(left), 176x96 [SAR 1:1 DAR 11:6], 0/1, 30 fps, 30 tbr, 1200k tbn, 60 tbc
Successfully opened the file.
Parsing a group of options: output file out.qsv.mp4.
Applying option c:v (codec name) with argument hevc_qsv.
Successfully parsed a group of options.
Opening an output file: out.qsv.mp4.
[file @ 0x3c904c0] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 8 logical cores
[graph 0 input from stream 0:0 @ 0x3c3eec0] Setting 'video_size' to value '176x96'
[graph 0 input from stream 0:0 @ 0x3c3eec0] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x3c3eec0] Setting 'time_base' to value '1/1200000'
[graph 0 input from stream 0:0 @ 0x3c3eec0] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x3c3eec0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x3c3eec0] Setting 'frame_rate' to value '60/2'
[graph 0 input from stream 0:0 @ 0x3c3eec0] w:176 h:96 pixfmt:yuv420p tb:1/1200000 fr:60/2 sar:1/1 sws_param:flags=2
[format @ 0x3c34060] compat: called with args=[nv12|qsv]
[format @ 0x3c34060] Setting 'pix_fmts' to value 'nv12|qsv'
[auto-inserted scaler 0 @ 0x3c1bb20] Setting 'flags' to value 'bicubic'
[auto-inserted scaler 0 @ 0x3c1bb20] w:iw h:ih flags:'bicubic' interl:0
[format @ 0x3c34060] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x3be1780] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed
[auto-inserted scaler 0 @ 0x3c1bb20] w:176 h:96 fmt:yuv420p sar:1/1 -> w:176 h:96 fmt:nv12 sar:1/1 flags:0x4
[h264 @ 0x3c1f920] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3c1f920] nal_unit_type: 7, nal_ref_idc: 1
[h264 @ 0x3c1f920] nal_unit_type: 8, nal_ref_idc: 1
[h264 @ 0x3c1f920] Ignoring NAL type 9 in extradata
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
[hevc_qsv @ 0x3c3f9e0] mfx initialization: /dev/dri/renderD128 vaInitialize successful
[hevc_qsv @ 0x3c3f9e0] Could not load the requested plugin: 2fca99749fdb49aeb121a5b63ef568f7
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_qsv))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[AVIOContext @ 0x3c1d500] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x3be9d00] Statistics: 267554 bytes read, 0 seeks

Change History (13)

comment:1 by Carl Eugen Hoyos, 7 years ago

Priority: importantnormal

comment:2 by Milan Cizek, 7 years ago

Maybe uids were changed in MSS2017... just editing constants in qsvenc_hevc.c?

    if (q->load_plugin != LOAD_PLUGIN_NONE) {
        static const char *uid_hevcenc_sw = "2fca99749fdb49aeb121a5b63ef568f7";
        static const char *uid_hevcenc_hw = "6fadc791a0c2eb479ab6dcd5ea9da347";

comment:3 by Carl Eugen Hoyos, 7 years ago

Isn't this a duplicate of ticket #5859?

comment:4 by Milan Cizek, 7 years ago

no, this is other problem.

comment:5 by jkqxz, 7 years ago

Resolution: fixed
Status: newclosed

Fixed in 1f26a231bb065276cd80ce02957c759f3197edfa.

(Note that the implementation currently defaults to the software encoder in the media SDK for compatibility reasons; add "-load_plugin hevc_hw" to use the hardware encoder.)

comment:6 by Carl Eugen Hoyos, 7 years ago

Keywords: mfx removed
Resolution: fixedduplicate

comment:7 by Milan Cizek, 7 years ago

Please, can you provide full command with "-load_plugin hevc_hw"? I'm not successful. Thank you.

comment:8 by jkqxz, 7 years ago

CQ:

./ffmpeg_g -y -i in.mp4 -an -c:v hevc_qsv -load_plugin hevc_hw -q 30 out.mp4

CBR:

./ffmpeg_g -y -i in.mp4 -an -c:v hevc_qsv -load_plugin hevc_hw -b 5M -maxrate 5M out.mp4

comment:9 by Milan Cizek, 7 years ago

It doesn't work with my example.

ffmpeg -loglevel debug -y -i "udp://@239.255.0.115:1234?fifo_size=1000000&overrun_nonfatal=1" -sn -an -c:v hevc_qsv -load_plugin hevc_hw out.qsv.mp4
ffmpeg version N-82007-g1a9513b Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --prefix=./ffmpeg-build --pkg-config-flags=--static --bindir=/root/bin --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-nvenc --enable-libmfx --enable-version3 --enable-pthreads --enable-runtime-cpudetect --disable-ffserver --enable-libfreetype --enable-filter=drawtext
  libavutil      55. 32.100 / 55. 32.100
  libavcodec     57. 61.103 / 57. 61.103
  libavformat    57. 52.100 / 57. 52.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 64.100 /  6. 64.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  2.100 /  2.  2.100
  libpostproc    54.  0.100 / 54.  0.100
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] SPS unavailable in decode_picture_timing
[h264 @ 0x40b5fc0] non-existing PPS 0 referenced
[h264 @ 0x40b5fc0] decode_slice_header error
[h264 @ 0x40b5fc0] no frame!
Input #0, mpegts, from 'udp://@239.255.0.115:1234?fifo_size=1000000&overrun_nonfatal=1':
  Duration: N/A, start: 6781.665556, bitrate: N/A
  Program 263
    Stream #0:0[0x7db]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x7dc](cze): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x7de](cze): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, mono, s16p, 64 kb/s (visual impaired)
    Stream #0:3[0x7e0](cze): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired)
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
[hevc_qsv @ 0x464c3e0] Selected ratecontrol mode is not supported by the QSV runtime. Choose a different mode.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_qsv))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

comment:10 by jkqxz, 7 years ago

If only there were some sort of error message in the output:

[hevc_qsv @ 0x464c3e0] Selected ratecontrol mode is not supported by the QSV runtime. Choose a different mode.

You may find it useful to compare my working commands with yours, with particular attention to the choice of rate control mode.

comment:11 by Milan Cizek, 7 years ago

ffmpeg version N-82988-g28307ef

# ffmpeg -y -i "udp://@239.255.0.101:1234?fifo_size=1000000&overrun_nonfatal=1" -an -sn -map v:0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 1500k -maxrate 3000k /a.mp4

or

ffmpeg -y -i "udp://@239.255.0.101:1234?fifo_size=1000000&overrun_nonfatal=1" -an -sn -map v:0 -c:v hevc_qsv -load_plugin hevc_hw -q 30 /a.mp4

In both examples I have result:

[hevc_qsv @ 0x4437f80] Selected ratecontrol mode is not supported by the QSV runtime. Choose a different mode.
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> hevc (hevc_qsv))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

comment:12 by mort1k, 7 years ago

Confirm:

[root@localhost sample]# uname  -a
Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

ffmpeg debug:

[root@localhost bin]# ./ffmpeg   -loglevel debug   -i http://x.x.x.x:8090/channel/928 -dts_delta_threshold 1000 -s 720x576 -g 13 -keyint_min 13 -c:v mpeg2_qsv -b:v 4300k      -c:a mp2 -ac 2 -b:a 128k -ar 48000   -af aresample=async=1000  -strict 1  -threads 0 -flush_packets 0  -f mpegts  "udp://239.255.5.2:1234?pkt_size=1316&reuse=1&buffer_size=131070&fifo_size=1000000&bitrate=3700000&overrun_nonfatal=1"
ffmpeg version N-83096-g6596b34 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libx264 --enable-libmfx
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 72.100 / 57. 72.100
  libavformat    57. 62.100 / 57. 62.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 69.100 /  6. 69.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'http://x.x.x.x:8080/channel/928'.
Reading option '-dts_delta_threshold' ... matched as option 'dts_delta_threshold' (timestamp discontinuity delta threshold) with argument '1000'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '720x576'.
Reading option '-g' ... matched as AVOption 'g' with argument '13'.
Reading option '-keyint_min' ... matched as AVOption 'keyint_min' with argument '13'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'mpeg2_qsv'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '4300k'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'mp2'.
Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '2'.
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '128k'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '48000'.
Reading option '-af' ... matched as option 'af' (set audio filters) with argument 'aresample=async=1000'.
Reading option '-strict' ...Routing option strict to both codec and muxer layer
 matched as AVOption 'strict' with argument '1'.
Reading option '-threads' ... matched as AVOption 'threads' with argument '0'.
Reading option '-flush_packets' ... matched as AVOption 'flush_packets' with argument '0'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mpegts'.
Reading option 'udp://239.255.5.2:1234?pkt_size=1316&reuse=1&buffer_size=131070&fifo_size=1000000&bitrate=3700000&overrun_nonfatal=1' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option dts_delta_threshold (timestamp discontinuity delta threshold) with argument 1000.
Successfully parsed a group of options.
Parsing a group of options: input url http://x.x.x.x:8080/channel/928.
Successfully parsed a group of options.

......

Parsing a group of options: output url udp://239.255.5.2:1234?pkt_size=1316&reuse=1&buffer_size=131070&fifo_size=1000000&bitrate=3700000&overrun_nonfatal=1.
Applying option s (set frame size (WxH or abbreviation)) with argument 720x576.
Applying option c:v (codec name) with argument mpeg2_qsv.
Applying option b:v (video bitrate (please use -b:v)) with argument 4300k.
Applying option c:a (codec name) with argument mp2.
Applying option ac (set number of audio channels) with argument 2.
Applying option b:a (video bitrate (please use -b:v)) with argument 128k.
Applying option ar (set audio sampling rate (in Hz)) with argument 48000.
Applying option af (set audio filters) with argument aresample=async=1000.
Applying option f (force format) with argument mpegts.
Successfully parsed a group of options.
Opening an output file: udp://239.255.5.2:1234?pkt_size=1316&reuse=1&buffer_size=131070&fifo_size=1000000&bitrate=3700000&overrun_nonfatal=1.
[udp @ 0x3b08cc0] No default whitelist set
Successfully opened the file.
detected 4 logical cores
[h264 @ 0x36e9e20] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x36e9e20] nal_unit_type: 7, nal_ref_idc: 1
[h264 @ 0x36e9e20] nal_unit_type: 8, nal_ref_idc: 1
[h264 @ 0x36e9e20] Ignoring NAL type 9 in extradata
[graph 0 input from stream 0:0 @ 0x3aa0c80] Setting 'video_size' to value '720x576'
[graph 0 input from stream 0:0 @ 0x3aa0c80] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x3aa0c80] Setting 'time_base' to value '1/90000'
[graph 0 input from stream 0:0 @ 0x3aa0c80] Setting 'pixel_aspect' to value '16/11'
[graph 0 input from stream 0:0 @ 0x3aa0c80] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x3aa0c80] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x3aa0c80] w:720 h:576 pixfmt:yuv420p tb:1/90000 fr:25/1 sar:16/11 sws_param:flags=2
[scaler_out_0_0 @ 0x3805660] Setting 'w' to value '720'
[scaler_out_0_0 @ 0x3805660] Setting 'h' to value '576'
[scaler_out_0_0 @ 0x3805660] Setting 'flags' to value 'bicubic'
[scaler_out_0_0 @ 0x3805660] w:720 h:576 flags:'bicubic' interl:0
[format @ 0x3aa0720] compat: called with args=[nv12|qsv]
[format @ 0x3aa0720] Setting 'pix_fmts' to value 'nv12|qsv'
[AVFilterGraph @ 0x3745220] query_formats: 5 queried, 4 merged, 0 already done, 0 delayed
[scaler_out_0_0 @ 0x3805660] w:720 h:576 fmt:yuv420p sar:16/11 -> w:720 h:576 fmt:nv12 sar:16/11 flags:0x4
[mpeg2_qsv @ 0x3b083a0] Initialized an internal MFX session using hardware accelerated implementation
[mpeg2_qsv @ 0x3b083a0] Using the average variable bitrate (AVBR) ratecontrol method
[mpeg2_qsv @ 0x3b083a0] Encoder will work with partial HW acceleration
[mpeg2_qsv @ 0x3b083a0] Error retrieving encoding parameters.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (mpeg2_qsv))
  Stream #0:1 -> #0:1 (mp2 (native) -> mp2 (native))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[AVIOContext @ 0x3804300] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x36e2ee0] Statistics: 1632442 bytes read, 0 seeks

sys_check:

--------------------------
Hardware readiness checks:
--------------------------
 [ OK ] Processor name: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
--------------------------
OS readiness checks:
--------------------------
 [ OK ] GPU visible to OS
--------------------------
Intel(R) Media Server Studio Install:
--------------------------
 [ OK ] user is root
 [ OK ] libva.so.1 found
 [ OK ] vainfo reports valid codec entry points
 [ OK ] /dev/dri/renderD128 connects to Intel i915

--------------------------
Media SDK Plugins available:
(for more info see /opt/intel/mediasdk/plugins/plugins.cfg)
--------------------------
    H264LA Encoder 	= 588f1185d47b42968dea377bb5d0dcb4
    VP8 Decoder 	= f622394d8d87452f878c51f2fc9b4131
    HEVC Decoder 	= 33a61c0b4c27454ca8d85dde757c6f8e
    HEVC Encoder 	= 6fadc791a0c2eb479ab6dcd5ea9da347
--------------------------
Component Smoke Tests:
--------------------------
 [ OK ] Media SDK HW API level:1.19
 [ OK ] Media SDK SW API level:1.19
 [ OK ] OpenCL check:platform:Intel(R) OpenCL GPU OK CPU OK

work with:
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers

but decoder can't read that stream:

General
ID                                       : 1 (0x1)
Complete name                            : /root/1.ts
Format                                   : MPEG-TS
File size                                : 6.02 MiB
Duration                                 : 12 s 76 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 3 670 kb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Default
Format settings, GOP                     : M=4, N=13
Codec ID                                 : 2
Duration                                 : 11 s 520 ms
Bit rate mode                            : Constant
Bit rate                                 : 3 359 kb/s
Maximum bit rate                         : 3 300 kb/s
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 FPS
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.324
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Closed
Stream size                              : 4.61 MiB (77%)

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 3
Duration                                 : 13 s 128 ms
Bit rate mode                            : Constant
Bit rate                                 : 128 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Compression mode                         : Lossy
Delay relative to video                  : -2 s 50 ms
Stream size                              : 205 KiB (3%)

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 12 s 76 ms
List                                     : 256 (0x100) (MPEG Video) / 257 (0x101) (MPEG Audio)
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television
Parsing a group of options: output url udp://239.255.5.2:1234?pkt_size=1316&reuse=1&buffer_size=131070&fifo_size=1000000&bitrate=3700000&overrun_nonfatal=1.
Applying option s (set frame size (WxH or abbreviation)) with argument 720x576.
Applying option c:v (codec name) with argument mpeg2_qsv.
Applying option profile:v (set profile) with argument main.
Applying option b:v (video bitrate (please use -b:v)) with argument 3300k.
Applying option c:a (codec name) with argument mp2.
Applying option ac (set number of audio channels) with argument 2.
Applying option b:a (video bitrate (please use -b:v)) with argument 128k.
Applying option ar (set audio sampling rate (in Hz)) with argument 48000.
Applying option af (set audio filters) with argument aresample=async=1000.
Applying option f (force format) with argument mpegts.
Successfully parsed a group of options.
Opening an output file: udp://239.255.5.2:1234?pkt_size=1316&reuse=1&buffer_size=131070&fifo_size=1000000&bitrate=3700000&overrun_nonfatal=1.
[udp @ 0x3cce5c0] No default whitelist set
Successfully opened the file.
detected 4 logical cores
[graph 0 input from stream 0:0 @ 0x3bd1580] Setting 'video_size' to value '1920x1080'
[graph 0 input from stream 0:0 @ 0x3bd1580] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x3bd1580] Setting 'time_base' to value '1/90000'
[graph 0 input from stream 0:0 @ 0x3bd1580] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x3bd1580] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x3bd1580] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x3bd1580] w:1920 h:1080 pixfmt:yuv420p tb:1/90000 fr:25/1 sar:1/1 sws_param:flags=2
[scaler for output stream 0:0 @ 0x3fc3900] Setting 'w' to value '720'
[scaler for output stream 0:0 @ 0x3fc3900] Setting 'h' to value '576'
[scaler for output stream 0:0 @ 0x3fc3900] Setting 'flags' to value 'bicubic'
[scaler for output stream 0:0 @ 0x3fc3900] w:720 h:576 flags:'bicubic' interl:0
[format @ 0x3fc51e0] compat: called with args=[nv12|qsv]
[format @ 0x3fc51e0] Setting 'pix_fmts' to value 'nv12|qsv'
[AVFilterGraph @ 0x3e127c0] query_formats: 5 queried, 4 merged, 0 already done, 0 delayed
[scaler for output stream 0:0 @ 0x3fc3900] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:720 h:576 fmt:nv12 sar:64/45 flags:0x4
[Parsed_aresample_0 @ 0x3e12320] Setting 'async' to value '1000'
[graph 1 input from stream 0:1 @ 0x3c13e20] Setting 'time_base' to value '1/48000'
[graph 1 input from stream 0:1 @ 0x3c13e20] Setting 'sample_rate' to value '48000'
[graph 1 input from stream 0:1 @ 0x3c13e20] Setting 'sample_fmt' to value 's16p'
[graph 1 input from stream 0:1 @ 0x3c13e20] Setting 'channel_layout' to value '0x3'
[graph 1 input from stream 0:1 @ 0x3c13e20] tb:1/48000 samplefmt:s16p samplerate:48000 chlayout:0x3
[audio format for output stream 0:1 @ 0x3bfc740] Setting 'sample_fmts' to value 's16'
[audio format for output stream 0:1 @ 0x3bfc740] Setting 'sample_rates' to value '48000'
[audio format for output stream 0:1 @ 0x3bfc740] Setting 'channel_layouts' to value '0x3'
[AVFilterGraph @ 0x3ccec60] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
[Parsed_aresample_0 @ 0x3e12320] [SWR @ 0x3d128c0] Using s16p internally between filters
[Parsed_aresample_0 @ 0x3e12320] ch:2 chl:stereo fmt:s16p r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[h264 @ 0x3bfd740] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3bfd740] nal_unit_type: 7, nal_ref_idc: 1
[h264 @ 0x3bfd740] nal_unit_type: 8, nal_ref_idc: 1
[h264 @ 0x3bfd740] Ignoring NAL type 9 in extradata
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
[mpeg2_qsv @ 0x3bd9040] mfx initialization: /dev/dri/renderD128 vaInitialize successful
[mpeg2_qsv @ 0x3bd9040] Initialized an internal MFX session using hardware accelerated implementation
[mpeg2_qsv @ 0x3bd9040] Using the constant bitrate (CBR) ratecontrol method
[mpeg2_qsv @ 0x3bd9040] profile: main; level: 8
[mpeg2_qsv @ 0x3bd9040] GopPicSize: 13; GopRefDist: 4; GopOptFlag: closed ; IdrInterval: 0
[mpeg2_qsv @ 0x3bd9040] TargetUsage: 4; RateControlMethod: CBR
[mpeg2_qsv @ 0x3bd9040] InitialDelayInKB: 300; TargetKbps: 3300; MaxKbps: 3300
[mpeg2_qsv @ 0x3bd9040] NumSlice: 36; NumRefFrame: 0
[mpeg2_qsv @ 0x3bd9040] RateDistortionOpt: unknown
[mpeg2_qsv @ 0x3bd9040] RecoveryPointSEI: unknown IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0
[mpeg2_qsv @ 0x3bd9040] MaxFrameSize: 0; MaxSliceSize: 0; 
[mpeg2_qsv @ 0x3bd9040] BitrateLimit: unknown; MBBRC: unknown; ExtBRC: unknown
[mpeg2_qsv @ 0x3bd9040] Trellis: auto
[mpeg2_qsv @ 0x3bd9040] RepeatPPS: unknown; NumMbPerSlice: 0; LookAheadDS: unknown
[mpeg2_qsv @ 0x3bd9040] AdaptiveI: unknown; AdaptiveB: unknown; BRefType: auto
[mpeg2_qsv @ 0x3bd9040] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0
[mpegts @ 0x3c1f2a0] muxrate 3670000, pcr every 48 pkts, sdt every 1220, pat/pmt every 244 pkts
Output #0, mpegts, to 'udp://239.255.5.2:1234?pkt_size=1316&reuse=1&buffer_size=131070&fifo_size=1000000&bitrate=3700000&overrun_nonfatal=1':
  Metadata:
    encoder         : Lavf57.56.100
    Stream #0:0, 0, 1/90000: Video: mpeg2video (mpeg2_qsv), 1 reference frame, nv12(left), 720x576 [SAR 64:45 DAR 16:9], 0/1, q=2-31, 3300 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.64.101 mpeg2_qsv
    Side data:
      cpb: bitrate max/min/avg: 3300000/3300000/3300000 buffer size: 1625000 vbv_delay: -1
    Stream #0:1, 0, 1/90000: Audio: mp2, 48000 Hz, stereo, s16, delay 481, 128 kb/s
    Metadata:
      encoder         : Lavc57.64.101 mp2
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (mpeg2_qsv))
  Stream #0:1 -> #0:1 (mp2 (native) -> mp2 (native))

....
    Last message repeated 1 times
[h264 @ 0x3c04080] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3c04080] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3c04080] nal_unit_type: 1, nal_ref_idc: 1
[h264 @ 0x3c04080] ct_type:0 pic_struct:1
[h264 @ 0x3e5e220] mmco: unref short failure
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[h264 @ 0x3e5e220] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3e5e220] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3e5e220] nal_unit_type: 1, nal_ref_idc: 1
[h264 @ 0x3e5e220] ct_type:0 pic_struct:2
[h264 @ 0x3e5e220] no picture 
cur_dts is invalid (this is harmless if it occurs once at the start per stream)

GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED
GOP: IBBPBBPBBPBBP 13 CLOSED

Last edited 7 years ago by mort1k (previous) (diff)

comment:13 by Milan Cizek, 7 years ago

The problem remains - CPU encoding instead of GPU.

N-87023-g8754ccd

ffmpeg -loglevel debug -y -i "udp://@239.239.2.101:1234?fifo_size=1000000&overrun_nonfatal=1"  -map v:0 -profile:v main -c:v h264_qsv -look_ahead 0 -b:v 1500k -maxrate 2000k -bufsize 4000k  -keyint_min 50 -g 150 -map a:0 -c:a libfdk_aac -b:a 128k -ar 44100 -ac 2 /a.ts
--------------------------
Hardware readiness checks:
--------------------------
 [ OK ] Processor name: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
--------------------------
OS readiness checks:
--------------------------
 [ OK ] GPU visible to OS
--------------------------
Intel(R) Media Server Studio Install:
--------------------------
 [ OK ] user is root
 [ OK ] libva.so.1 found
 [ OK ] vainfo reports valid codec entry points
 [ OK ] /dev/dri/renderD128 connects to Intel i915
 [ ERROR ] could not open /dev/dri/renderD129
 [ ERROR ] could not open /dev/dri/renderD130

--------------------------
Media SDK Plugins available:
(for more info see /opt/intel/mediasdk/plugins/plugins.cfg)
--------------------------
    H264LA Encoder      = 588f1185d47b42968dea377bb5d0dcb4
    VP8 Decoder         = f622394d8d87452f878c51f2fc9b4131
    HEVC Decoder        = 33a61c0b4c27454ca8d85dde757c6f8e
    HEVC Encoder        = 6fadc791a0c2eb479ab6dcd5ea9da347
--------------------------
Component Smoke Tests:
--------------------------
 [ OK ] Media SDK HW API level:1.19
 [ OK ] Media SDK SW API level:1.19
 [ OK ] OpenCL check:./oclcheck: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./oclcheck)
platform:Intel(R) OpenCL GPU OK CPU OK
platform:NVIDIA CUDA GPU OK CPU FAIL

Note: See TracTickets for help on using tickets.