Jump to content

Server Plugin: Transcoding Tests


softworkz
softworkz
Message added by softworkz,

The plugin requires Emby Server 4.8.0.50 or later

Recommended Posts

7 hours ago, rb9999 said:

Stupid question I know, but how do I view the transcoding test reports?

The best way of viewing them is within the plugin.You see a list of test runs and for each, you can click on the "Results" button to view details:

image.png.40fa7317434a52e2c2a60c700a620fb3.png

 

But I think you are asking about those links at the top like:

image.png.6c8a0fc821510170cf7f07cfd22c9403.png

and 

image.png.9cdd9fbaaf78a281150f9d08dc7ec2eb.png

 

These links use the "localexplorer:" protocol and to open them, you need to install the browser extension that is mentioned at the bottom of the second post in this topic:

https://emby.media/community/index.php?/topic/112572-server-plugin-transcoding-tests/&do=findComment&comment=1185602

As the name says, this is for local access, which means that you need to have access to the exact same file path on the machine where the browser is running.
You could probably achieve this by creating the same mount inside proxmox and on the outer machine (pointing to the same data) and configure that path for the test output of the transcoding test plugin settings. Then it might work (haven't tried on Linux, though).

The reason why there's no implementatoin for remote downloading is that this would have taken several days of development, because allowing downloads from the file system is security critical and needs careful implementation - which is just out of scope for this plugin.
To make it still fairly easy when localexplorer: doesn't work, it is showing you the full paths for all the files, so you can just copy/paste them for accessing them with a tool of your choice (ssh, ftp, scp, etc.)

The top-level files for a test plan execution are always these two:

  • .etrd - Emby Test Report Data
    This is a JSON file with data for all runs. It references other output files in the file system (in subfolder) by relative paths.
    It is meant to be used when accessing it directly in the file system where it has been written to
  • .etra - Emby Test Report Archive
    This is simply a ZIP file. When you extract it, you get the full directory structure like in the output folder.
    There's also the .etrd JSON file and it's all the same as when accessing locally

 

Link to comment
Share on other sites

  • 1 month later...
gh0stwriter
Posted (edited)

image.png.1c4ac25a3d198c5365b8ebbdba664600.png

 

Not sure why these encode tests fail... only with VAAPI encoder, the software>software and VAAPI>software works so it should not be a permissions issue. Also it seems to work just fine with the videos I stream from Emby (near zero CPU with streaming 1080p etc....instead of like 25-50% This is on a quad core QNAP 6 bay AMD Ryzen Embedded V1500B  + Radeon WX4100 graphics)

Digging:

Error starting ffmpeg
-loglevel +timing -y -print_graphs_file "/config/logs/Run_2_30DA1DF3F923-b7627e3b-1a02-4d42-b7d1-ac536ee77770_1graph.txt" -copyts -start_at_zero -init_hw_device "vaapi=vad0:/dev/dri/renderD128" -filter_hw_device vad0 -f mp4 -t 00:03:00.000 -c:v:0 h264 -noautorotate -i "/tmp/bbb_sunflower_2160p_30fps_normal.mp4" -filter_complex "[0:0]format@f1=pix_fmts=nv12,hwupload@f2[f2_out0]" -map [f2_out0] -map 0:1 -sn -c:v:0 h264_vaapi -b:v:0 7498181 -g:v:0 180 -maxrate:v:0 7498181 -bufsize:v:0 14996362 -keyint_min:v:0 180 -compression_level:v:0 6 -r:v:0 30 -profile:v:0 main -c:a:0 copy -disposition:a:0 default -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 "/tmp/E4ADE9B252CD/65B7625FE531/Run_2/out.mkv"

20:08:15.167 ffmpeg version 5.1-emby_2023_06_25 Copyright (c) 2000-2022 the FFmpeg developers and softworkz for Emby LLC
20:08:15.167 built with gcc 10.3.0 (crosstool-NG 1.25.0)
20:08:15.167 Execution Date: 2024-05-03 20:08:15
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
20:08:16.119 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/bbb_sunflower_2160p_30fps_normal.mp4':
20:08:16.119 Metadata:
20:08:16.119 major_brand : isom
20:08:16.119 minor_version : 1
20:08:16.119 compatible_brands: isomavc1
20:08:16.119 creation_time : 2013-12-18T14:43:04.000000Z
20:08:16.119 title : Big Buck Bunny, Sunflower version
20:08:16.119 artist : Blender Foundation 2008, Janus Bager Kristensen 2013
20:08:16.119 comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
20:08:16.119 genre : Animation
20:08:16.119 composer : Sacha Goedegebure
20:08:16.119 Duration: 00:10:34.53, start: 0.000000, bitrate: 7980 kb/s
20:08:16.119 Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 3840x2160 [SAR 1:1 DAR 16:9], 7498 kb/s, Level 51, 30 fps, 30 tbr, 30k tbn, Start-Time 0.067s (default)
20:08:16.119 Metadata:
20:08:16.119 creation_time : 2013-12-18T14:43:04.000000Z
20:08:16.119 handler_name : GPAC ISO Video Handler
20:08:16.119 vendor_id : [0][0][0][0]
20:08:16.119 Stream #0:1[0x2](und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
20:08:16.119 Metadata:
20:08:16.119 creation_time : 2013-12-18T14:43:06.000000Z
20:08:16.119 handler_name : GPAC ISO Audio Handler
20:08:16.119 vendor_id : [0][0][0][0]
20:08:16.119 Stream #0:2[0x3](und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 320 kb/s (default)
20:08:16.119 Metadata:
20:08:16.119 creation_time : 2013-12-18T14:43:06.000000Z
20:08:16.119 handler_name : GPAC ISO Audio Handler
20:08:16.119 vendor_id : [0][0][0][0]
20:08:16.119 Side data:
20:08:16.119 audio service type: main
20:08:16.127 Stream mapping:
20:08:16.127 Stream #0:0 (h264) -> format:default
20:08:16.127 hwupload:default -> Stream #0:0 (h264_vaapi)
20:08:16.127 Stream #0:1 -> #0:1 (copy)
20:08:16.127 Press [q] to stop, [?] for help
20:08:16.346 [h264_vaapi @ 0x1e321c0] Driver does not support some wanted packed headers (wanted 0xd, found 0).
20:08:16.346 [h264_vaapi @ 0x1e321c0] Driver does not support packed sequence headers, but a global header is requested.
20:08:16.346 [h264_vaapi @ 0x1e321c0] No global header will be written: this may result in a stream which is not usable for some purposes (e.g. not muxable to some containers).
20:08:16.346 [h264_vaapi @ 0x1e321c0] Quality attribute is not supported: will use default quality level.
20:08:16.347 Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input
20:08:16.347 Error initializing output stream 0:0 --
20:08:16.351 Conversion failed!
20:08:16.351 EXIT



[
"Test Log",
"Info: Bitrate exceeds DirectPlay limit: media bitrate: 7980875, max bitrate: 1000000",
"Info: Bitrate exceeds DirectStream limit: media bitrate: 7980875, max bitrate: 1000000",
"Error: Error during sync transcoding\nEmby.Server.MediaEncoding.Unified.Ffmpeg.FfRunException: Error starting ffmpeg\n-loglevel +timing -y -print_graphs_file \"/config/logs/Run_2_30DA1DF3F923-b7627e3b-1a02-4d42-b7d1-ac536ee77770_1graph.txt\" -copyts -start_at_zero -init_hw_device \"vaapi=vad0:/dev/dri/renderD128\" -filter_hw_device vad0 -f mp4 -t 00:03:00.000 -c:v:0 h264 -noautorotate -i \"/tmp/bbb_sunflower_2160p_30fps_normal.mp4\" -filter_complex \"[0:0]format@f1=pix_fmts=nv12,hwupload@f2[f2_out0]\" -map [f2_out0] -map 0:1 -sn -c:v:0 h264_vaapi -b:v:0 7498181 -g:v:0 180 -maxrate:v:0 7498181 -bufsize:v:0 14996362 -keyint_min:v:0 180 -compression_level:v:0 6 -r:v:0 30 -profile:v:0 main -c:a:0 copy -disposition:a:0 default -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 \"/tmp/E4ADE9B252CD/65B7625FE531/Run_2/out.mkv\"\n\n20:08:15.167 ffmpeg version 5.1-emby_2023_06_25 Copyright (c) 2000-2022 the FFmpeg developers and softworkz for Emby LLC\n20:08:15.167 built with gcc 10.3.0 (crosstool-NG 1.25.0)\n20:08:15.167 Execution Date: 2024-05-03 20:08:15\namdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.\nIf they do, bad things may happen!\n20:08:16.119 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/bbb_sunflower_2160p_30fps_normal.mp4':\n20:08:16.119 Metadata:\n20:08:16.119 major_brand : isom\n20:08:16.119 minor_version : 1\n20:08:16.119 compatible_brands: isomavc1\n20:08:16.119 creation_time : 2013-12-18T14:43:04.000000Z\n20:08:16.119 title : Big Buck Bunny, Sunflower version\n20:08:16.119 artist : Blender Foundation 2008, Janus Bager Kristensen 2013\n20:08:16.119 comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net\n20:08:16.119 genre : Animation\n20:08:16.119 composer : Sacha Goedegebure\n20:08:16.119 Duration: 00:10:34.53, start: 0.000000, bitrate: 7980 kb/s\n20:08:16.119 Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 3840x2160 [SAR 1:1 DAR 16:9], 7498 kb/s, Level 51, 30 fps, 30 tbr, 30k tbn, Start-Time 0.067s (default)\n20:08:16.119 Metadata:\n20:08:16.119 creation_time : 2013-12-18T14:43:04.000000Z\n20:08:16.119 handler_name : GPAC ISO Video Handler\n20:08:16.119 vendor_id : [0][0][0][0]\n20:08:16.119 Stream #0:1[0x2](und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)\n20:08:16.119 Metadata:\n20:08:16.119 creation_time : 2013-12-18T14:43:06.000000Z\n20:08:16.119 handler_name : GPAC ISO Audio Handler\n20:08:16.119 vendor_id : [0][0][0][0]\n20:08:16.119 Stream #0:2[0x3](und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 320 kb/s (default)\n20:08:16.119 Metadata:\n20:08:16.119 creation_time : 2013-12-18T14:43:06.000000Z\n20:08:16.119 handler_name : GPAC ISO Audio Handler\n20:08:16.119 vendor_id : [0][0][0][0]\n20:08:16.119 Side data:\n20:08:16.119 audio service type: main\n20:08:16.127 Stream mapping:\n20:08:16.127 Stream #0:0 (h264) -> format:default\n20:08:16.127 hwupload:default -> Stream #0:0 (h264_vaapi)\n20:08:16.127 Stream #0:1 -> #0:1 (copy)\n20:08:16.127 Press [q] to stop, [?] for help\n20:08:16.346 [h264_vaapi @ 0x1e321c0] Driver does not support some wanted packed headers (wanted 0xd, found 0).\n20:08:16.346 [h264_vaapi @ 0x1e321c0] Driver does not support packed sequence headers, but a global header is requested.\n20:08:16.346 [h264_vaapi @ 0x1e321c0] No global header will be written: this may result in a stream which is not usable for some purposes (e.g. not muxable to some containers).\n20:08:16.346 [h264_vaapi @ 0x1e321c0] Quality attribute is not supported: will use default quality level.\n20:08:16.347 Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input\n20:08:16.347 Error initializing output stream 0:0 -- \n20:08:16.351 Conversion failed!\n20:08:16.351 EXIT\n\n\n\n\n at Emby.Server.MediaEncoding.Encoder.BaseEncoder.Start(EncodingJobOptions options, IProgress`1 progress, CancellationToken cancellationToken)\n at Emby.Server.MediaEncoding.Tests.ServerTranscodingTestManager.Start(EncodingJobOptions options, IProgress`1 progress, CancellationToken cancellationToken)\n at Emby.TranscodingTestPlugin.Operation.Transcode.SingleTestRunExecutor.RunTranscode(ExecutionRun executionRun, String outputRoot, SessionInfo sessionInfo, ExecutionHwDeviceSelectionList hwDeviceSelections, TestImageExtraction imageExtraction, CancellationToken cancellationToken)"

Edited by gh0stwriter
add log
Link to comment
Share on other sites

JBou

Hello, I faced this problem myself (using VAAPI on Unraid with an AMD Renoir Radeon RX Vega 6 iGPU)
I searched a bit on the Internet and found out that there existed an issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3524
It is fixed in mesa 23.3.1 and later, but Emby still uses Mesa Gallium driver 23.1.6 by default.

So I created a scriptt based on https://github.com/linuxserver/docker-mods/tree/jellyfin-amd to update the mesa driver inside the container: 
https://gist.github.com/JBou/41a19db4c513d7acc7f6b97d151da7ff

And afterwards you have to go to Diagnostic Options -> FFmpeg Options and change the following parameters:
Use custom LD_LIBRARY_PATH = /usr/lib/x86_64-linux-gnu:/app/emby/lib:/app/emby/extra/lib
Use custom LIBVA_DRIVERS_PATH = /usr/lib/x86_64-linux-gnu/dri:/app/emby/extra/lib/dri

Next go to Dashboard and restart the emby server.

 

ALTERNATIVELY, just add the following docker mod to the container: https://github.com/linuxserver/docker-mods/tree/jellyfin-amd It is the same script

Execute the transcoding tests again, and you should see that the test pass.
I think Emby should update the embedded mesa driver to the newest version, this should fix some issues with transcoding :)
 

OLD:
BEFORE.thumb.png.9b0c6688c91e1311d6c63aa3ebf556e5.png

AFTER:
AFTER.thumb.png.21e365b0f0193754f73efa09e22b7240.png

Link to comment
Share on other sites

On 5/3/2024 at 10:15 PM, gh0stwriter said:

Not sure why these encode tests fail... only with VAAPI encoder, the software>software and VAAPI>software works so it should not be a permissions issue. Also it seems to work just fine with the videos I stream from Emby (near zero CPU with streaming 1080p etc....instead of like 25-50% This is on a quad core QNAP 6 bay AMD Ryzen Embedded V1500B  + Radeon WX4100 graphics)

Hardware transcoding with AMD hardware has a range of limitations as the support in ffmpeg is still lagging behind Nvidia and Intel in this regard.

In regular operation, Emby Server sets up transcoding with AMD accordingly, in a way that those limitations won't be encountered by choosing procedure which are working. I.e. the transcoding unit is being informed about the source material and the desired output. Knowing about the available hw capabilities, it chooses the best possible way to transcode.

For the transcoding tests, the pattern is quite different: When you set up a test, you are the one to choose which ways of transcoding you want to test. The transcoding unit does not make any choices, it just executes what and how is requested. This means that the transcoding tests are often performing transcodes in a way which might be just the 4th, 5th, 6th..option or even might never be performed this way normally - or only rarely. And that's a key point of the transcoding tests: To have wide coverage of all the possible cases, so we can know early when something goes wrong or doesn't behave anymore like it did earlier.

Recent and < 3-4 years old Intel and Nvidia GPUs are usually getting close to 100%, but for AMD graphics it's expected that a substantial amount of the tests doesn't succeed, so nothing to worry about.

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