MSattler 390 Posted March 27, 2017 Posted March 27, 2017 All, What is the current state of using GPU Transcoding for h265 content? I can see in the logs that h264_qsv is being called, but the cpu utilization is higher than with h264. In this case are we decoding with cpu, and encoding with gpu? Is this due to not being able to tell the difference between Intel GPU's which do support h265 transcoding, such as the i7-6600, and those that cannot? If that is the case is there any way we can have an admin override so that the GPU can be use for decoding and encoding? Thanks!
Luke 42078 Posted March 27, 2017 Posted March 27, 2017 No, we handle both decoding and encoding with the gpu when possible.
MSattler 390 Posted March 27, 2017 Author Posted March 27, 2017 (edited) No, we handle both decoding and encoding with the gpu when possible. B:\Users\Administrator\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe -i file:"\\tower2\TV-Series\Breaking Bad\Season 3\Breaking.Bad.S03E01.mkv" -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -force_key_frames "expr:gte(t,n_forced*5)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -preset 7 -look_ahead 0 -b:v 397442 -maxrate 397442 -bufsize 794884 -vsync -1 -profile:v high -level 4.1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 copy -y "B:\Users\Administrator\AppData\Roaming\Emby-Server\transcoding-temp\transcoding-temp\fed67909d3f1faf4f13c4642e2f1fe7e.mkv" ffmpeg version N-79277-g0c90b2e Copyright © 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 20.100 / 55. 20.100 libavcodec 57. 34.100 / 57. 34.100 libavformat 57. 32.100 / 57. 32.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 41.100 / 6. 41.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, matroska,webm, from 'file:\\tower2\TV-Series\Breaking Bad\Season 3\Breaking.Bad.S03E01.mkv': Metadata: title : encoder : libebml v0.7.8 + libmatroska v0.8.1 creation_time : 2016-04-20 21:35:02 Duration: 00:47:12.67, start: 0.000000, bitrate: 2510 kb/s Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x1080 [sAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn, 29.97 tbc (default) Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s Output #0, matroska, to 'B:\Users\Administrator\AppData\Roaming\Emby-Server\transcoding-temp\transcoding-temp\fed67909d3f1faf4f13c4642e2f1fe7e.mkv': Metadata: encoder : Lavf57.32.100 Stream #0:0: Video: h264 (h264_qsv) (H264 / 0x34363248), nv12, 640x360 [sAR 1:1 DAR 16:9], q=2-31, 397 kb/s, 29.97 fps, 1k tbn, 29.97 tbc (default) Metadata: encoder : Lavc57.34.100 h264_qsv Side data: cpb: bitrate max/min/avg: 397442/0/397442 buffer size: 794884 vbv_delay: -1 Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), 448 kb/s Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_qsv)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 129 fps=0.0 q=-0.0 size= 420kB time=00:00:04.54 bitrate= 756.7kbits/s speed=9.09x frame= 254 fps=254 q=-0.0 size= 870kB time=00:00:08.80 bitrate= 809.7kbits/s speed= 8.8x Is it doing both here? Thanks! Edited March 27, 2017 by MSattler
Waldonnis 148 Posted March 27, 2017 Posted March 27, 2017 B:\Users\Administrator\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe -i file:"\\tower2\TV-Series\Breaking Bad\Season 3\Breaking.Bad.S03E01.mkv" -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -force_key_frames "expr:gte(t,n_forced*5)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -preset 7 -look_ahead 0 -b:v 397442 -maxrate 397442 -bufsize 794884 -vsync -1 -profile:v high -level 4.1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 copy -y "B:\Users\Administrator\AppData\Roaming\Emby-Server\transcoding-temp\transcoding-temp\fed67909d3f1faf4f13c4642e2f1fe7e.mkv" ..... Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_qsv)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 129 fps=0.0 q=-0.0 size= 420kB time=00:00:04.54 bitrate= 756.7kbits/s speed=9.09x frame= 254 fps=254 q=-0.0 size= 870kB time=00:00:08.80 bitrate= 809.7kbits/s speed= 8.8x Is it doing both here? It's definitely decoding with the CPU rather than the iGPU in this case. ffmpeg isn't being told to use the hardware decoder on the command line and the stream mapping shows it as well.
Luke 42078 Posted March 27, 2017 Posted March 27, 2017 Is that the entire transcoding log? there should be more information at the top. Thanks !
Luke 42078 Posted March 27, 2017 Posted March 27, 2017 I just did a quick test and got the expected/desired result: ffmpeg.exe -c:v h264_qsv -i file:"Family Guy - 15x17 - Peter's Lost Youth HDTV-720p.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -preset 7 -look_ahead 0 -b:v 616000 -maxrate 616000 -bufsize 1232000 -vsync -1 -profile:v high -level 4.1 -level 41 -force_key_frames "expr:gte(t,n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,720)/2)*2:trunc(ow/dar/2)*2" -copyts -codec:a:0 aac -strict experimental -ac 6 -ab 384000 -af "adelay=1,aresample=async=1" -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "8455c09be66309e6357664d026c95e2e.m3u8" -y "8455c09be66309e6357664d026c95e2e%d.ts"
MSattler 390 Posted March 27, 2017 Author Posted March 27, 2017 Is that the entire transcoding log? there should be more information at the top. Thanks ! https://someurl:8920/videos/62c5f947ceea621c1fa50f4d3c9388d7/stream.mkv?DeviceId=9b86d242e9f3fe6f&MediaSourceId=62c5f947ceea621c1fa50f4d3c9388d7&VideoCodec=h264&AudioCodec=mp3,aac,ac3&AudioStreamIndex=1&VideoBitrate=397442&AudioBitrate=448000&Level=41&Profile=high&PlaySessionId=f5f2d15e54f94068b9e7a762ab5d06a8&api_key=fc9f22f64f2444d684683a376507ffc0&CopyTimestamps=false&TranscodingMaxAudioChannels=2&EnableSubtitlesInManifest=false&Tag=89b7194a9c4fcd16594fdd97ec7d842a&RequireAvc=false {"Protocol":"File","Id":"62c5f947ceea621c1fa50f4d3c9388d7","Path":"\\\\tower2\\TV-Series\\Breaking Bad\\Season 3\\Breaking.Bad.S03E01.mkv","Type":"Default","Container":"mkv","Name":"1080P/HEVC/AC3","IsRemote":false,"ETag":"89b7194a9c4fcd16594fdd97ec7d842a","RunTimeTicks":28326720000,"ReadAtNativeFramerate":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"SupportsProbing":true,"VideoType":"VideoFile","MediaStreams":[{"Codec":"hevc","TimeBase":"1/1000","CodecTimeBase":"1001/30000","IsInterlaced":false,"BitRate":2510331,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":29.97003,"RealFrameRate":29.97003,"Profile":"Main","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":150,"IsAnamorphic":false},{"Codec":"ac3","Language":"eng","TimeBase":"1/1000","CodecTimeBase":"1/48000","DisplayTitle":"Eng Dolby Digital 5.1","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,"IsAnamorphic":false}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":2958331,"RequiredHttpHeaders":{}} B:\Users\Administrator\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe -i file:"\\tower2\TV-Series\Breaking Bad\Season 3\Breaking.Bad.S03E01.mkv" -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -force_key_frames "expr:gte(t,n_forced*5)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -preset 7 -look_ahead 0 -b:v 397442 -maxrate 397442 -bufsize 794884 -vsync -1 -profile:v high -level 4.1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 copy -y "B:\Users\Administrator\AppData\Roaming\Emby-Server\transcoding-temp\transcoding-temp\fed67909d3f1faf4f13c4642e2f1fe7e.mkv" ffmpeg version N-79277-g0c90b2e Copyright © 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 20.100 / 55. 20.100 libavcodec 57. 34.100 / 57. 34.100 libavformat 57. 32.100 / 57. 32.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 41.100 / 6. 41.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, matroska,webm, from 'file:\\tower2\TV-Series\Breaking Bad\Season 3\Breaking.Bad.S03E01.mkv': Metadata: title : encoder : libebml v0.7.8 + libmatroska v0.8.1 creation_time : 2016-04-20 21:35:02 Duration: 00:47:12.67, start: 0.000000, bitrate: 2510 kb/s Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x1080 [sAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn, 29.97 tbc (default) Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s Output #0, matroska, to 'B:\Users\Administrator\AppData\Roaming\Emby-Server\transcoding-temp\transcoding-temp\fed67909d3f1faf4f13c4642e2f1fe7e.mkv': Metadata: encoder : Lavf57.32.100 Stream #0:0: Video: h264 (h264_qsv) (H264 / 0x34363248), nv12, 640x360 [sAR 1:1 DAR 16:9], q=2-31, 397 kb/s, 29.97 fps, 1k tbn, 29.97 tbc (default) Metadata: encoder : Lavc57.34.100 h264_qsv Side data: cpb: bitrate max/min/avg: 397442/0/397442 buffer size: 794884 vbv_delay: -1 Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), 448 kb/s Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_qsv)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 129 fps=0.0 q=-0.0 size= 420kB time=00:00:04.54 bitrate= 756.7kbits/s speed=9.09x frame= 254 fps=254 q=-0.0 size= 870kB time=00:00:08.80 bitrate= 809.7kbits/s speed= 8.8x frame= 374 fps=249 q=-0.0 size= 1279kB time=00:00:12.80 bitrate= 818.9kbits/s speed=8.53x
Luke 42078 Posted March 27, 2017 Posted March 27, 2017 Thanks. The input is hevc. Does QuickSync have a hardware decoder for that? I haven't checked into that yet. Currently the QuickSync decoder is used for h264, vc1 and mpeg2.
Luke 42078 Posted March 27, 2017 Posted March 27, 2017 Ok yes, there is hevc_qsv So we can add that. Thanks.
MSattler 390 Posted March 27, 2017 Author Posted March 27, 2017 Ok yes, there is hevc_qsv So we can add that. Thanks. Thanks! Let me know when it's ready to test in beta and I can provide feedback!
Waldonnis 148 Posted March 27, 2017 Posted March 27, 2017 Thanks. The input is hevc. Does QuickSync have a hardware decoder for that? I haven't checked into that yet. Currently the QuickSync decoder is used for h264, vc1 and mpeg2.6th gen and later should. Skylake cannot handle Main10, though (just Main, so 8bit). Kaby Lake and related can do Main10, and I think VP9 as well.
MSattler 390 Posted March 27, 2017 Author Posted March 27, 2017 6th gen and later should. Skylake cannot handle Main10, though (just Main, so 8bit). Kaby Lake and related can do Main10, and I think VP9 as well. Does the GPU respond back to what it can use, or is there a way to probe the gpu to set what can be done? If not, it may make sense to do some sort of mapping of of each of the versions and what can be used.
Luke 42078 Posted March 27, 2017 Posted March 27, 2017 Right now we probe ffmpeg for what it supports, we don't also cross-check that against what the gpu supports, although that's a possibility for the future.
MSattler 390 Posted March 27, 2017 Author Posted March 27, 2017 As long as it works for me I'll be happy to test it. Just want to make sure that it doesn't break anything for owners of older gpu's.
Waldonnis 148 Posted March 28, 2017 Posted March 28, 2017 As long as it works for me I'll be happy to test it. Just want to make sure that it doesn't break anything for owners of older gpu's. I'm not sure if ffmpeg has any options to really "detect" hardware decoders' profile support level and report them back outside of maybe high loglevels or making assumptions based on the encoders' pixel format lists, but the documentation does point to an "auto" setting for -hwaccel. You could try running it manually with -hwaccel auto (before the first -i on the command line, see below for an abbreviated example) and see if you see a decrease in processor load, but it's hard to tell when it's actually working from the ffmpeg output text unless you increase the loglevel and know what to look for. It's generally recommended to force it to be single-threaded when hardware decoding for a bunch of reasons that I won't get into here, hence the -threads argument below. ffmpeg -hwaccel auto -threads 1 -i infile.mkv (other options and such) I actually force dxva2 (Windows-only) hardware decoding in a few of my decoding-centric ffmpeg scripts and it makes a huge difference in system load when it can be used (my hardware has no HEVC hardware support, but I do more with h.264 still anyway). It does take a bit longer, though, since the operations are single-threaded. Auto may be the safest setting, as the docs claim it'll get ignored anyway if the hardware doesn't report support for the specific codec/profile. Worth a try in a beta build and much easier to maintain than trying to figure out what generation of CPU/GPU supports what. Given my spotty history with hardware decoding, I'd recommend separating that out as a distinct option rather than grouping it with hardware encoding, so you could enable either one without having to enable both in case of issues specific to en- or decoding.
MSattler 390 Posted March 28, 2017 Author Posted March 28, 2017 I'm not sure if ffmpeg has any options to really "detect" hardware decoders' profile support level and report them back outside of maybe high loglevels or making assumptions based on the encoders' pixel format lists, but the documentation does point to an "auto" setting for -hwaccel. You could try running it manually with -hwaccel auto (before the first -i on the command line, see below for an abbreviated example) and see if you see a decrease in processor load, but it's hard to tell when it's actually working from the ffmpeg output text unless you increase the loglevel and know what to look for. It's generally recommended to force it to be single-threaded when hardware decoding for a bunch of reasons that I won't get into here, hence the -threads argument below. ffmpeg -hwaccel auto -threads 1 -i infile.mkv (other options and such) I actually force dxva2 (Windows-only) hardware decoding in a few of my decoding-centric ffmpeg scripts and it makes a huge difference in system load when it can be used (my hardware has no HEVC hardware support, but I do more with h.264 still anyway). It does take a bit longer, though, since the operations are single-threaded. Auto may be the safest setting, as the docs claim it'll get ignored anyway if the hardware doesn't report support for the specific codec/profile. Worth a try in a beta build and much easier to maintain than trying to figure out what generation of CPU/GPU supports what. Given my spotty history with hardware decoding, I'd recommend separating that out as a distinct option rather than grouping it with hardware encoding, so you could enable either one without having to enable both in case of issues specific to en- or decoding. So yeah it looks like 10-bit HEVC is supported only in Kabylake with the new ix-7xxx series procs. For those looking to upgrade from the Skylake z170 boards, you need to go to z270 to get 10bit HEVC decoding to work. Found this: 4K content streaming: 4K streaming is limited to Z270 boards and Kaby Lake CPUs, either because Intel only implemented full support for Microsoft’s PlayReady 3.0 in its latest chips, or because only the 7th generation family supports hardware accelerated decode for 10-bit HEVC. 4K playback also requires at least the Anniversary Update of Windows 10 and is currently only available via Microsoft Edge. 1
Waldonnis 148 Posted March 28, 2017 Posted March 28, 2017 (edited) So yeah it looks like 10-bit HEVC is supported only in Kabylake with the new ix-7xxx series procs. For those looking to upgrade from the Skylake z170 boards, you need to go to z270 to get 10bit HEVC decoding to work. Found this: 4K content streaming: 4K streaming is limited to Z270 boards and Kaby Lake CPUs, either because Intel only implemented full support for Microsoft’s PlayReady 3.0 in its latest chips, or because only the 7th generation family supports hardware accelerated decode for 10-bit HEVC. 4K playback also requires at least the Anniversary Update of Windows 10 and is currently only available via Microsoft Edge. Decoding and encoding HEVC Main10 should work fine on Kaby Lake even with older chipsets, but streaming 4k content from some commercial content providers requires PlayReady 3.0 support, which in turn requires a KL/Z270 chipset combo (only Netflix currently requires this, but others will likely hop on the wagon in the future if/when 4k streaming to PCs "catches on"). I've been waiting to see whether dGPU manufacturers make efforts to implement PlayReady 3.0 support in the near future as well, but that's another matter. It's likely inevitable, but there isn't as much of a vested interest for them to do so compared to Intel. Either way, using the iGPU for encoding/decoding in 7th gen Intel CPUs isn't limited at all by chipset or OS/browser choice for Emby's uses. PlayReady 3.0 is only really DRM protection and meant to stop pirating streamed content through various interception methods rather than limiting playback/encoding in general. Treat it like Wildvine on the SHIELD TV platform - it's there and required by apps like Amazon and Netflix, but dormant otherwise. Edited March 28, 2017 by Waldonnis
MSattler 390 Posted March 28, 2017 Author Posted March 28, 2017 Decoding and encoding HEVC Main10 should work fine on Kaby Lake even with older chipsets, but streaming 4k content from some commercial content providers requires PlayReady 3.0 support, which in turn requires a KL/Z270 chipset combo (only Netflix currently requires this, but others will likely hop on the wagon in the future if/when 4k streaming to PCs "catches on"). I've been waiting to see whether dGPU manufacturers make efforts to implement PlayReady 3.0 support in the near future as well, but that's another matter. It's likely inevitable, but there isn't as much of a vested interest for them to do so compared to Intel. Either way, using the iGPU for encoding/decoding in 7th gen Intel CPUs isn't limited at all by chipset or OS/browser choice for Emby's uses. PlayReady 3.0 is only really DRM protection and meant to stop pirating streamed content through various interception methods rather than limiting playback/encoding in general. Treat it like Wildvine on the SHIELD TV platform - it's there and required by apps like Amazon and Netflix, but dormant otherwise. Ahh, good to know! So now.... to see if the Dell XPS 8900 I have will take the i7-6700 - i7-7700 upgrade =)
MSattler 390 Posted March 30, 2017 Author Posted March 30, 2017 So this is not working on Android Phone or the web client via the latest beta. Only get audio, no video.
MSattler 390 Posted March 30, 2017 Author Posted March 30, 2017 http://192.168.1.125:8096/emby/videos/62c5f947ceea621c1fa50f4d3c9388d7/hls1/main/0.ts?DeviceId=97e36a89357d39875506542cfc8dd5b0df18c403&MediaSourceId=62c5f947ceea621c1fa50f4d3c9388d7&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=1116000&AudioBitrate=384000&Level=51&Profile=high&PlaySessionId=92c76b8d441548979b4260596c1d5598&api_key=c92ea59aeaf04a81b965cd5d7b9b3402&CopyTimestamps=false&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&Tag=89b7194a9c4fcd16594fdd97ec7d842a&RequireAvc=true&RequireNonAnamorphic=false&DeInterlace=false&SegmentContainer=ts&MinSegments=2 {"Protocol":"File","Id":"62c5f947ceea621c1fa50f4d3c9388d7","Path":"\\\\tower2\\TV-Series\\Breaking Bad\\Season 3\\Breaking.Bad.S03E01.mkv","Type":"Default","Container":"mkv","Name":"1080P/HEVC/AC3","IsRemote":false,"ETag":"89b7194a9c4fcd16594fdd97ec7d842a","RunTimeTicks":28326719488,"ReadAtNativeFramerate":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"SupportsProbing":true,"VideoType":"VideoFile","MediaStreams":[{"Codec":"hevc","TimeBase":"1/1000","CodecTimeBase":"1001/30000","IsInterlaced":false,"AllowStreamCopy":true,"BitRate":2510331,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":29.97003,"RealFrameRate":29.97003,"Profile":"Main","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":150,"IsAnamorphic":false},{"Codec":"ac3","Language":"eng","TimeBase":"1/1000","CodecTimeBase":"1/48000","DisplayTitle":"Eng Dolby Digital 5.1","IsInterlaced":false,"AllowStreamCopy":true,"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,"IsAnamorphic":false}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":2958331,"RequiredHttpHeaders":{}} B:\Users\Administrator\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe -c:v hevc_qsv -i file:"\\tower2\TV-Series\Breaking Bad\Season 3\Breaking.Bad.S03E01.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -preset 7 -look_ahead 0 -b:v 1116000 -maxrate 1116000 -bufsize 2232000 -vsync -1 -profile:v high -level 4.1 -level 41 -force_key_frames "expr:gte(t,n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,1280)/2)*2:trunc(ow/dar/2)*2" -copyts -codec:a:0 aac -strict experimental -ac 6 -ab 384000 -af "adelay=1,aresample=async=1" -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "B:\Users\Administrator\AppData\Roaming\Emby-Server\transcoding-temp\transcoding-temp\f777ae25cb0703b27ef755fba6562431.m3u8" -y "B:\Users\Administrator\AppData\Roaming\Emby-Server\transcoding-temp\transcoding-temp\f777ae25cb0703b27ef755fba6562431%d.ts" ffmpeg version N-79277-g0c90b2e Copyright © 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 20.100 / 55. 20.100 libavcodec 57. 34.100 / 57. 34.100 libavformat 57. 32.100 / 57. 32.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 41.100 / 6. 41.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 [hevc_qsv @ 0000000000925800] Could not load the requested plugin: 15dd936825ad475ea34e35f3f54217a6 Input #0, matroska,webm, from 'file:\\tower2\TV-Series\Breaking Bad\Season 3\Breaking.Bad.S03E01.mkv': Metadata: title : encoder : libebml v0.7.8 + libmatroska v0.8.1 creation_time : 2016-04-20 21:35:02 Duration: 00:47:12.67, start: 0.000000, bitrate: 2510 kb/s Stream #0:0: Video: hevc, nv12, 1920x1080, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default) Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s Output #0, segment, to 'B:\Users\Administrator\AppData\Roaming\Emby-Server\transcoding-temp\transcoding-temp\f777ae25cb0703b27ef755fba6562431%d.ts': Metadata: encoder : Lavf57.32.100 Stream #0:0: Video: h264 (h264_qsv), nv12, 1280x720 [sAR 1:1 DAR 16:9], q=2-31, 1116 kb/s, 29.97 fps, 90k tbn, 29.97 tbc (default) Metadata: encoder : Lavc57.34.100 h264_qsv Side data: cpb: bitrate max/min/avg: 1116000/0/1116000 buffer size: 2232000 vbv_delay: -1 Stream #0:1: Audio: aac (LC), 48000 Hz, 5.1, fltp, 384 kb/s Metadata: encoder : Lavc57.34.100 aac Stream mapping: Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> h264 (h264_qsv)) Stream #0:1 -> #0:1 (ac3 (native) -> aac (native)) Press [q] to stop, [?] for help [hevc_qsv @ 0000000000943580] Could not load the requested plugin: 15dd936825ad475ea34e35f3f54217a6 Error while decoding stream #0:0: Function not implemented [hevc_qsv @ 0000000000943580] Decode header error -3 Error while decoding stream #0:0: Function not implemented [hevc_qsv @ 0000000000943580] Decode header error -3 Error while decoding stream #0:0: Function not implemented
Waldonnis 148 Posted March 30, 2017 Posted March 30, 2017 Can you try a newer ffmpeg build as a test? A few changes were merged into ffmpeg this month that involve QuickSync. I haven't looked at the full commit history to see if any of them may apply here, but there were some changes to logging/error messages that might help in figuring this out...and one change involving pixel formats (haven't looked it over so it may be unrelated). The plugin id listed is for the hevc_qsv decoder for sure, though. Increasing the loglevel may reveal some additional info on what it's trying to do - you'd have to run the ffmpeg command manually to do this, though, to add a -loglevel argument (if you're up for it).
MSattler 390 Posted March 30, 2017 Author Posted March 30, 2017 Can you try a newer ffmpeg build as a test? A few changes were merged into ffmpeg this month that involve QuickSync. I haven't looked at the full commit history to see if any of them may apply here, but there were some changes to logging/error messages that might help in figuring this out...and one change involving pixel formats (haven't looked it over so it may be unrelated). The plugin id listed is for the hevc_qsv decoder for sure, though. Increasing the loglevel may reveal some additional info on what it's trying to do - you'd have to run the ffmpeg command manually to do this, though, to add a -loglevel argument (if you're up for it). Does this help? PS B:\Users\Administrator> B:\Users\Administrator\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe -c:v hevc_qsv -i file:"\\tower2\TV-Series\Breaking Bad\Season 3\Breaking.Bad.S03E01.mkv" -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_q sv -force_key_frames "expr:gte(t,n_forced*5)" -vf "scale=trunc(min(max(iw\,ih*dar)\,720)/2)*2:trunc(ow/dar/2)*2" -preset 7 -look_ahead 0 -b:v 552001 -maxrate 552001 -bufsize 1104002 -vsync -1 -profile:v high -level 4.1 -level 41 -map_metada ta -1 -map_chapters -1 -threads 0 -loglevel verbose -codec:a:0 copy -y "B:\Users\Administrator\AppData\Roaming\Emby-Serv er\transcoding-temp\transcoding-temp\50d9b85fadb80cb84b8a70fe93d61258.mkv" > results.txt ffmpeg version N-79277-g0c90b2e Copyright © 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfi g --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca -- enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3l ame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enabl e-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable- libvidstab --enable-libvo-amrwbenc --enable-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. 20.100 / 55. 20.100 libavcodec 57. 34.100 / 57. 34.100 libavformat 57. 32.100 / 57. 32.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 41.100 / 6. 41.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 [hevc_qsv @ 0000000001c656c0] Could not load the requested plugin: 15dd936825ad475ea34e35f3f54217a6 Input #0, matroska,webm, from 'file:\\tower2\TV-Series\Breaking Bad\Season 3\Breaking.Bad.S03E01.mkv': Metadata: title : encoder : libebml v0.7.8 + libmatroska v0.8.1 creation_time : 2016-04-20 21:35:02 Duration: 00:47:12.67, start: 0.000000, bitrate: 2510 kb/s Stream #0:0: Video: hevc, 1 reference frame, nv12, 1920x1080, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default) Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s [Parsed_scale_0 @ 0000000001c845a0] w:trunc(min(max(iw,ih*dar),720)/2)*2 h:trunc(ow/dar/2)*2 flags:'bicubic' interl:0 [graph 0 input from stream 0:0 @ 0000000001c52f20] w:1920 h:1080 pixfmt:nv12 tb:1/1000 fr:30000/1001 sar:1/1 sws_param:f lags=2 [Parsed_scale_0 @ 0000000001c845a0] w:1920 h:1080 fmt:nv12 sar:1/1 -> w:720 h:404 fmt:nv12 sar:404/405 flags:0x4 [h264_qsv @ 000000000051dfe0] Initialized an internal MFX session using hardware accelerated implementation [h264_qsv @ 000000000051dfe0] Using the constant bitrate (CBR) ratecontrol method [h264_qsv @ 000000000051dfe0] profile: high; level: 41 [h264_qsv @ 000000000051dfe0] GopPicSize: 250; GopRefDist: 4; GopOptFlag: closed ; IdrInterval: 0 [h264_qsv @ 000000000051dfe0] TargetUsage: 7; RateControlMethod: CBR [h264_qsv @ 000000000051dfe0] InitialDelayInKB: 828; TargetKbps: 552; MaxKbps: 552 [h264_qsv @ 000000000051dfe0] NumSlice: 1; NumRefFrame: 2 [h264_qsv @ 000000000051dfe0] RateDistortionOpt: OFF [h264_qsv @ 000000000051dfe0] RecoveryPointSEI: OFF IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0 [h264_qsv @ 000000000051dfe0] MaxFrameSize: 137088; MaxSliceSize: 0; [h264_qsv @ 000000000051dfe0] BitrateLimit: ON; MBBRC: OFF; ExtBRC: unknown [h264_qsv @ 000000000051dfe0] Trellis: auto [h264_qsv @ 000000000051dfe0] RepeatPPS: ON; NumMbPerSlice: 0; LookAheadDS: 2x [h264_qsv @ 000000000051dfe0] AdaptiveI: unknown; AdaptiveB: unknown; BRefType: off [h264_qsv @ 000000000051dfe0] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0 [h264_qsv @ 000000000051dfe0] Entropy coding: CABAC; MaxDecFrameBuffering: 2 [h264_qsv @ 000000000051dfe0] NalHrdConformance: ON; SingleSeiNalUnit: ON; VuiVclHrdParameters: OFF VuiNalHrdParameters: ON Output #0, matroska, to 'B:\Users\Administrator\AppData\Roaming\Emby-Server\transcoding-temp\transcoding-temp\50d9b85fad b80cb84b8a70fe93d61258.mkv': Metadata: encoder : Lavf57.32.100 Stream #0:0: Video: h264 (h264_qsv) (H264 / 0x34363248), nv12, 720x404 [sAR 404:405 DAR 16:9], q=2-31, 552 kb/s, 29. 97 fps, 1k tbn, 29.97 tbc (default) Metadata: encoder : Lavc57.34.100 h264_qsv Side data: cpb: bitrate max/min/avg: 552001/0/552001 buffer size: 1104002 vbv_delay: -1 Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), 448 kb/s Stream mapping: Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> h264 (h264_qsv)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [hevc_qsv @ 0000000001c95960] Could not load the requested plugin: 15dd936825ad475ea34e35f3f54217a6 Error while decoding stream #0:0: Function not implemented [hevc_qsv @ 0000000001c95960] Decode header error -3 Error while decoding stream #0:0: Function not implemented [hevc_qsv @ 0000000001c95960] Decode header error -3 Error while decoding stream #0:0: Function not implemented [hevc_qsv @ 0000000001c95960] Decode header error -3 Error while decoding stream #0:0: Function not implemented [hevc_qsv @ 0000000001c95960] Decode header error -3 Error while decoding stream #0:0: Function not implemented [hevc_qsv @ 0000000001c95960] Decode header error -3 Error while decoding stream #0:0: Function not implemented [hevc_qsv @ 0000000001c95960] Decode header error -3 Error while decoding stream #0:0: Function not implemented
JeremyFr79 228 Posted March 30, 2017 Posted March 30, 2017 As a KabyLake owner I can tell you there are other caveats to HEVC playback with KabyLake, right now most codecs don't support HEVC through KabyLake via QSV, however you can get it to work using DXVA2 for the time being though it may not be perfect. Gonna have to give it time for ffmpeg/lav and others to catch up to the new capabilities of the chip. And don't get me started on HDR lol
Guest asrequested Posted March 30, 2017 Posted March 30, 2017 I've been wondering if Ffmpeg will support kabylake. I haven't looked in a while, but does the server support DXVA? I don't recall seeing it as a choice.
Waldonnis 148 Posted March 30, 2017 Posted March 30, 2017 Yeah, that ffmpeg run isn't showing much I didn't already expect and it's not showing what I had hoped to see. Ah well, I suspect JeremyFr79's reply is spot-on with the state of QuickSync and HEVC at this time. I think MSattler was running a Skylake i7 rather than Kaby Lake, but if ffmpeg still needs some work in that area, it's likely that it needs it for Skylake as well. If I can find some time, I'll take a better look at the commit history and see if any of the more recent commits have changed something that would help with this. A friend of mine is assembling a new KL gaming system in the next week or two, so I'll compile something and see if I can convince her to test a few things for me (she also has a new GTX 1060, so I have a few other things I want her to test anyway).
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now