Jump to content

Using hardware transcoding via system's ffmpeg package


SuperSaiyanCaleb

Recommended Posts

SuperSaiyanCaleb

I have a Rock64 board that I'm interested in using as an Emby server.  The board uses the RK3328 chipset, which supports hardware decoding on H.264, HEVC, VP8 and VP9 video.  I'm running a minimal Ubuntu Bionic image on the board, and its ffmpeg package is configured to enable hardware decoding using h264_rkmpphevc_rkmpp, vp8_rkmpp or vp9_rkmpp -vcodec options.  I've installed and set up Emby on the board as well, but my understanding is that Emby comes with its own ffmpeg instance which (probably) does not support those decoders.  (And even if it did, I'm assuming Emby would not invoke ffmpeg with those options.)

 

So my question is:  Is there a way I can configure Emby to use the system's ffmpeg instance and the hardware accelerated decoders that it provides?  I made some superficial attempts to write a shunt script that would relay Emby's ffmpeg invokations to the system's ffmpeg with the correct -vcodec option, but I could not get a video to play in that situation.  Even when I removed the added -vcodec option and just directly forwarded the arguments from Emby to either the system's ffmpeg (or Emby's built-in ffmpeg!) video playback would hang forever.  Maybe there is a more elegant solution to get Emby to use the system's ffmpeg and the desired options?  Or another method entirely that I could use to get Emby to leverage the board's hardware decoding?

Link to comment
Share on other sites

hi @@SuperSaiyanCaleb, our ffmpeg builds do not ship with these libraries, and we also don't support those codec names either.

 

I was thinking of adding a generic hwaccel -auto support for ffmpeg. In theory, if you were able to provide your custom ffmpeg, can you test if using those auto params will work with that hardware decoding? Thanks !

Link to comment
Share on other sites

SuperSaiyanCaleb

I tested to see if the system's ffmpeg supports the -hwaccel auto option and it does not appear to.  (It fell back to software decoding.)  I'm sure I could probably write a script that would check the format of the video file and then automatically invoke ffmpeg with the correct command line argument, but so far I can't seem to figure out how to get Emby to successfully call an external ffmpeg instance.  I moved /opt/emby-server/bin/ffmpeg to /opt/emby-server/bin/ffmpeg.bak and replaced it with a script that simply invokes ffmpeg.bak without changing arguments that were passed to it---which should have had no effect on anything by my reckoning---but then Emby hangs when I try to play back a video file.  Is there a proper way to configure Emby to use external ffmpeg tucked away in its configuration files somewhere?

Link to comment
Share on other sites

Hi, if you look at the server log you'll see at the beginning the command line used to start the server. the only way to customize ffmpeg is to start with your own command line and specify a different path to the ffmpeg and ffprobe executables. please let me know if this helps. thanks.

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