Jump to content

GPU Transcoding (Intel QuickSync and nVidia NVENC)


witteschnitte

Recommended Posts

Deihmos

The result is the same. Nothing happens and the log is exactly the same. Maybe quick sync can't do MPEG2? I don't know.

Edited by Deihmos
Link to comment
Share on other sites

babgvant

QS decoding won't work reliability without probing. The right QS decoder can't be specified if the codec is unknown.

Link to comment
Share on other sites

QS decoding won't work reliability without probing. The right QS decoder can't be specified if the codec is unknown.

 

this is actually encoding though. what we're doing here is not using any qs decoding but using it for encoding to h264. what do you think?

Link to comment
Share on other sites

Well just to keep the testing moving i've gone ahead and put up a build that will disable qsv for live tv but still use it for video files.

Link to comment
Share on other sites

babgvant

this is actually encoding though. what we're doing here is not using any qs decoding but using it for encoding to h264. what do you think?

 

I think there's still a problem with ffmpeg VPP -> QS encode currently. I haven't had a chance to do a thorough test of all the permutations though, so I could be mistaken.

Link to comment
Share on other sites

Tranquil

Also made some tests and can confirm: In some scenarios the ffmpeg processes get not killed correctly and seem to run "forever".

This is how I can reproduce it:

 

Server Version 3.0.5804.38417

Emby Android: 2.4.30

 

Started one stream at 1 Mbps, running fine. (CPU is at approx 16 % Usage)

Tried reducing the bitrate by selecting Quality Option in EmbyApp to 360kbit -> Stream never starts

Reselect 1 MBit Quality in Emby App -> Stream starts again, 2nd FFMPEG process is created, old one runs forever until I kill it

 

Logs:

Server: http://pastebin.com/ZbcUPWi9

Transcode Logs:

 

1st: http://pastebin.com/29a8hggZ

2nd:http://pastebin.com/wBsC8kHp

3rd: http://pastebin.com/T1WegUYk

 

Correctly closing the stream (within the App) and also force closing the app in android, does not kill the process either. 

Edited by Tranquil
Link to comment
Share on other sites

Tried reducing the bitrate by selecting Quality Option in EmbyApp to 360kbit -> Stream never starts

 

This is the key part.  When you stop a request before the stream starts, the server currently loses track of that ffmpeg process.

Link to comment
Share on other sites

Deihmos

This is the key part.  When you stop a request before the stream starts, the server currently loses track of that ffmpeg process.

This happens even when the video is playing and I close the iphone app. ffmpeg never stops and will create a new instance for the same channel. Sometimes it isn't always possible to close the video by pressing the x and sometimes doing it that way still does not stop ffmpeg. 

Link to comment
Share on other sites

witteschnitte

Hi,

 

Luke says if the release goes stable intel quick sync will be run on other systems than Windows.

So there is a stable release with quicksync option. But it will not work. (I am using cent os 7)

I´m using quick sync on this system with tvheadend. This worked fine.

 

But if i look at the ffmpeg file (emby Folder) i found that "libmfx" is not part of the ffmpeg. So quicksync will not work on linux with emby?

 

Regards

Felix

Edited by witteschnitte
Link to comment
Share on other sites

Tranquil

Version 3.0.5806.24786

 

Problem with 360p Quality seems to be fixed (is now working).

​Unfortunately, the problem of multiple ffmpeg instances still exists, sometimes.

Link to comment
Share on other sites

QuickSync encoding support has been merged into master and will be in the next public release. We're not really learning a whole lot right now by keeping it limited to the test group. It has to be specifically enabled in order to be utilized, so there's not much harm in putting it out there to try and collect more feedback. 

  • Like 3
Link to comment
Share on other sites

witteschnitte

Hi,

so i tried the new emby version with centOS 7 but in the ffmpeg the libmfx is still no part of it.

So quick sync will run into error.

How do i get Quicksync to work without libmfx enabled in ffmpeg?

 

regards

Felix

Link to comment
Share on other sites

legallink

I have tried to enable quicksync on my instance.  It does not start an ffmpeg instance, and no transcoding/event is created (the server does not even recognize that a request was made to play media - either on iphone app or web browser).  Additionally, once you switch intel quicksync off and restart playing the movie, you run into the additional ffmpeg instance that runs forever.

Link to comment
Share on other sites

Tranquil

Think you have to provide a log to see whats happening.

 

For me, quicksync is working but I sometimes run into trouble that the old ffmpeg instance is not closed correctly and a new one is created. (Happens while seeking inside the media or just selecting another bitrate quality)

Link to comment
Share on other sites

Hi all,

 

I did some preliminary tests using the Quick Sync option and the regular "Auto" for Internet streaming and here are my findings on a Asus Vivo PC Intel Core i5-3337U Processor and Chrome Browser on the other end. It was transcoding a 1080p mkv movie file remotely via the Internet (LAN tests will remain for later today when back at home) with 8Mbps option. Test lasted around 5 minutes.

 

- CPU usage using Intel Quick Sync is much lower than using Auto. Averages around 50/60% and sometimes lowered to 40% which is a huge difference in load when compared to auto which averages around 90/100% always during the transcoding stream.

 

- Quality-wise, and doing a very subjective analysis it seemed to provide a improved image quality when comparing to the Auto. Might have been a "placebo effect" so will need to investigate better using LAN transcoding.

 

- The stream using Quick-Sync had quite a few hick-ups every 10/15 seconds in playback even though using less CPU load and the same Internet outbound data amounts when compared to "Auto" setting. Using auto with the same quality setting the playback was flawless for the duration of the test (5 minutes).

 

I found this last point weird so not sure what might be happening as the conditions were all the same - same file, same quality settings, same Internet settings (as much as it can be), same audio settings, with the only difference being the Hardware Transcoding option.

 

Hope this helps, and do get back to me if you find the feedback useful and you need more data to analyse.

  • Like 2
Link to comment
Share on other sites

witteschnitte

So i tried to use quicksync on CentOS 7.

 

I got this log

 

/var/lib/emby-server/ffmpeg/20150917/ffmpeg -fflags +genpts -i file:"/XXX/XXX.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=min(iw\,1280):trunc(ow/dar/2)*2" -pix_fmt yuv420p -preset 7 -look_ahead 0 -b:v 1872000 -vsync vfr -profile:v high -level 4.1 -map_metadata -1 -threads 0 -codec:a:0 aac -strict experimental -ac 2 -ab 128000 -af "aresample=async=1" -y "/var/lib/emby-server/transcoding-temp/4b033821280a2e23959f98d29806633e.ts"

 

 

ffmpeg version N-49867-gd36eac6-static http://johnvansickle.com/ffmpeg/  Copyright © 2000-2015 the FFmpeg developers
  built with gcc 4.9.3 (Debian 4.9.3-4)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --cc=gcc-4.9
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  2.100 / 57.  2.100
  libavformat    57.  2.100 / 57.  2.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  4.100 /  6.  4.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Unrecognized option 'look_ahead'.
Error splitting the argument list: Option not found

 

So it doesn´t work for me.

 

Do you have any ideas? I don´t know why libmfx isn´t in the ffmpeg enabled.

TVheadend Needs this lib to use quicksync.

Link to comment
Share on other sites

Hi @@Frazas

 

Can you post the transcode log with the qsv ? It would also be good to know if you had throttling enabled

 

 

Thanks

Link to comment
Share on other sites

Hello,

 

I updated to the latest version of Emby and gave a try for the new Intel Quick Sync encoding. it seems I have the save problem as witteschnitte.

 

I am running an Intel® Core i5-4690S CPU @ 3.20GHz under Xubuntu 14.04

 

 

/var/lib/emby-server/ffmpeg/20150917/ffmpeg -i file:"/mnt/raid3/testvid.mkv" -map_metadata -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -pix_fmt yuv420p -preset 7 -look_ahead 0 -b:v 3597513 -maxrate 3597513 -bufsize 7195026 -vsync vfr -profile:v high -level 4.1 -force_key_frames "expr:gte(t,n_forced*3)" -vf "scale=trunc(oh*a/2)*2:min(ih\,1080)" -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 "/mnt/raid2/files/emby_data/transcoding-temp/951527678e1bf6de8460e7e739e15b86.m3u8"


ffmpeg version N-49867-gd36eac6-static http://johnvansickle.com/ffmpeg/ Copyright © 2000-2015 the FFmpeg developers
built with gcc 4.9.3 (Debian 4.9.3-4)
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --cc=gcc-4.9
libavutil 55. 2.100 / 55. 2.100
libavcodec 57. 2.100 / 57. 2.100
libavformat 57. 2.100 / 57. 2.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 4.100 / 6. 4.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Unrecognized option 'look_ahead'.
Error splitting the argument list: Option not found

 

 

Is this version of ffmpeg recent enough?

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...