Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

ffmpeg libmfx don't use GPU

Discussions about problems encountered using ffmpeg.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

ffmpeg libmfx don't use GPU

Postby paralon05 » Fri Nov 04, 2016 10:44 pm

Hello! ffmpeg with libmfx won't use GPU for encoding. Intel SDK installed properly and pass tests.

Code: Select all
# uname -a
Linux test_qsv 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux


mediasdk test (this way - metrics_monitor show GPU activity)
Code: Select all
# ./_bin/x64/sample_multi_transcode_drm -i::h264 _bin/content/test_stream.264 -o::h264 test_out.h264 -hw
Multi Transcoding Sample Version 6.0.16043175.175

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
Pipeline surfaces number: 21
MFX HARDWARE Session 0 API ver 1.19 parameters:
Input  video: AVC
Output video: AVC

Session 0 was NOT joined with other sessions

Transcoding started
..
Transcoding finished

Common transcoding time is  0.08 sec
MFX session 0 transcoding PASSED:
Processing time: 0.08 sec
Number of processed frames: 101

The test PASSED


ffmpeg output
Code: Select all
# ffmpeg -v verbose -y -i 1.mp4 -look_ahead 0 -vcodec h264_qsv -b:v 2000k 2.mp4
ffmpeg version N-82227-gdb23fde Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --disable-shared --enable-gpl --enable-libfdk-aac --enable-libx264 --enable-nonfree --enable-libmfx
  libavutil      55. 35.100 / 55. 35.100
  libavcodec     57. 66.101 / 57. 66.101
  libavformat    57. 57.100 / 57. 57.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 66.100 /  6. 66.100
  libswscale      4.  3.100 /  4.  3.100
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
[h264 @ 0x2f8e760] Reinit context to 720x416, pix_fmt: yuv420p
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.23.100
  Duration: 00:02:45.10, start: 0.000000, bitrate: 778 kb/s
    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:1(eng): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 720x404 (720x416) [SAR 404:405 DAR 16:9], 645 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
    Metadata:
      handler_name    : VideoHandler
[graph 0 input from stream 0:1 @ 0x2f8a1a0] w:720 h:404 pixfmt:yuv420p tb:1/12288 fr:24/1 sar:404/405 sws_param:flags=2
[auto-inserted scaler 0 @ 0x3084500] w:iw h:ih flags:'bicubic' interl:0
[format @ 0x3083620] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[auto-inserted scaler 0 @ 0x3084500] w:720 h:404 fmt:yuv420p sar:404/405 -> w:720 h:404 fmt:nv12 sar:404/405 flags:0x4
[graph 1 input from stream 0:0 @ 0x30903c0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
[h264_qsv @ 0x2f924a0] Initialized an internal MFX session using hardware accelerated implementation
[h264_qsv @ 0x2f924a0] Using the average variable bitrate (AVBR) ratecontrol method
[h264_qsv @ 0x2f924a0] Encoder will work with partial HW acceleration
[h264_qsv @ 0x2f924a0] profile: high; level: 30
[h264_qsv @ 0x2f924a0] GopPicSize: 250; GopRefDist: 4; GopOptFlag: closed ; IdrInterval: 0
[h264_qsv @ 0x2f924a0] TargetUsage: 4; RateControlMethod: AVBR
[h264_qsv @ 0x2f924a0] TargetKbps: 2000; Accuracy: 0; Convergence: 0
[h264_qsv @ 0x2f924a0] NumSlice: 0; NumRefFrame: 3
[h264_qsv @ 0x2f924a0] RateDistortionOpt: OFF
[h264_qsv @ 0x2f924a0] RecoveryPointSEI: unknown IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0
[h264_qsv @ 0x2f924a0] MaxFrameSize: 0; MaxSliceSize: 0;
[h264_qsv @ 0x2f924a0] BitrateLimit: unknown; MBBRC: unknown; ExtBRC: unknown
[h264_qsv @ 0x2f924a0] Trellis: auto
[h264_qsv @ 0x2f924a0] RepeatPPS: unknown; NumMbPerSlice: 0; LookAheadDS: unknown
[h264_qsv @ 0x2f924a0] AdaptiveI: unknown; AdaptiveB: unknown; BRefType: auto
[h264_qsv @ 0x2f924a0] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0
[h264_qsv @ 0x2f924a0] Entropy coding: CABAC; MaxDecFrameBuffering: 0
[h264_qsv @ 0x2f924a0] NalHrdConformance: unknown; SingleSeiNalUnit: ON; VuiVclHrdParameters: OFF VuiNalHrdParameters: OFF
Output #0, mp4, to '2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.57.100
    Stream #0:0(eng): Video: h264 (h264_qsv), 1 reference frame ([33][0][0][0] / 0x0021), nv12(left), 720x404 [SAR 404:405 DAR 16:9], q=2-31, 2000 kb/s, 24 fps, 12288 tbn, 24 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.66.101 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: -1
    Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, delay 1024, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc57.66.101 aac
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> h264 (h264_qsv))
  Stream #0:0 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[h264 @ 0x309bc20] Reinit context to 720x416, pix_fmt: yuv420p
frame= 2693 fps=270 q=-0.0 Lsize=   29135kB time=00:01:52.51 bitrate=2121.3kbits/s speed=11.3x   
video:27260kB audio:1793kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.284673%


metrics_monitor
Code: Select all
# ./run.sh
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
RENDER usage: 0.00, VIDEO usage: 0.00,  VIDEO_E usage: 0.00 GT Freq: 350.00
paralon05
 
Posts: 1
Joined: Fri Nov 04, 2016 10:25 pm

Re: ffmpeg libmfx don't use GPU

Postby milanc » Wed Jan 11, 2017 11:10 am

I have the same problem with last ffmpeg versions.
But in older version N-82007-g1a9513b qsv works fine (I see load in intel_gpu_top). On newer versions CPU encodes instead of GPU. Do you have any solution?
milanc
 
Posts: 8
Joined: Wed Aug 26, 2015 7:50 am

Re: ffmpeg libmfx don't use GPU

Postby milanc » Wed Aug 23, 2017 2:41 am

The same problem stills with MSS 2017 R3 and last ffmpeg version N-87031-gf3913dc.
Do you have any progress with this problem?
milanc
 
Posts: 8
Joined: Wed Aug 26, 2015 7:50 am

Re: ffmpeg libmfx don't use GPU

Postby llogan » Wed Aug 23, 2017 4:37 pm

Try the ffmpeg-user mailing list or Super User. I don't have the hardware to try this myself.
Get an answer more quickly by providing your actual ffmpeg command and the complete console output. Use the code button to format your command and output or your question will be ignored.
llogan
 
Posts: 2356
Joined: Fri Jan 25, 2013 9:47 pm
Location: Alaska


Return to ffmpeg

Who is online

Users browsing this forum: No registered users and 4 guests