Jellyfin Forum
Audio transcoding question - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Audio transcoding question (/t-audio-transcoding-question)



Audio transcoding question - the_slug - 2025-02-14

Hi guys,

Very quick and (hopefully) easy question.

When forcing transcoding through the Jellyfin Media Player by dropping the bitrate I've noticed that there is a load placed on my CPU. Albeit a small one, about 10-15%.
I have an Intel A310 which I can see is handling the video side of the transcoding. (Great GPU for Jellyfin btw)

Would I be right in saying the ffmpeg load I'm seeing on my CPU is being caused by the audio being transcoded? 
I know my CPU definitely isn't doing any video transcode work as intel_gpu_top correctly shows the MMX engine at work. 

Apologies if this is already outlined in the documentation, I did take a look but I couldn't find a definitive answer.

Advice appreciated.

Cheers.


RE: Audio transcoding question - TheDreadPirate - 2025-02-14

We'd need to see your ffmpeg log to determine what the CPU is doing. Also, is 10-15% the load on a single core? Or is that the all core average? If that is the all core average, can you tell if a SINGLE core is at 100%?

The following tasks will always happen on the CPU.

1) Audio transcoding/downmixing
2) Subtitle burn in: GPU (decode frame) -> CPU (composes and renders subtitles on video frame) -> GPU (encodes frame)
3) Remuxing


RE: Audio transcoding question - the_slug - 2025-02-14

Hey,

No worries, here is a copy of my transcode log: https://pastebin.com/4j8NzeZV

>Also, is 10-15% the load on a single core? Or is that the all core average? If that is the all core average, can you tell if a SINGLE core is at 100%?

That's the average reported by Truenas. When checking the output in top I can see a single FFMPEG process running. So I'm guessing 1 core is likely under quite a bit of load, and the others are idle.

If it helps the CPU is a Ryzen 5 2600 (Non x) So it's got 6 cores and 12 threads.

Cheers!


RE: Audio transcoding question - the_slug - 2025-02-14

Just a follow up. Kicked off another transcode while keeping an eye on top. ffmpeg uses 150 - 200% CPU. Seeing as 600% would be the entirety of my CPU consumed, it looks like ffmepg is using about 1.5 - 2.0 cores of the CPU doing whatever it is that it's doing.


RE: Audio transcoding question - TheDreadPirate - 2025-02-14

The ffmpeg log is showing just a video transcode, no audio transcode. So the CPU load you are seeing is probably all of the non-encoding tasks related with transcoding. Demuxing, sending the video to the GPU, remuxing the new video with original audio, etc.

150-200% CPU load sounds like audio transcoding is also happening. One core is pegged at 100% (audio transcoding is single threaded), and the remaining CPU usage above 100% is all of the non-encoding tasks mentioned above.

Also, since you have 12 threads 1200% would be a full load. And one process can have more than one thread. I forget the command to print out all the threads that a process spawns.


RE: Audio transcoding question - the_slug - 2025-02-14

Thank you for explaining that. It makes sense.
Is there anywhere that audio transcoding would be logged? It would be nice to confirm that's indeed where the CPU load is coming from.

I assume the logging I've provided so far shows video transcoding happening on the GPU successfully?

Cheers.


RE: Audio transcoding question - TheDreadPirate - 2025-02-14

Yes. It is encoding on the GPU.

Code:
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (copy)

"h264_qsv". You can also tell it is DEcoding on the GPU with this parameter in the ffmpeg command that is printed in the log.

Code:
-hwaccel vaapi

For the record, QSV is a superset of VAPPI. You can straight up use VAAPI on both Intel and AMD GPUs. But if you checked "Prefer OS native DXVA or VA-API hardware decoders" it will use VAAPI for decoding and QSV for encoding. And we recommend you keep it checked. VAAPI is slightly less performant that QSV, but more flexible for some odd ball video files.


RE: Audio transcoding question - the_slug - 2025-02-14

Thank you.

One final question if I may. Is there a way for me to confirm if audio transcoding is indeed happening?
I would like to know how nearly 2 CPU cores are being pegged when most of the heavy lifting should be getting done by the GPU.

Thanks for all your help so far Pirate.


RE: Audio transcoding question - TheDreadPirate - 2025-02-14

Similar to the "Stream mapping" I quoted from your log above. Instead of "copy" you'd see this (an example from one of my logs).

Code:
Stream #0:1 -> #0:1 (opus (native) -> aac (libfdk_aac))