Opened 5 years ago

Closed 4 years ago

#7724 closed defect (needs_more_info)

[FFmpeg-vaapi] HEVC 4K/FHD to AVC 4K/FHD transcoding failed

Reported by: Andrey Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: vaapi
Cc: eero.t.tamminen@intel.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

How to reproduce:

ffmpeg -y -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i <crowd_run_3840x2160_500_50.2160p30_500_40M.265> -frames 500 -c:v h264_vaapi -b:v 25000k -minrate:v 25000k -maxrate:v 25000k -compression_level 4 -g 256 -bf 2 0001_4K02_1_0.h264

ffmpeg version N-93001-g87c165c237

Output:

 [hevc @ 0x55c5541d4180] Stream #0: not enough frames to estimate rate; consider increasing probesize
 Input #0, hevc, from '/msdk/MEDIASDK_STREAMS/_System_Validation/performance/set001/crowd_run_3840x2160_500_50.2160p30_500_40M.265':
   Duration: N/A, bitrate: N/A
     Stream #0:0: Video: hevc (Main), yuv420p(tv), 3840x2160, 30 fps, 30 tbr, 1200k tbn, 30 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
 Press [q] to stop, [?] for help
 frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A    
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
 Error reinitializing filters!
 Failed to inject frame into filter network: Function not implemented
 Error while processing the decoded data for stream #0:0
 Conversion failed!

Change History (11)

comment:1 by Carl Eugen Hoyos, 5 years ago

Component: ffmpegundetermined
Keywords: vaapi added; ffmpeg-vaapi removed

Please provide an input sample that allows to reproduce and add the command line you tested together with the complete, uncut console output to make this a valid ticket.

comment:2 by Linjie.Fu, 5 years ago

Can not reproduce on my side without the sample.
Tested with the same ffmpeg version, and it works.

ffmpeg -hwaccel vaapi -y -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /home/linjiefu/Videos/sourceVideo/4K_hevc.h265 -c:v h264_vaapi -b:v 25000k -minrate:v 25000k -maxrate:v 25000k -compression_level 4 -g 256 -bf 2 0001_4K02_1_0.h264
ffmpeg version N-93001-g87c165c237 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --enable-libmfx --disable-optimizations --enable-debug=3 --disable-stripping --enable-gpl --enable-libopenh264 --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --samples=fate-suite/
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 44.100 / 58. 44.100
  libavformat    58. 26.100 / 58. 26.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, hevc, from '/home/linjiefu/Videos/sourceVideo/4K_hevc.h265':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 3840x2160 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 1200k tbn, 50 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
Press [q] to stop, [?] for help
Output #0, h264, to '0001_4K02_1_0.h264':
  Metadata:
    encoder         : Lavf58.26.100
    Stream #0:0: Video: h264 (h264_vaapi) (High), vaapi_vld, 3840x2160 [SAR 1:1 DAR 16:9], q=-1--1, 25000 kb/s, 50 fps, 50 tbn, 50 tbc
    Metadata:
      encoder         : Lavc58.44.100 h264_vaapi
frame=   30 fps=0.0 q=-0.0 Lsize=    2092kB time=00:00:00.58 bitrate=29544.4kbits/s speed=0.999x    

comment:3 by Andrey, 5 years ago

Input stream:
http://fate-suite.ffmpeg.org/hevc-conformance/AMP_A_Samsung_4.bit

Full output:

./ffmpeg.N-93001-g87c165c237 -y -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i AMP_A_Samsung_4.bit -frames 500 -c:v h264_vaapi -b:v 25000k -minrate:v 25000k -maxrate:v 25000k -compression_level 4 -g 256 -bf 2 0001_4K02_1_0.h264 ffmpeg version N-93001-g87c165c237 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --prefix=/msdk/FFmpeg/ffmpeg_build --enable-libmfx
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 44.100 / 58. 44.100
  libavformat    58. 26.100 / 58. 26.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
Input #0, hevc, from 'AMP_A_Samsung_4.bit':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 2560x1600, 25 fps, 25 tbr, 1200k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
Press [q] to stop, [?] for help
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
Conversion failed!
Last edited 5 years ago by Andrey (previous) (diff)

comment:4 by Linjie.Fu, 5 years ago

Still can not reproduce with the provided input stream.
Maybe you could try the latest version of iHD driver/libva/libva-util and provide the commit id if the clips still fails.

ffmpeg -y -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /home/linjiefu/Videos/sourceVideo/AMP_A_Samsung_4.bit -frames 500 -c:v h264_vaapi -b:v 25000k -minrate:v 25000k -maxrate:v 25000k -compression_level 4 -g 256 -bf 2 0001_4K02_1_0.h264
ffmpeg version N-93125-gdbfd042983 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --enable-libmfx --disable-optimizations --enable-debug=3 --disable-stripping --enable-gpl --enable-libopenh264 --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --samples=fate-suite/
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 47.100 / 58. 47.100
  libavformat    58. 26.101 / 58. 26.101
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, hevc, from '/home/linjiefu/Videos/sourceVideo/AMP_A_Samsung_4.bit':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 2560x1600, 25 fps, 25 tbr, 1200k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
Press [q] to stop, [?] for help
Output #0, h264, to '0001_4K02_1_0.h264':
  Metadata:
    encoder         : Lavf58.26.101
    Stream #0:0: Video: h264 (h264_vaapi) (High), vaapi_vld, 2560x1600, q=-1--1, 25000 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.47.100 h264_vaapi
frame=   60 fps=0.0 q=-0.0 Lsize=    7998kB time=00:00:02.36 bitrate=27763.2kbits/s speed=3.62x    
video:7998kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

comment:5 by eero-t, 5 years ago

Cc: eero.t.tamminen@intel.com added

comment:7 by Zhong,Li, 5 years ago

Tested on Skylake and Kaylake, both work well. What is your test HW platform?

comment:8 by eero-t, 5 years ago

Using latest of everything (git from last evening) with kernel 5.0 works fine for me too, on Ubuntu 18.04 and Kabylake.

I wonder whether FFmpeg is actually using the correct driver. Does this point to correct one:

$ vainfo 2>&1 | fgrep /dri/

comment:9 by Andrey, 5 years ago

Works on the latest validation too with FFmpeg 0ce759d.

Is it exist some information about commit, that fix the issue ?

Last edited 5 years ago by Andrey (previous) (diff)

in reply to:  9 comment:10 by Zhong,Li, 5 years ago

Replying to andreyor:

Works on the latest validation too with FFmpeg 0ce759d.

Is it exist some information about commit, that fix the issue ?

I have no idea. Will be good if you can help to use git bisect to find out the fix commit.

comment:11 by Carl Eugen Hoyos, 4 years ago

Resolution: needs_more_info
Status: newclosed
Note: See TracTickets for help on using tickets.