Jump to content

GPU Transcoding (Intel QuickSync and nVidia NVENC)


witteschnitte

Recommended Posts

Gerrit507

I've just swapped my J1900 for a J3455 mainboard. With the old mainboard I was able to transcode h264 with vaapi fine. Now that I've the newer mainboard that acutally supports a lot more codecs, has a faster cpu and gpu, I'm not able to transcode h264 with atleast 1x speed anymore. It's ubuntu 16.04 with Kernel 4.4-78. I'm absolutely clueless...

 

And on Windows with qsv I'm getting the following result:

[hevc_qsv @ 0000000002602f20] Could not load the requested plugin: 15dd936825ad475ea34e35f3f54217a6
[hevc_qsv @ 0000000002602f20] Error loading plugins
[hevc_qsv @ 0000000002602f20] Error initializing an MFX session
Error while decoding stream #0:0: Function not implemented
frame=    0 fps=0.0 q=0.0 size=N/A time=-577014:32:22.77 bitrate=N/A speed=N/A    
[hevc_qsv @ 0000000002602f20] Error initializing the MFX video decoder, unsupported video
Error while decoding stream #0:0: Invalid argument
Edited by Gerrit507
Link to comment
Share on other sites

Gerrit507

I've made a fresh install of Ubuntu Server 16.04 now.

 

With the ffmpeg build that comes with emby or any build from https://johnvansickle.com/ffmpeg/ vaapi doesn't work at all in emby.  I'm getting: 

No VA display found for device: /dev/dri/renderD128

And emby falls back to libx264...

Although if I run the same ffmepg build as sudo like this

 ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -i /home/tv/samples/jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv -f null -ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -i /home/tv/samples/jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv -f null -

It works fine, but only as sudo...

 

The strange thing is that with my own ffmpeg build emby doesn't give any errors like above  :blink:

But even when it's able to transcode it's so extremely slow. Some h264 videos are transcoded faster than 1x, but most of my videos are way below 1x... Is this a driver issue or what?  :blink: CPU usage is very low and GPU usage is about 40%... I've manually installed xorg and openbox by the way and emby is in the video group...

Edited by Gerrit507
Link to comment
Share on other sites

aptalca

Are you sure you are running the johnvansickle build from command line? It looks like you're running the system ffmpeg. You would have to use the absolute path to run the version that comes with emby or any other version you download.

 

When I tried, the johnvansickle version did not support vaapi at all. He confirmed in an email that vaapi doesn't work in fully static builds. I also confirmed that by building a static and a shared lib one with the same libraries and ffmpeg version. The static one does not work with vaapi even on the same machine it was built on.

 

You may have installed ffmpeg from the ffmpeg3 ppa as that one works with vaapi and would be called without an absolute path.

Link to comment
Share on other sites

Gerrit507

Are you sure you are running the johnvansickle build from command line? It looks like you're running the system ffmpeg. You would have to use the absolute path to run the version that comes with emby or any other version you download.

 

When I tried, the johnvansickle version did not support vaapi at all. He confirmed in an email that vaapi doesn't work in fully static builds. I also confirmed that by building a static and a shared lib one with the same libraries and ffmpeg version. The static one does not work with vaapi even on the same machine it was built on.

 

You may have installed ffmpeg from the ffmpeg3 ppa as that one works with vaapi and would be called without an absolute path.

I was in the path of the ffmpeg build. There was no ffmpeg package installed. The only reason which I can think of is that it called my self compiled version located in /usr/local/bin...

Good point though. Why does it still output that it supports vaapi when it actually doesn't? 

 

EDIT:

I want to quickly summarize my results

 

Ubuntu with vaapi:

hevc -> h264 working

h264 -> h264 working

 

Windows with qsv:

hevc -> h264 completely broken in ffmpeg, see https://trac.ffmpeg.org/ticket/5899 and https://patchwork.ffmpeg.org/patch/286/ They claim that it works, but no it doesn't...

h264 -> h264 working

 

I think that the HD 500 in the J3455 is just too weak to transcode on the fly...

Can somebody confirm if a HD 630 for example is able to transcode two hevc -> h264 at the same time?

Edited by Gerrit507
Link to comment
Share on other sites

aptalca

To run the ffmpeg script/binary in the current folder, you can use "./ffmpeg"

 

./ is short for the current folder location

 

I have the hd630. Tested it with about 6 h264 to h264 simultaneous transcodes and it was chugging along fine. Didn't have any hevc so didn't test that.

 

Been spending most of my time optimizing and testing an ubuntu based docker build that supports both vaapi and nvenc. It's coming along nicely.

  • Like 1
Link to comment
Share on other sites

Gerrit507

To run the ffmpeg script/binary in the current folder, you can use "./ffmpeg"

 

./ is short for the current folder location

 

I have the hd630. Tested it with about 6 h264 to h264 simultaneous transcodes and it was chugging along fine. Didn't have any hevc so didn't test that.

 

Been spending most of my time optimizing and testing an ubuntu based docker build that supports both vaapi and nvenc. It's coming along nicely.

You're absolutely right, it called the one in /usr/local/bin  :D  :unsure:

 

I guess I might buy a new board and cpu then...

 

Which docker build do you use? Does the official one not support vaapi?

Edited by Gerrit507
Link to comment
Share on other sites

puithove

I've made a fresh install of Ubuntu Server 16.04 now.

 

With the ffmpeg build that comes with emby or any build from https://johnvansickle.com/ffmpeg/ vaapi doesn't work at all in emby.  I'm getting: 

No VA display found for device: /dev/dri/renderD128

And emby falls back to libx264...

Although if I run the same ffmepg build as sudo like this

 ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -i /home/tv/samples/jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv -f null -ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -i /home/tv/samples/jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv -f null -

It works fine, but only as sudo...

 

The strange thing is that with my own ffmpeg build emby doesn't give any errors like above  :blink:

But even when it's able to transcode it's so extremely slow. Some h264 videos are transcoded faster than 1x, but most of my videos are way below 1x... Is this a driver issue or what?  :blink: CPU usage is very low and GPU usage is about 40%... I've manually installed xorg and openbox by the way and emby is in the video group...

 

Since you did a new OS install, you need to add the user that runs Emby (the user is probably called "emby") to the video group.  This gives access to the device.  This is also why you see it work as sudo.

 

Also, you have newer hardware - you probably now need newer video drivers and libva.  Using the LTS branch of Ubuntu, you won't have that automatically.

Edited by puithove
Link to comment
Share on other sites

Gerrit507

Since you did a new OS install, you need to add the user that runs Emby (the user is probably called "emby") to the video group.  This gives access to the device.  This is also why you see it work as sudo.

 

Also, you have newer hardware - you probably now need newer video drivers and libva.  Using the LTS branch of Ubuntu, you won't have that automatically.

I added emby to the video group of course... I also tried newer drivers without any change.

Link to comment
Share on other sites

Kekskruemel

Hi someone from the AMD AMF Team released a preview of ffmpeg with amd amf support for gpu transcode of hevc files.

 

https://www.xaymar.com/2017/08/16/amf-encoder-plugin-2-2-x-and-amd-driver-17-7-2/

 

I copied the file into the Folder:

 

C:\Users\Egis\AppData\Roaming\Emby-Server\ffmpeg\20170308\

 

But there isn't any option in the Hardware acceleration tab to choose AMD Transcode.

 

Are there additional changes in Emby required to work with amd cards, or which option do I need to choose ?

 

Thx & Greetings

Edited by Kekskruemel
Link to comment
Share on other sites

Gerrit507

Hi someone from the AMD AMF Team released a preview of ffmpeg with amd amf support for gpu transcode of hevc files.

 

https://www.xaymar.com/2017/08/16/amf-encoder-plugin-2-2-x-and-amd-driver-17-7-2/

 

I copied the file into the Folder:

 

C:\Users\Egis\AppData\Roaming\Emby-Server\ffmpeg\20170308\

 

But there isn't any option in the Hardware acceleration tab to choose AMD Transcode.

 

Are there additional changes in Emby required to work with amd cards, or which option do I need to choose ?

 

Thx & Greetings

Vaapi on Linux partially supports AMD hardware

 

https://wiki.libav.org/Hardware/vaapi#Hardware_Support

 

On Windows it's not possible at the moment with emby. I saw in a comparison video that the quality of AMF is really bad though... If you want best quality nvidia is the way to go...

Edited by Gerrit507
Link to comment
Share on other sites

  • 3 weeks later...

New problem with transcoding QSV. Seems like the qsv encoder works coupled with the decoder? Intel HD 530 Skylake i7 6700

Application version: 3.2.30.0

http://valmar2.valinor.ercole.li:8096/emby/videos/5512686f1dac5dc7311622a2cf01eaf7/stream.mkv?DeviceId=1fe73a3cf21e54d7c769b787caf593862e21a711&MediaSourceId=5512686f1dac5dc7311622a2cf01eaf7&VideoCodec=h264&AudioCodec=ac3,mp3,aac&AudioStreamIndex=2&VideoBitrate=1308000&AudioBitrate=192000&Level=42&Profile=high&PlaySessionId=9fca0e6de89f416fa80dff2ce7f5f2dd&api_key=38b231a378504347ad9f2fb481534f25&CopyTimestamps=true&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&Tag=2383041a23a934cdadb5547426583714&RequireAvc=true&RequireNonAnamorphic=false&DeInterlace=true&TranscodeReasons=VideoCodecNotSupported,ContainerBitrateExceedsLimit&allowVideoStreamCopy=false

{"Protocol":"File","Id":"5512686f1dac5dc7311622a2cf01eaf7","Path":"\\\\FREENAS\\Multimedia\\TV\\Italian\\1080p-h265-test.mkv","Type":"Default","Container":"mkv","Name":"1080P/HEVC/AAC","IsRemote":false,"ETag":"2383041a23a934cdadb5547426583714","RunTimeTicks":42408148992,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"SupportsProbing":true,"EnableMpDecimate":false,"RequiresLooping":false,"VideoType":"VideoFile","MediaStreams":[{"Codec":"hevc","TimeBase":"1/1000","CodecTimeBase":"1001/24000","IsInterlaced":false,"BitRate":1946695,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":23.9760246,"RealFrameRate":23.9760246,"Profile":"Main 10","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p10le","Level":120,"IsAnamorphic":false},{"Codec":"aac","Language":"eng","TimeBase":"1/1000","CodecTimeBase":"1/48000","DisplayTitle":"Eng AAC 5.1","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":320000,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Profile":"HE-AAC","Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0,"IsAnamorphic":false},{"Codec":"aac","Language":"ita","TimeBase":"1/1000","CodecTimeBase":"1/48000","DisplayTitle":"Ita AAC stereo Default","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":192000,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Profile":"LC","Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0,"IsAnamorphic":false}],"Formats":[],"Bitrate":2458695,"RequiredHttpHeaders":{}}

User policy for Administrator: EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True

C:\Configurations\Emby\Zeranoe\ffmpeg-20170904-6cadbb1-win64-static\ffmpeg.exe -i file:"\\FREENAS\Multimedia\TV\Italian\1080p-h265-test.mkv" -map 0:0 -map 0:2 -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)\,1280)/2)*2:trunc(ow/dar/2)*2" -copyts -avoid_negative_ts disabled -start_at_zero -preset 7 -look_ahead 0 -b:v 1308000 -maxrate 1308000 -bufsize 2616000 -profile:v high -level 4.1 -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 copy -y "\\FREENAS\Temporary\Emby\transcoding-temp\2f58a3cc3dc5ae24d7598a1470ac578d.mkv"

ffmpeg version N-87196-g6cadbb1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --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-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --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-zlib
libavutil 55. 74.100 / 55. 74.100
libavcodec 57.105.100 / 57.105.100
libavformat 57. 81.100 / 57. 81.100
libavdevice 57. 8.100 / 57. 8.100
libavfilter 6.101.100 / 6.101.100
libswscale 4. 7.103 / 4. 7.103
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, matroska,webm, from 'file:\\FREENAS\Multimedia\TV\Italian\1080p-h265-test.mkv':
Metadata:
title : 1080p-h265-test.mkv
encoder : libebml v1.3.4 + libmatroska v1.4.5
creation_time : 2017-08-29T11:41:52.000000Z
Duration: 01:10:40.82, start: 0.000000, bitrate: 1946 kb/s
Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Metadata:
BPS : 1640625
BPS-eng : 1640625
DURATION : 01:10:40.815000000
DURATION-eng : 01:10:40.815000000
NUMBER_OF_FRAMES: 101674
NUMBER_OF_FRAMES-eng: 101674
NUMBER_OF_BYTES : 869698742
NUMBER_OF_BYTES-eng: 869698742
_STATISTICS_WRITING_APP: mkvmerge v13.0.0 ('The Juggler') 32bit
_STATISTICS_WRITING_APP-eng: mkvmerge v13.0.0 ('The Juggler') 32bit
_STATISTICS_WRITING_DATE_UTC: 2017-08-29 11:41:52
_STATISTICS_WRITING_DATE_UTC-eng: 2017-08-29 11:41:52
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, 5.1, fltp
Metadata:
BPS : 189332
BPS-eng : 189332
DURATION : 01:10:40.716000000
DURATION-eng : 01:10:40.716000000
NUMBER_OF_FRAMES: 99388
NUMBER_OF_FRAMES-eng: 99388
NUMBER_OF_BYTES : 100363221
NUMBER_OF_BYTES-eng: 100363221
_STATISTICS_WRITING_APP: mkvmerge v13.0.0 ('The Juggler') 32bit
_STATISTICS_WRITING_APP-eng: mkvmerge v13.0.0 ('The Juggler') 32bit
_STATISTICS_WRITING_DATE_UTC: 2017-08-29 11:41:52
_STATISTICS_WRITING_DATE_UTC-eng: 2017-08-29 11:41:52
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(ita): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
Metadata:
BPS : 116951
BPS-eng : 116951
DURATION : 01:08:58.078000000
DURATION-eng : 01:08:58.078000000
NUMBER_OF_FRAMES: 193918
NUMBER_OF_FRAMES-eng: 193918
NUMBER_OF_BYTES : 60494336
NUMBER_OF_BYTES-eng: 60494336
_STATISTICS_WRITING_APP: mkvmerge v13.0.0 ('The Juggler') 32bit
_STATISTICS_WRITING_APP-eng: mkvmerge v13.0.0 ('The Juggler') 32bit
_STATISTICS_WRITING_DATE_UTC: 2017-08-29 11:41:52
_STATISTICS_WRITING_DATE_UTC-eng: 2017-08-29 11:41:52
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_qsv))
Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
[h264_qsv @ 00000000005acc00] No device available for encoder (device type qsv for codec h264_qsv).
[h264_qsv @ 00000000005acc00] Selected ratecontrol mode is not supported by the QSV runtime. Choose a different mode.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
Application version: 3.2.30.0

http://valmar2.valinor.ercole.li:8096/emby/videos/05535e5b9ae3b21f2bb3883d1544b366/stream.mkv?DeviceId=1fe73a3cf21e54d7c769b787caf593862e21a711&MediaSourceId=05535e5b9ae3b21f2bb3883d1544b366&VideoCodec=h264&AudioCodec=ac3,mp3,aac&AudioStreamIndex=1&VideoBitrate=1308000&AudioBitrate=192000&StartTimeTicks=23287534841&Level=42&Profile=high&PlaySessionId=189cbfc919e84de283ef163cec967fb6&api_key=38b231a378504347ad9f2fb481534f25&CopyTimestamps=true&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&Tag=455fc1d2a57896964bb6d56add3ccaac&RequireAvc=true&RequireNonAnamorphic=false&DeInterlace=true&TranscodeReasons=ContainerBitrateExceedsLimit

{"Protocol":"File","Id":"05535e5b9ae3b21f2bb3883d1544b366","Path":"\\\\FREENAS\\Multimedia\\TV\\Italian\1080p-h264-test.mkv","Type":"Default","Container":"mkv","Name":"1080P/H264/AC3","IsRemote":false,"ETag":"455fc1d2a57896964bb6d56add3ccaac","RunTimeTicks":35085438976,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"SupportsProbing":true,"EnableMpDecimate":false,"RequiresLooping":false,"VideoType":"VideoFile","MediaStreams":[{"Codec":"h264","TimeBase":"1/1000","CodecTimeBase":"1/50","NalLengthSize":"4","IsInterlaced":false,"IsAVC":true,"BitRate":7977000,"BitDepth":8,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":25,"RealFrameRate":25,"Profile":"High","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":40,"IsAnamorphic":false},{"Codec":"ac3","Language":"ita","TimeBase":"1/1000","CodecTimeBase":"1/48000","Title":"ITA","DisplayTitle":"ITA","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":192000,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":true,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0,"IsAnamorphic":false},{"Codec":"ac3","Language":"eng","TimeBase":"1/1000","CodecTimeBase":"1/48000","Title":"ENG","DisplayTitle":"ENG","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":384000,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0,"IsAnamorphic":false},{"Codec":"subrip","Language":"ita","TimeBase":"1/1000","CodecTimeBase":"0/1","Title":"ITA - Forced","DisplayTitle":"ITA - Forced","IsInterlaced":false,"IsDefault":true,"IsForced":true,"Type":"Subtitle","Index":3,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Level":0,"IsAnamorphic":false},{"Codec":"subrip","Language":"ita","TimeBase":"1/1000","CodecTimeBase":"0/1","DisplayTitle":"Ita","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":4,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Level":0,"IsAnamorphic":false},{"Codec":"subrip","Language":"eng","TimeBase":"1/1000","CodecTimeBase":"0/1","DisplayTitle":"Eng","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":5,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Level":0,"IsAnamorphic":false}],"Formats":[],"Bitrate":8553000,"RequiredHttpHeaders":{}}

User policy for Administrator: EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True

C:\Configurations\Emby\Zeranoe\ffmpeg-20170904-6cadbb1-win64-static\ffmpeg.exe -ss 00:38:48.753 -c:v h264_qsv -i file:"\\FREENAS\Multimedia\TV\Italian\1080p-h264-test.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)\,1280)/2)*2:trunc(ow/dar/2)*2" -copyts -avoid_negative_ts disabled -start_at_zero -preset 7 -look_ahead 0 -b:v 1308000 -maxrate 1308000 -bufsize 2616000 -profile:v high -level 4.1 -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 copy -y "\\FREENAS\Temporary\Emby\transcoding-temp\08a5d422149c6b1de0585d9fdc9a4062.mkv"

ffmpeg version N-87196-g6cadbb1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --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-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --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-zlib
libavutil 55. 74.100 / 55. 74.100
libavcodec 57.105.100 / 57.105.100
libavformat 57. 81.100 / 57. 81.100
libavdevice 57. 8.100 / 57. 8.100
libavfilter 6.101.100 / 6.101.100
libswscale 4. 7.103 / 4. 7.103
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, matroska,webm, from 'file:\\FREENAS\Multimedia\TV\Italian\1080p-h264-test.mkv':
Metadata:
encoder : libebml v1.3.1 + libmatroska v1.4.2
creation_time : 2017-08-22T14:36:33.000000Z
Duration: 00:58:28.54, start: 0.000000, bitrate: 7977 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
_STATISTICS_WRITING_APP: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_APP-eng: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_DATE_UTC: 2017-08-22 14:36:33
_STATISTICS_WRITING_DATE_UTC-eng: 2017-08-22 14:36:33
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
BPS : 7398655
BPS-eng : 7398655
DURATION : 00:58:28.480000000
DURATION-eng : 00:58:28.480000000
NUMBER_OF_FRAMES: 87712
NUMBER_OF_FRAMES-eng: 87712
NUMBER_OF_BYTES : 3244754457
NUMBER_OF_BYTES-eng: 3244754457
Stream #0:1(ita): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default) (forced)
Metadata:
title : ITA
_STATISTICS_WRITING_APP: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_APP-eng: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_DATE_UTC: 2017-08-22 14:36:33
_STATISTICS_WRITING_DATE_UTC-eng: 2017-08-22 14:36:33
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
BPS : 192000
BPS-eng : 192000
DURATION : 00:58:28.544000000
DURATION-eng : 00:58:28.544000000
NUMBER_OF_FRAMES: 109642
NUMBER_OF_FRAMES-eng: 109642
NUMBER_OF_BYTES : 84205056
NUMBER_OF_BYTES-eng: 84205056
Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Metadata:
title : ENG
_STATISTICS_WRITING_APP: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_APP-eng: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_DATE_UTC: 2017-08-22 14:36:33
_STATISTICS_WRITING_DATE_UTC-eng: 2017-08-22 14:36:33
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
BPS : 384000
BPS-eng : 384000
DURATION : 00:58:28.480000000
DURATION-eng : 00:58:28.480000000
NUMBER_OF_FRAMES: 109640
NUMBER_OF_FRAMES-eng: 109640
NUMBER_OF_BYTES : 168407040
NUMBER_OF_BYTES-eng: 168407040
Stream #0:3(ita): Subtitle: subrip (default) (forced)
Metadata:
title : ITA - Forced
BPS : 7
BPS-eng : 7
DURATION : 00:16:44.521000000
DURATION-eng : 00:16:44.521000000
NUMBER_OF_FRAMES: 23
NUMBER_OF_FRAMES-eng: 23
NUMBER_OF_BYTES : 885
NUMBER_OF_BYTES-eng: 885
_STATISTICS_WRITING_APP: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_APP-eng: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_DATE_UTC: 2017-08-22 14:36:33
_STATISTICS_WRITING_DATE_UTC-eng: 2017-08-22 14:36:33
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:4(ita): Subtitle: subrip
Metadata:
_STATISTICS_WRITING_APP: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_APP-eng: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_DATE_UTC: 2017-08-22 14:36:33
_STATISTICS_WRITING_DATE_UTC-eng: 2017-08-22 14:36:33
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
BPS : 61
BPS-eng : 61
DURATION : 00:56:13.301000000
DURATION-eng : 00:56:13.301000000
NUMBER_OF_FRAMES: 665
NUMBER_OF_FRAMES-eng: 665
NUMBER_OF_BYTES : 25799
NUMBER_OF_BYTES-eng: 25799
Stream #0:5(eng): Subtitle: subrip
Metadata:
_STATISTICS_WRITING_APP: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_APP-eng: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 15:12:28
_STATISTICS_WRITING_DATE_UTC: 2017-08-22 14:36:33
_STATISTICS_WRITING_DATE_UTC-eng: 2017-08-22 14:36:33
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
BPS : 57
BPS-eng : 57
DURATION : 00:58:18.898000000
DURATION-eng : 00:58:18.898000000
NUMBER_OF_FRAMES: 779
NUMBER_OF_FRAMES-eng: 779
NUMBER_OF_BYTES : 25311
NUMBER_OF_BYTES-eng: 25311
[AVHWDeviceContext @ 00000000008ac1e0] Failed to create Direct3D device
Device creation failed: -1313558101.
[h264_qsv @ 00000000008ae6c0] No device available for decoder (device type qsv for codec h264_qsv).
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_qsv) -> h264 (h264_qsv))
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[h264_qsv @ 0000000000962b80] No device available for encoder (device type qsv for codec h264_qsv).
Output #0, matroska, to '\\FREENAS\Temporary\Emby\transcoding-temp\08a5d422149c6b1de0585d9fdc9a4062.mkv':
Metadata:
encoder : Lavf57.81.100
Stream #0:0: Video: h264 (h264_qsv) (H264 / 0x34363248), nv12, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1308 kb/s, 25 fps, 1k tbn, 25 tbc (default)
Metadata:
encoder : Lavc57.105.100 h264_qsv
Side data:
cpb: bitrate max/min/avg: 1308000/0/1308000 buffer size: 2616000 vbv_delay: -1
Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s (default) (forced)
frame= 0 fps=0.0 q=0.0 size= 0kB time=00:38:48.16 bitrate= 0.0kbits/s speed=4.62e+003x
frame= 10 fps=3.9 q=-0.0 size= 49kB time=00:38:49.69 bitrate= 0.2kbits/s speed= 914x
frame= 58 fps= 19 q=-0.0 size= 49kB time=00:38:51.45 bitrate= 0.2kbits/s speed= 751x
frame= 126 fps= 35 q=-0.0 size= 49kB time=00:38:54.14 bitrate= 0.2kbits/s speed= 646x
frame= 161 fps= 39 q=-0.0 size= 941kB time=00:38:55.68 bitrate= 3.3kbits/s speed= 567x
frame= 233 fps= 50 q=-0.0 size= 941kB time=00:38:58.59 bitrate= 3.3kbits/s speed= 506x
frame= 255 fps= 42 q=-0.0 size= 1848kB time=00:38:59.58 bitrate= 6.5kbits/s speed= 383x
frame= 305 fps= 46 q=-0.0 size= 1907kB time=00:39:01.60 bitrate= 6.7kbits/s speed= 354x
frame= 381 fps= 54 q=-0.0 size= 2773kB time=00:39:04.44 bitrate= 9.7kbits/s speed= 329x
frame= 429 fps= 56 q=-0.0 size= 2773kB time=00:39:06.40 bitrate= 9.7kbits/s speed= 305x
frame= 475 fps= 58 q=-0.0 size= 2773kB time=00:39:08.35 bitrate= 9.7kbits/s speed= 285x
frame= 504 fps= 56 q=-0.0 size= 3686kB time=00:39:09.28 bitrate= 12.9kbits/s speed= 262x
frame= 548 fps= 58 q=-0.0 size= 3732kB time=00:39:11.20 bitrate= 13.0kbits/s speed= 248x
frame= 568 fps= 57 q=-0.0 size= 3732kB time=00:39:11.84 bitrate= 13.0kbits/s speed= 236x
frame= 630 fps= 56 q=-0.0 size= 4608kB time=00:39:14.43 bitrate= 16.0kbits/s speed= 209x
frame= 656 fps= 56 q=-0.0 size= 4608kB time=00:39:15.45 bitrate= 16.0kbits/s speed=200x
frame= 691 fps= 56 q=-0.0 size= 4608kB time=00:39:16.76 bitrate= 16.0kbits/s speed= 190x
frame= 751 fps= 58 q=-0.0 size= 4608kB time=00:39:19.23 bitrate= 16.0kbits/s speed= 183x
frame= 755 fps= 56 q=-0.0 size= 5518kB time=00:39:19.45 bitrate= 19.2kbits/s speed= 174x
frame= 832 fps= 59 q=-0.0 size= 5574kB time=00:39:22.43 bitrate= 19.3kbits/s speed= 167x
frame= 866 fps= 59 q=-0.0 size= 5574kB time=00:39:23.80 bitrate= 19.3kbits/s speed= 160x
frame= 881 fps= 54 q=-0.0 size= 6444kB time=00:39:24.51 bitrate= 22.3kbits/s speed= 144x
frame= 936 fps= 54 q=-0.0 size= 6444kB time=00:39:26.65 bitrate= 22.3kbits/s speed= 137x
frame= 972 fps= 54 q=-0.0 size= 6444kB time=00:39:28.22 bitrate= 22.3kbits/s speed= 133x
frame= 994 fps= 54 q=-0.0 size= 6444kB time=00:39:29.05 bitrate= 22.3kbits/s speed= 128x
frame= 1004 fps= 53 q=-0.0 size= 7354kB time=00:39:29.34 bitrate= 25.4kbits/s speed= 125x
frame= 1080 fps= 55 q=-0.0 size= 7391kB time=00:39:32.41 bitrate= 25.5kbits/s speed= 121x
frame= 1131 fps= 56 q=-0.0 size= 8278kB time=00:39:34.52 bitrate= 28.6kbits/s speed= 118x
frame= 1207 fps= 58 q=-0.0 size= 8278kB time=00:39:37.69 bitrate= 28.5kbits/s speed= 114x
frame= 1225 fps= 54 q=-0.0 size= 8278kB time=00:39:38.30 bitrate= 28.5kbits/s speed= 105x
frame= 1255 fps= 53 q=-0.0 size= 9189kB time=00:39:39.32 bitrate= 31.6kbits/s speed= 101x
frame= 1296 fps= 54 q=-0.0 size= 9239kB time=00:39:41.05 bitrate= 31.8kbits/s speed= 99x
frame= 1357 fps= 55 q=-0.0 size= 9239kB time=00:39:43.61 bitrate= 31.8kbits/s speed=96.5x
frame= 1381 fps= 55 q=-0.0 size= 10114kB time=00:39:44.44 bitrate= 34.7kbits/s speed=94.1x
frame= 1434 fps= 56 q=-0.0 size= 10114kB time=00:39:46.52 bitrate= 34.7kbits/s speed=92.4x
frame= 1470 fps= 55 q=-0.0 size= 10114kB time=00:39:48.16 bitrate= 34.7kbits/s speed=89.7x
frame= 1535 fps= 57 q=-0.0 size= 11070kB time=00:39:50.68 bitrate= 37.9kbits/s speed=88.2x
frame= 1617 fps= 59 q=-0.0 size= 11070kB time=00:39:53.95 bitrate= 37.9kbits/s speed=86.7x
frame= 1686 fps= 60 q=-0.0 size= 11961kB time=00:39:56.73 bitrate= 40.9kbits/s speed=85.2x
frame= 1720 fps= 60 q=-0.0 size= 11961kB time=00:39:58.01 bitrate= 40.9kbits/s speed=83.7x
frame= 1755 fps= 60 q=-0.0 size= 12859kB time=00:39:59.45 bitrate= 43.9kbits/s speed= 82x
frame= 1760 fps= 59 q=-0.0 size= 12908kB time=00:39:59.71 bitrate= 44.1kbits/s speed= 80x
frame= 1843 fps= 60 q=-0.0 size= 12908kB time=00:40:02.84 bitrate= 44.0kbits/s speed=78.8x
frame= 1881 fps= 60 q=-0.0 size= 13784kB time=00:40:04.44 bitrate= 47.0kbits/s speed=76.6x
frame= 1955 fps= 61 q=-0.0 size= 13784kB time=00:40:07.52 bitrate= 46.9kbits/s speed=75.5x
frame= 1978 fps= 61 q=-0.0 size= 13784kB time=00:40:08.25 bitrate= 46.9kbits/s speed=74.3x
frame= 1993 fps= 60 q=-0.0 size= 13784kB time=00:40:08.99 bitrate= 46.9kbits/s speed=72.9x
frame= 2005 fps= 59 q=-0.0 size= 14695kB time=00:40:09.50 bitrate= 50.0kbits/s speed=71.3x
frame= 2032 fps= 59 q=-0.0 size= 14731kB time=00:40:10.65 bitrate= 50.1kbits/s speed=70.3x 
Edited by eTomm
Link to comment
Share on other sites

Those are two different input files so it's not exactly a 1:1 comparison. You do not need to use the decoder to use the encoder and vice versa.

Link to comment
Share on other sites

Yes sure, I am aware of that. The problem is that if I enable the HEVC decoder and the h264 encoder it does not work. And I tested even the encoder itself with the software hevc and it was not working.

 

Now I updated ffmpeg and emby to the latest release and I could make it work the soft hevc decoder with the qsv h264 encoder. But when I enable the hevc decoder with or without the qsv h264 encoder I got this:

[AVHWDeviceContext @ 000000000089dd20] Failed to create Direct3D device
Device creation failed: -1313558101.
[hevc_qsv @ 0000000000a6d0a0] No device available for decoder (device type qsv for codec hevc_qsv).
Stream mapping:
Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> h264 (h264_qsv))
Stream #0:3 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hevc_qsv @ 0000000000a6d0a0] Could not load the requested plugin '15dd936825ad475ea34e35f3f54217a6': specified object was not found (-9)
[hevc_qsv @ 0000000000a6d0a0] Error loading plugins
[hevc_qsv @ 0000000000a6d0a0] Error initializing an MFX session
Error while decoding stream #0:0: Function not implemented
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 0000000000a6d0a0] Error initializing the MFX video decoder: invalid video parameters (-15)
Link to comment
Share on other sites

Hi all,

 

If I undertand this thread correctly, the mentioned tests are running on linux?

 

Any status of QuickSync encoding working well on Windows10, and if it's working out-of-the-box, or if it requires custom ffmpeg builds?

 

Thanks-

Jennice

Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

 

I think I have QuickSync transcoding working on my i7-3770, but I think there might be a buffer or ffmpeg issue. It's the current build (v31, 2017-09-20)

I start a stream on the web browswer player, and it defaults to direct (I'd like to be able to change that, but that's another issue I guess).

 

I then set the quality to 4 mbps, and the CPU hovers at approx. 40-50% usage.

 

after a bit of watching, if I set the rate to 2 mbps, the same (buffered?) part plays once again at reduced quality, but now the CPU is maxed at 95%, as if it's still working on the "old" transcode stream of 4 mbps, while also working on the newly selected 2 mpbs. I haven't tried without QuickSync, as my cpu can't go beyond ca 2 mbps transcode without QuickSync support. Awaiting the 8.gen Intels! :)

Link to comment
Share on other sites

lifespeed

Hi all,

 

I think I have QuickSync transcoding working on my i7-3770, but I think there might be a buffer or ffmpeg issue. It's the current build (v31, 2017-09-20)

I start a stream on the web browswer player, and it defaults to direct (I'd like to be able to change that, but that's another issue I guess).

 

I then set the quality to 4 mbps, and the CPU hovers at approx. 40-50% usage.

 

after a bit of watching, if I set the rate to 2 mbps, the same (buffered?) part plays once again at reduced quality, but now the CPU is maxed at 95%, as if it's still working on the "old" transcode stream of 4 mbps, while also working on the newly selected 2 mpbs. I haven't tried without QuickSync, as my cpu can't go beyond ca 2 mbps transcode without QuickSync support. Awaiting the 8.gen Intels! :)

 

This sounds an awful lot like the problem I was seeing where FFMPEG did not close the previous transcoding problem when another process was started.  One way to do this is to seek the client using the scrub bar.  See this post.

Link to comment
Share on other sites

The interesting thing is that the second stream seems to start at the same spot (time in live tv), as the first one did.

 

I don't have a clue as to how ffmpeg works, but it's like the second transcode stream works on some kind of buffer file created by the first transcode stream, and not on the live input from the tuner.

 

If ffmpeg creates a buffer file for transcoding, my guess is that it's not cleared when ending the first ffmpeg request. (I used the browser window as viewer).

Link to comment
Share on other sites

Just downloaded and updated to 3.2.32.

 

The double-buffer issue seems gone, but there's something that makes me wonder.

 

Now, without QS support, I can manage to transcode to 720 / 2 mbit.

With QS support, I have the same limit, but my CPU usage is maybe 10% HIGHER when using QS, and the CPU usage is much more uneven over time. Peaks at regular intervals). Without QS support, it's very constant CPU usage %.

 

My CPU is i7 3770. According to a wiki page I found on Intel CPUs, the 3770 is from the first generation to support QS (on limited number of formats), so maybe this first generation QS is just not worth it?

Link to comment
Share on other sites

My CPU is i7 3770. According to a wiki page I found on Intel CPUs, the 3770 is from the first generation to support QS (on limited number of formats), so maybe this first generation QS is just not worth it?

 

That is potentially a true statement, yes.

Link to comment
Share on other sites

Can someone please show an example of, what they're capable of transcoding on a 7.gen i5 or i7 (stock clock freq's, not on LN2 cooled monsters)  :D

Personally, my 3770 only manages 2 - 2.5 mbit 720p before occasional stuttering. The CPU usage meter in Win10 says it's 40% - 50% load, but going higher causes stutter, despite the CPU load monitor not hitting 100% (!?).

Could it be that the load monitoring is just too slow to catch transcoding peak loads?

 

Any way to show trascoding speed relative to "real-time" (obviously this should never get below factor 1)?

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
×
×
  • Create New...