Jump to content

Quick Sync crashes ffmpeg


Ceth
 Share

Recommended Posts

I'm testing the hardware decoding feature with 3.0.5768.0.  If I enable Quick Sync, ffmpeg crashes and restarts in an endless loop.  Leaving the hardware decoding set to "Auto" works, but doesn't use Quick Sync.  I have an i5-4690s with the latest Intel drivers.

 

To test that Quick Sync is working, I installed OBS, enabled Quick Sync, and captured the screen and it worked fine. 

https://obsproject.com/download

 

FWIW, I configured OBS to capture the screen and played a video that required transcoding.  Playing the video within chrome on the same computer that is running Emby Server, ffmpeg used about 50% of the CPU to transcode the original file with throttling enabled, while OBS used 8% to capture and stream the screen (preview mode).

 

Here is the transcoding log when Quick Sync transcoding fails:

{"Protocol":"File","Id":"5fd7e054debb9326f3fc6a5aff109c0b","Path":"F:\\path\\to\\filename.avi","Type":"Default","Container":"avi","Name":"SD/H264/AC3","RunTimeTicks":80872880000,"ReadAtNativeFramerate":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"RequiresOpening":false,"RequiresClosing":false,"VideoType":"VideoFile","MediaStreams":[{"Codec":"h264","IsInterlaced":false,"BitRate":992083,"BitDepth":8,"RefFrames":3,"IsDefault":false,"IsForced":false,"Height":288,"Width":688,"AverageFrameRate":23.97602,"RealFrameRate":23.97602,"Profile":"High","Type":"Video","AspectRatio":"2.40:1","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":51,"IsAnamorphic":false,"IsCabac":true},{"Codec":"ac3","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":448000,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":1449455,"RequiredHttpHeaders":{}}

C:\Users\Ceth\AppData\Roaming\Emby-Server\ffmpeg\20150918\ffmpeg.exe -c:v h264_qsv -i file:"F:\path\to\filename.avi" -map_metadata -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -pix_fmt yuv420p -preset superfast -crf 23 -b:v 992083 -maxrate 992083 -bufsize 1984166 -vsync vfr -profile:v high -level 41 -force_key_frames "expr:gte(t,n_forced*3)" -vf "scale=min(iw\,1280):trunc(ow/dar/2)*2" -flags -global_header -sc_threshold 0 -codec:a:0 aac -strict experimental -ac 6 -ab 320000 -af "adelay=1,aresample=async=1" -hls_time 3 -start_number 0 -hls_list_size 0 -y "h:\embytranscode\transcoding-temp\0e28bb208bd703b47c6db8071b6abe91.m3u8"


ffmpeg version N-75410-g58fe57d Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --arch=x86_64 --target-os=mingw32 --cross-prefix=/home/mceuser/ffmpeg-windows-build-helpers/sandbox/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --pkg-config=pkg-config --disable-w32threads --enable-gpl --enable-libsoxr --enable-fontconfig --enable-libass --enable-libutvideo --enable-libbluray --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-libvidstab --enable-libx265 --enable-decklink --extra-libs=-loleaut32 --enable-libx264 --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-frei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable-libxavs --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2 --enable-libdcadec --enable-avisynth --enable-gray --enable-libmfx --extra-libs=-lpsapi --extra-cflags= --enable-static --disable-shared --prefix=/home/mceuser/ffmpeg-windows-build-helpers/sandbox/mingw-w64-x86_64/x86_64-w64-mingw32 --enable-runtime-cpudetect
libavutil 55. 2.100 / 55. 2.100
libavcodec 57. 3.100 / 57. 3.100
libavformat 57. 2.100 / 57. 2.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 5.100 / 6. 5.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Link to comment
Share on other sites

maybe you could try reinstalling your drivers and/or making sure there aren't any driver settings that might be limiting access to the feature for other programs. that's all i can think of. otherwise see if you can reproduce the problem directly from the command line without using emby at all. if it still occurs we might just be at the mercy of an issue in ffmpeg on your system, and hopefully future updates will resolve it.

Link to comment
Share on other sites

I'm experiencing the same ffmpeg crashing issues with quick sync enabled (not auto).

I have a 3rd generation Intel HD Graphics 4000.  Ceth is using the 4th generation Intel HD graphics 4600.

Link to comment
Share on other sites

Very excited with the new quick sync decoding option, but with some issues too.

 

All my .mkv videos created with makeMKV from my Blu-rays give me errors (other videos transcode just fine)

 

here's the trancoding log:

http://xxx.xxx.xxx.xxx:8096/videos/ee93e7c40cab39613bb433be5ff9c17a/stream.ts?DeviceId=5437592a-db98-e640-3548-990656303838&MediaSourceId=ee93e7c40cab39613bb433be5ff9c17a&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&SubtitleStreamIndex=5&VideoBitrate=11928804&AudioBitrate=320000&MaxAudioChannels=6&Level=41&ClientTime=635806957111026647&Profile=high&PlaySessionId=df57e3016a4a4c73b49f55b568d5d475&api_key=f85bd35398024e889915d9aa0db2325e&StartTimeTicks=0

{"Protocol":"File","Id":"ee93e7c40cab39613bb433be5ff9c17a","Path":"\\\\NETWORK\\PATH\\Guardians of the Galaxy (2014)\\Guardians of the Galaxy (2014).mkv","Type":"Default","Container":"mkv","Size":33310350914,"Name":"1080P/H264/DTS-HD MA","RunTimeTicks":72512020000,"ReadAtNativeFramerate":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"RequiresOpening":false,"RequiresClosing":false,"VideoType":"VideoFile","MediaStreams":[{"Codec":"h264","Language":"eng","IsInterlaced":false,"BitRate":36750156,"BitDepth":8,"RefFrames":4,"IsDefault":false,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":23.97602,"RealFrameRate":23.97602,"Profile":"High","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":41,"IsAnamorphic":false,"IsCabac":true},{"Codec":"dca","Language":"eng","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":1536000,"Channels":6,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Profile":"DTS-HD MA","Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"dca","Language":"eng","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":1536000,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Profile":"DTS","Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"eng","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":3,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"spa","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":4,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"por","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":5,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"dan","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":6,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"fin","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":7,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"swe","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":8,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"nor","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":9,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"eng","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":10,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"spa","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":11,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"por","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":12,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"dan","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":13,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"fin","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":14,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"swe","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":15,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"nor","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":16,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"spa","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":17,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"pgssub","Language":"hin","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":18,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":36750156,"RequiredHttpHeaders":{}}

C:\Users\Me\AppData\Roaming\MediaBrowser-Server\ffmpeg\20150918\ffmpeg.exe -fflags +genpts -c:v h264_qsv  -i file:"\\NETWORK\PATH\Guardians of the Galaxy (2014)\Guardians of the Galaxy (2014).mkv" -map 0:0 -map 0:1 -codec:v:0 libx264 -force_key_frames expr:gte(t,n_forced*5) -pix_fmt yuv420p -preset superfast -crf 23 -b:v 11928804 -vsync vfr -profile:v high -level 41 -filter_complex "[0:5]format=yuva444p,scale=1920:1080,lut=u=128:v=128:y=gammaval(.3)[sub] ; [0:0] [sub] overlay" -map_metadata -1 -threads 0 -codec:a:0 aac -strict experimental -ac 6 -ab 320000 -af "aresample=async=1" -y "D:\Emby\Transcoding temp files\transcoding-temp\ac5f18cdd18cf790cca2137c648a83a5.ts"


ffmpeg version N-75410-g58fe57d Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --arch=x86_64 --target-os=mingw32 --cross-prefix=/home/mceuser/ffmpeg-windows-build-helpers/sandbox/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --pkg-config=pkg-config --disable-w32threads --enable-gpl --enable-libsoxr --enable-fontconfig --enable-libass --enable-libutvideo --enable-libbluray --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-libvidstab --enable-libx265 --enable-decklink --extra-libs=-loleaut32 --enable-libx264 --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-frei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable-libxavs --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2 --enable-libdcadec --enable-avisynth --enable-gray --enable-libmfx --extra-libs=-lpsapi --extra-cflags= --enable-static --disable-shared --prefix=/home/mceuser/ffmpeg-windows-build-helpers/sandbox/mingw-w64-x86_64/x86_64-w64-mingw32 --enable-runtime-cpudetect
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  3.100 / 57.  3.100
  libavformat    57.  2.100 / 57.  2.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  5.100 /  6.  5.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
[h264_qsv @ 0000000005961dc0] Error initializing an internal MFX session
[dca @ 0000000005962700] Number of channels changed in DCA decoder (8 -> 6)
[h264_qsv @ 0000000005961dc0] Error initializing an internal MFX session
    Last message repeated 119 times
[matroska,webm @ 000000000594c700] decoding for stream 0 failed
[matroska,webm @ 000000000594c700] Could not find codec parameters for stream 0 (Video: h264 (High), none, 1920x1080): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 000000000594c700] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 000000000594c700] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 000000000594c700] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 000000000594c700] Could not find codec parameters for stream 6 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 000000000594c700] Could not find codec parameters for stream 7 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 000000000594c700] Could not find codec parameters for stream 8 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 000000000594c700] Could not find codec parameters for stream 9 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 000000000594c700] Could not find codec parameters for stream 17 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 000000000594c700] Could not find codec parameters for stream 18 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, matroska,webm, from 'file:\\NETWORK\PATH\Guardians of the Galaxy (2014)\Guardians of the Galaxy (2014).mkv':
  Metadata:
    title           : MARVEL'S GUARDIANS OF THE GALAXY - BLU-RAY
    encoder         : libmakemkv v1.9.0 (1.3.0/1.4.1) win(x64-release)
    creation_time   : 2014-12-08 19:31:58
  Duration: 02:00:51.20, start: 0.000000, bitrate: 36750 kb/s
    Chapter #0:0: start 0.000000, end 245.703792
    Metadata:
      title           : Chapter 01
    Chapter #0:1: start 245.703792, end 681.806125
    Metadata:
      title           : Chapter 02
    Chapter #0:2: start 681.806125, end 921.712458
    Metadata:
      title           : Chapter 03
    Chapter #0:3: start 921.712458, end 1254.419833
    Metadata:
      title           : Chapter 04
    Chapter #0:4: start 1254.419833, end 1631.212917
    Metadata:
      title           : Chapter 05
    Chapter #0:5: start 1631.212917, end 2038.828458
    Metadata:
      title           : Chapter 06
    Chapter #0:6: start 2038.828458, end 2668.248917
    Metadata:
      title           : Chapter 07
    Chapter #0:7: start 2668.248917, end 3053.008292
    Metadata:
      title           : Chapter 08
    Chapter #0:8: start 3053.008292, end 3317.564250
    Metadata:
      title           : Chapter 09
    Chapter #0:9: start 3317.564250, end 3585.206625
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 3585.206625, end 3966.921292
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 3966.921292, end 4486.023208
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 4486.023208, end 4940.644042
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 4940.644042, end 5189.726208
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 5189.726208, end 5423.876792
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 5423.876792, end 5758.377625
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 5758.377625, end 6046.749042
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 6046.749042, end 6455.365583
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 6455.365583, end 6796.623167
    Metadata:
      title           : Chapter 19
    Chapter #0:19: start 6796.623167, end 7210.786917
    Metadata:
      title           : Chapter 20
    Chapter #0:20: start 7210.786917, end 7251.202292
    Metadata:
      title           : Chapter 21
    Stream #0:0(eng): Video: h264 (High), none, 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc
    Stream #0:1(eng): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), fltp (default)
    Metadata:
      title           : Surround 7.1
    Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : Surround 5.1
    Stream #0:3(eng): Subtitle: hdmv_pgs_subtitle
    Stream #0:4(spa): Subtitle: hdmv_pgs_subtitle
    Stream #0:5(por): Subtitle: hdmv_pgs_subtitle
    Stream #0:6(dan): Subtitle: hdmv_pgs_subtitle
    Stream #0:7(fin): Subtitle: hdmv_pgs_subtitle
    Stream #0:8(swe): Subtitle: hdmv_pgs_subtitle
    Stream #0:9(nor): Subtitle: hdmv_pgs_subtitle
    Stream #0:10(eng): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Stream #0:11(spa): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Stream #0:12(por): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Stream #0:13(dan): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Stream #0:14(fin): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Stream #0:15(swe): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Stream #0:16(nor): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Stream #0:17(spa): Subtitle: hdmv_pgs_subtitle
    Stream #0:18(hin): Subtitle: hdmv_pgs_subtitle
[matroska,webm @ 000000000594c700] sub2video: using 1920x1080 canvas
[buffer @ 00000000066a8680] Unable to parse option value "-1" as pixel format
    Last message repeated 1 times
[buffer @ 00000000066a8680] Error setting option pix_fmt to value -1.
[graph 0 input from stream 0:0 @ 0000000005e77c40] Error applying options to the filter.

And here is my server log:

http://paste2.org/1K9fLjxc

 

tell me if you need a file sample.

Link to comment
Share on other sites

This line says it all:

 

"[h264_qsv @ 0000000005961dc0] Error initializing an internal MFX session"

 

ffmpeg can't initialize an QS. This usually means that the driver that is installed either didn't include the MSDK, or the min version of the MSDK that ffmpeg is trying to initialize is not registered properly.

 

I had this happen with an IVB system where the way I fixed it was to install an older driver. You can install a newer one after, the important bit is that the registry has a dispatch key for your system here: HKEY_LOCAL_MACHINE\SOFTWARE\Intel\MediaSDK\Dispatch

Link to comment
Share on other sites

This line says it all:

 

"[h264_qsv @ 0000000005961dc0] Error initializing an internal MFX session"

 

ffmpeg can't initialize an QS. This usually means that the driver that is installed either didn't include the MSDK, or the min version of the MSDK that ffmpeg is trying to initialize is not registered properly.

 

I had this happen with an IVB system where the way I fixed it was to install an older driver. You can install a newer one after, the important bit is that the registry has a dispatch key for your system here: HKEY_LOCAL_MACHINE\SOFTWARE\Intel\MediaSDK\Dispatch

 

Good stuff, thanks. Do you know if there's an ffmpeg command that can be used to test this, as opposed to just having to try a real video and fail?

Link to comment
Share on other sites

I downloaded and installed the latest Media SDK from Intel, but the problem remains.  The registry key exists.

https://registrationcenter.intel.com/en/forms/?ProductID=2329

 

When I execute the command manually, it crashes with "ffmpeg.exe has stopped responding" at the libpostproc step seen in the log above.  Quick Sync works when playing Live TV so it looks like it is having problems with the type of file.  Almost all of my files are H.264 inside of an avi container (bad, I know) which is why they need to be transcoded in the first place.  I'm going to try some more file types/formats to see what is causing the problem.

 

One feature request, which shouldn't be hard to implement because you are 90% of the way there with "Folder Sync":  It would be a neat feature to analyze the library and then create a queue of files to be converted because they aren't in an ideal format or the bitrate is excessive for the resolution.  That would ensure that the playback experience is the best possible without a lot of hassle for the user.

Link to comment
Share on other sites

I tried rolling back to an earlier video driver version, but no luck. Ended up upgrading again to the latest version.

Running the intel in virtu-D as an extended secondary display to my primary GPU.

Here is the dxdiag log, not sure if this helps at all.

 

Card name: Intel® HD Graphics 4000
       Manufacturer: Intel Corporation
          Chip type: Intel® HD Graphics Family
           DAC type: Internal
         Device Key: Enum\PCI\VEN_8086&DEV_0162&SUBSYS_21111462&REV_09
     Display Memory: 1696 MB
   Dedicated Memory: 64 MB
      Shared Memory: 1632 MB
       Current Mode: 1024 x 768 (32 bit) (60Hz)
        Driver Name: igdumdim64.dll,igd10iumd64.dll,igd10iumd64.dll,igdumdim32,igd10iumd32,igd10iumd32
Driver File Version: 10.18.0010.4226 (English)
     Driver Version: 10.18.10.4226
        DDI Version: 11
       Driver Model: WDDM 1.1
  Driver Attributes: Final Retail
   Driver Date/Size: 6/4/2015 22:46:28, 10948400 bytes
        WHQL Logo'd: Yes
    WHQL Date Stamp: 
  Device Identifier: {D7B78E66-4222-11CF-5067-1B01B4C2C735}
          Vendor ID: 0x8086
          Device ID: 0x0162
          SubSys ID: 0x21111462
        Revision ID: 0x0009
 Driver Strong Name: oem24.inf:IntelGfx.NTamd64.6.1:iIVBD_w7:10.18.10.4226:pci\ven_8086&dev_0162
     Rank Of Driver: 00E62001
        Video Accel: ModeMPEG2_A ModeMPEG2_C ModeWMV9_C ModeVC1_C 
        D3D9 Overlay: Supported
            DXVA-HD: Supported
       DDraw Status: Enabled
         D3D Status: Enabled
         AGP Status: Enabled
Link to comment
Share on other sites

we're probably just going to have to limit it to basic situations and containers like mp4 and mkv that we have confirmed and tested. otherwise the number of reports like this are just going to be painful. 

Link to comment
Share on other sites

Just to report in mine seems to work shows qs and hardware acceleration in the logs but cpu usage is where it was before the switch. 

Link to comment
Share on other sites

I would think the CPU would be near idle if the GPU was doing all the transcoding otherwise, whats the point?

 

The internet joke about quicksync is that you know its working when the quality is really poor...  So perhaps quicksnyc is calibrated to a very specific output for its hardware encoding to work (bitrate, format, etc).

Mabye there is a certain setting in emby of ffmpeg that needs to be set correctly for quicksync to actually work?  That could be why it works for some and not others.  I dont know, just throwing it out there...

Link to comment
Share on other sites

I would think the CPU would be near idle if the GPU was doing all the transcoding otherwise, whats the point?

 

The internet joke about quicksync is that you know its working when the quality is really poor...  So perhaps quicksnyc is calibrated to a very specific output for its hardware encoding to work (bitrate, format, etc).

Mabye there is a certain setting in emby of ffmpeg that needs to be set correctly for quicksync to actually work?  That could be why it works for some and not others.  I dont know, just throwing it out there...

 

With out a structural redesign ffmpeg will never achieve the full potential of QS, because it does not keep the surfaces entirely in GPU. That said, with high bitrate content you should see a decrease total CPU consumption over the lifetime of the transcode using just QS for decode and a significant decrease when we are able to use HWA decode and encode. AFIAK, ffmpeg does not implement HWA VPP so these features will require a surface copy to system RAM, CPU based VPP (DI, resize, etc), surface copy back to GPU RAM.

 

WRT to your other statement regarding encoding quality. I have not found that to generally be the case. There are scenarios where x264 can produce better output, but these use cases are not suitable for this application (i.e. we aren't creating the master).

 

For those who are interested, I did a write up around this when Haswell came out. It should be noted that this was pre-Lookahead as well, so the quality potential has only gotten better.

  • Like 2
Link to comment
Share on other sites

With out a structural redesign ffmpeg will never achieve the full potential of QS, because it does not keep the surfaces entirely in GPU. That said, with high bitrate content you should see a decrease total CPU consumption over the lifetime of the transcode using just QS for decode and a significant decrease when we are able to use HWA decode and encode. AFIAK, ffmpeg does not implement HWA VPP so these features will require a surface copy to system RAM, CPU based VPP (DI, resize, etc), surface copy back to GPU RAM.

 

WRT to your other statement regarding encoding quality. I have not found that to generally be the case. There are scenarios where x264 can produce better output, but these use cases are not suitable for this application (i.e. we aren't creating the master).

 

For those who are interested, I did a write up around this when Haswell came out. It should be noted that this was pre-Lookahead as well, so the quality potential has only gotten better.

 

As always thanks for the insight on this. I just learned a few things :)

Link to comment
Share on other sites

Interesting.  For transcoding, would it be better to use something other than ffmpeg?  I used OBS (link above) for testing and it seemed to work well.  It's designed for streaming, is open source and works on Windows, Linux, and OSX, and already supports QSV and NVENC.  Of what little I tested it, it used about 1/6th the CPU that ffmpeg did.

Link to comment
Share on other sites

No, nothing so involved.  On the computer running Emby server, I played a video within chrome that required transcoding, and then used OBS to capture the screen.  ffmpeg required 50% of the CPU to transcode the original file, while OBS required 8% to capture the screen (30 fps).  This was in "preview" mode so it's possible it wasn't doing everything necessary to create a usable stream.

Link to comment
Share on other sites

If you want to see the potential for QS, you can test using QSTranscode. The only time it does a GPU->SYSTEM copy is if you try to burn in PGS.

Link to comment
Share on other sites

If you want to see the potential for QS, you can test using QSTranscode. The only time it does a GPU->SYSTEM copy is if you try to burn in PGS.

 

So while this does provide some pretty cool results (7-15% cpu on mine) however i would think the results in emby would be even better as there is no FPS limit using this method and I would think EMBY would get a couple minutes of buffer and then would follow the speed of watching the media file so in my case it would be 1-5 minutes of 7-15% cpu and then likely 1-2% usage here and there which would be a huge difference between what i get today which is 90+% for a couple of minutes and then 25-30% until the movie ends.

Link to comment
Share on other sites

it isn't that simple. ffmpeg brings a lot of features to the table such as the ability to support just about any input protocol, and just about any output protocol. In a client server system such as this where each app has it's own unique requirements, we really need all those things. so the idea of just plugging in something else because it's a little faster isn't really realistic unless it can satisfy everything that we need.

Link to comment
Share on other sites

it isn't that simple. ffmpeg brings a lot of features to the table such as the ability to support just about any input protocol, and just about any output protocol. In a client server system such as this where each app has it's own unique requirements, we really need all those things. so the idea of just plugging in something else because it's a little faster isn't really realistic unless it can satisfy everything that we need.

I don't fully understand QSTranscode, but it appears to use ffmpeg for container/codec support. http://sourceforge.net/projects/qstranscode/

 

To me this makes it more of an abstraction layer that can often force QS transcoding, which would be more or less what we need if it could be added with a fallback

Link to comment
Share on other sites

babgvant is the developer of QSTranscode so if it isn't currently capable of doing everything that Emby needs, he might be persuaded to add whatever is necessary.

 

Getting files into the best format (either through transcoding or conversion) seems to be the biggest technological hangup, so anything that improves that experience will improve the software immensely.  For Live TV, transcoding is the only option, so streamlining the process is especially important for that feature.

Link to comment
Share on other sites

I don't fully understand QSTranscode, but it appears to use ffmpeg for container/codec support. http://sourceforge.net/projects/qstranscode/

 

To me this makes it more of an abstraction layer that can often force QS transcoding, which would be more or less what we need if it could be added with a fallback

 

Theoretically, anything ffmpeg can do QSTranscode could do since it leverages ffmpeg for most of the non-QS lifting. The problem is that it doesn't right now (non-QS encoding would be a big blocker).

 

Unfortunately I can't commit to matching the breadth of ffmpeg, it is a good general cross-platform solution. QS support is still developing there so IMO it's one of those things were we need to be patient and help steer their development process (patches, testing, etc).

  • Like 1
Link to comment
Share on other sites

If I understand what you are saying, QSTranscode can't do fallback if QS hardware doesn't exist?  If that's the case, it would only be a matter of allowing the user to choose the QS profile (hardware) or the ffmpeg profile (generic) when configuring Emby server.  This is how it is set up now, except with QSV specific parameters sent to ffmpeg.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...