Intel QSV Codecs

Website, builds, or other suggestions.
User avatar
mikeversteeg
Posts: 16
Joined: Fri Feb 19, 2016 1:22 pm

Re: Intel QSV Codecs

Post by mikeversteeg » Thu Mar 10, 2016 10:42 am

Hi Kyle, here's my output:

Code: Select all

ffmpeg -i 1.mp4 -c:v h264_qsv -preset:v faster 2.mp4

ffmpeg version N-78843-g1c7e2cf Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopenc
ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --ena
ble-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable
-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --ena
ble-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx
264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable
-lzma --enable-decklink --enable-zlib
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 27.101 / 57. 27.101
  libavformat    57. 27.100 / 57. 27.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 37.100 /  6. 37.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000004938c0] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : VisualHub 1.24
    title           : Hello, Hello
    artist          : Geoffrey C Smith
    album_artist    : Geoffrey C Smith
    composer        : Geoffrey C Smith
    album           : GeekBrief.TV
    genre           : Podcast
    date            : 2007
    comment         : http://www.thegeoffsmith.com
    show            : GeekBrief.TV
    episode_id      : GBTV.hellohello
  Duration: 00:03:30.98, start: 0.000000, bitrate: 4461 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 960x540 [
SAR 1:1 DAR 16:9], 4308 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)

    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, flt
p, 127 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : SoundHandler
    Stream #0:2: Video: png, rgb24(pc), 898x505, 90k tbr, 90k tbn, 90k tbc
[h264_qsv @ 00000000029ef480] Selected ratecontrol mode is not supported by the
QSV runtime. Choose a different mode.
Output #0, mp4, to '2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: mp41
    episode_id      : GBTV.hellohello
    encoder         : VisualHub 1.24
    title           : Hello, Hello
    artist          : Geoffrey C Smith
    album_artist    : Geoffrey C Smith
    composer        : Geoffrey C Smith
    album           : GeekBrief.TV
    genre           : Podcast
    date            : 2007
    comment         : http://www.thegeoffsmith.com
    show            : GeekBrief.TV
    Stream #0:0(und): Video: h264, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 29.9
7 fps (default)
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
      encoder         : Lavc57.27.101 h264_qsv
    Stream #0:1(und): Audio: aac, 0 channels, 128 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : SoundHandler
      encoder         : Lavc57.27.101 aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters
such as bit_rate, rate, width or height

User avatar
Zeranoe
Site Admin
Posts: 640
Joined: Sat May 07, 2011 7:12 pm
Contact:

Re: Intel QSV Codecs

Post by Zeranoe » Thu Mar 10, 2016 2:29 pm

That is a different error. You will need to set a rate control method:

Code: Select all

-q 5 -look_ahead 0
or

Code: Select all

-b:v 2M -look_ahead 0
or if your machine supports look_ahead

Code: Select all

-b:v 2M

User avatar
mikeversteeg
Posts: 16
Joined: Fri Feb 19, 2016 1:22 pm

Re: Intel QSV Codecs

Post by mikeversteeg » Thu Mar 10, 2016 2:40 pm

I did not try any of those things as both Intel and FFmpeg documentation and (recent) blogs always use these defaults, they never set any parameter. I find it hard to believe they just make these examples up without really testing them.

See e.g.

https://trac.ffmpeg.org/wiki/HWAccelIntro
https://communities.intel.com/community ... sync-video

User avatar
Zeranoe
Site Admin
Posts: 640
Joined: Sat May 07, 2011 7:12 pm
Contact:

Re: Intel QSV Codecs

Post by Zeranoe » Thu Mar 10, 2016 3:51 pm

There's currently a ticket open for this issue, but it looks pretty stagnate http://trac.ffmpeg.org/ticket/4831

User avatar
mikeversteeg
Posts: 16
Joined: Fri Feb 19, 2016 1:22 pm

Re: Intel QSV Codecs

Post by mikeversteeg » Fri Mar 11, 2016 11:38 am

I'm confused. I intentionally did not start investigating this exciting feature as I knew it was in beta. Now it is officially included in 3.0 I assumed it was tested. Defaults no longer working seems like a regression.

I added the rate control and now I get the
Error retrieving encoding parameters
.

User avatar
Zeranoe
Site Admin
Posts: 640
Joined: Sat May 07, 2011 7:12 pm
Contact:

Re: Intel QSV Codecs

Post by Zeranoe » Sat Mar 12, 2016 8:33 pm

What CPU are you using? Does it happen to be a 4th generation Haswell-DT?

I submitted a report for this issue http://trac.ffmpeg.org/ticket/5324

User avatar
mikeversteeg
Posts: 16
Joined: Fri Feb 19, 2016 1:22 pm

Re: Intel QSV Codecs

Post by mikeversteeg » Sun Mar 13, 2016 9:10 am

Don't know. i7-something. Frankly I did not even check if this particular PC supports quicksync as I assumed FFmpeg would give a nice warning (like it always does) that tells me in proper English that the CPU isn't supported. I have plenty of other PCs so could try it on various CPUs but I feel this feature isn't ready for release to the general public so I'll let it rest of a while and revisit later. If the developer of this particular piece of code needs me to test something just PM me.

mylifeponraj
Posts: 1
Joined: Tue Mar 22, 2016 3:46 pm

Re: Intel QSV Codecs

Post by mylifeponraj » Tue Mar 22, 2016 3:58 pm

CPU USED: I5-3550 (QSV Enabled)
COMMAND:

Code: Select all

D:\ffmpeg\bin>ffmpeg -y -i <INPUT_FILE> -c:v h264_qsv test.mp4
ERROR:

Code: Select all

ffmpeg version N-79107-g30d1213 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopenc
ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --ena
ble-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enabl
e-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-l
ibvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-li
bwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enab
le-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 28.103 / 57. 28.103
  libavformat    57. 29.100 / 57. 29.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.102 /  6. 39.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, flv, from '<INPUT_FILE>':
  Metadata:
    starttime       : 0
    totalduration   : 2911
    totaldatarate   : 625
    bytelength      : 227500817
    canseekontime   : true
    sourcedata      : B4A7DA922HH1368985067864429
    purl            :
    pmsg            :
    httphostheader  : r8---sn-h557snee.c.youtube.com
  Duration: 00:48:31.16, start: 0.000000, bitrate: 625 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p, 624x352, 500 kb/s, 25 fps, 25 tbr,
 1k tbn, 50 tbc
    Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 131 kb/s
[h264_qsv @ 05280760] Error initializing an internal MFX session
Output #0, mp4, to 'test.mp4':
  Metadata:
    starttime       : 0
    totalduration   : 2911
    totaldatarate   : 625
    bytelength      : 227500817
    canseekontime   : true
    sourcedata      : B4A7DA922HH1368985067864429
    purl            :
    pmsg            :
    httphostheader  : r8---sn-h557snee.c.youtube.com
    Stream #0:0: Video: h264, none, q=2-31, 128 kb/s, 25 fps
    Metadata:
      encoder         : Lavc57.28.103 h264_qsv
    Stream #0:1: Audio: aac, 0 channels, 128 kb/s
    Metadata:
      encoder         : Lavc57.28.103 aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters
such as bit_rate, rate, width or height
h264_qsv error initializing an internal mfx
=============================================================
I tried all the builds 32bit and 64 bit created from May2016 The Error is the same.

But if i use "ffmpeg-20150610-git-913685f-win64-static.7z" it works fine.

User avatar
mikeversteeg
Posts: 16
Joined: Fri Feb 19, 2016 1:22 pm

Re: Intel QSV Codecs

Post by mikeversteeg » Wed Mar 30, 2016 9:26 am

It's odd this regression is not getting any attention, still not fixed: https://git.videolan.org/?p=ffmpeg.git; ... 1;hpb=n3.0

utmedical
Posts: 1
Joined: Tue Apr 26, 2016 2:42 pm

Re: Intel QSV Codecs

Post by utmedical » Tue Apr 26, 2016 4:25 pm

I've also experienced the same error with any of the current builds:

Code: Select all

Selected ratecontrol mode is not supported by the QSV runtime. Choose a different mode.
...
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Intel 3770k on Windows 8.1 with current Intel® Media SDK installed. Also, per @mylifeponraj I tried the one build he said worked:
ffmpeg-20150610-git-913685f-win64-static.7z
And it does seem to work using

Code: Select all

-c:v h264_qsv
but I noticed that the speed was 25% slower than software encoding. Checked CPU and it was 75-90% during the encode as well. On a hunch, I looked at GPU-Z and the intel GPU isn't being utilized with this build at all. Anyone know why this is failing?

Post Reply