rr icon indicating copy to clipboard operation
rr copied to clipboard

N100核显直通,ffmpeg只要使用qsv转码就会报错

Open shikaiwei1 opened this issue 1 year ago • 6 comments

请填写以下信息.
Please fill in the following information.

Install ENV: (You can find it in the boot interface.)

  • DMI:
  • CPU: intel n100
  • NIC: (pid & vid) vid:0x46f4 pid: 0x0001

RR version: (You can find it in the update menu.)

  • RR: 24.11.1
  • addons:
  • modules:
  • lkms: prod

DSM:

  • model: SA6400
  • version: DSM 7.2.2-72806

Issue:
N100核显直通,ffmpeg只要使用qsv转码就会报错。(安装的是ffmpeg7)

下列日志是jellyfin中播放时的日志报错。

logs1:

[2024-11-16 22:52:44.188 +08:00] [INF] [60] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "/var/packages/ffmpeg7/target/bin/ffmpeg" "-analyzeduration 200M -probesize 1G -init_hw_device vaapi=va:/dev/dri/renderD128,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -i file:"/volume2/video/2.动画/[欧美][动作][我是传奇][高清RMVB][1280×720][中英双字幕].RMVB" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 hevc_qsv -tag:v:0 hvc1 -preset veryfast -b:v 4184342 -maxrate 4184342 -bufsize 8368684 -profile:v:0 main -level 50 -g:v:0 72 -keyint_min:v:0 72 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw,ih*a),3440)/2)*2:trunc(ow/a/2)*2,format=nv12" -codec:a:0 libfdk_aac -ac 2 -ab 256000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename "6562cce61ede5aad9c91397ebea8c6e2-1.mp4" -start_number 0 -hls_base_url "hls/6562cce61ede5aad9c91397ebea8c6e2/" -hls_segment_filename "/volume2/@appdata/jellyfin/cache/transcodes/6562cce61ede5aad9c91397ebea8c6e2%d.mp4" -hls_playlist_type event -hls_list_size 0 -y "/volume2/@appdata/jellyfin/cache/transcodes/6562cce61ede5aad9c91397ebea8c6e2.m3u8"" [2024-11-16 22:52:44.358 +08:00] [ERR] [60] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 134 [2024-11-16 22:52:44.406 +08:00] [ERR] [60] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/videos/8443cdda-a900-8ba4-c4c2-646c7cd9b76c/live.m3u8". MediaBrowser.Common.FfmpegException: FFmpeg exited with code 134 at MediaBrowser.MediaEncoding.Transcoding.TranscodeManager.StartFfMpeg(StreamState state, String outputPath, String commandLineArguments, Guid userId, TranscodingJobType transcodingJobType, CancellationTokenSource cancellationTokenSource, String workingDirectory) at Jellyfin.Api.Controllers.DynamicHlsController.GetLiveHlsStream(Guid itemId, String container, Nullable1 static, String params, String tag, String deviceProfileId, String playSessionId, String segmentContainer, Nullable1 segmentLength, Nullable1 minSegments, String mediaSourceId, String deviceId, String audioCodec, Nullable1 enableAutoStreamCopy, Nullable1 allowVideoStreamCopy, Nullable1 allowAudioStreamCopy, Nullable1 breakOnNonKeyFrames, Nullable1 audioSampleRate, Nullable1 maxAudioBitDepth, Nullable1 audioBitRate, Nullable1 audioChannels, Nullable1 maxAudioChannels, String profile, String level, Nullable1 framerate, Nullable1 maxFramerate, Nullable1 copyTimestamps, Nullable1 startTimeTicks, Nullable1 width, Nullable1 height, Nullable1 videoBitRate, Nullable1 subtitleStreamIndex, Nullable1 subtitleMethod, Nullable1 maxRefFrames, Nullable1 maxVideoBitDepth, Nullable1 requireAvc, Nullable1 deInterlace, Nullable1 requireNonAnamorphic, Nullable1 transcodingMaxAudioChannels, Nullable1 cpuCoreLimit, String liveStreamId, Nullable1 enableMpegtsM2TsMode, String videoCodec, String subtitleCodec, String transcodeReasons, Nullable1 audioStreamIndex, Nullable1 videoStreamIndex, Nullable1 context, Dictionary2 streamOptions, Nullable1 maxWidth, Nullable1 maxHeight, Nullable1 enableSubtitlesInManifest, Boolean enableAudioVbrEncoding, Boolean alwaysBurnInSubtitleWhenTranscoding) at lambda_method1443(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager) at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager) at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager) at Jellyfin.Api.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context) at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

logs2:

下面是手动运行转码时的报错: root@John-Nas-SA6400:/var/packages/ffmpeg7/target/bin# /var/packages/ffmpeg7/target/bin/ffmpeg -hwaccel qsv -i "/volume2/video/2.动画/Ice.Age.Continental.Drift.2012.1080p.BluRay.x264.DTS-HDC/Ice.Age.Continental.Drift.2012.1080p.BluRay.x264.DTS-HDC.mkv" -c:v h264_qsv -y "/volume2/temp/Ice.Age.Continental.Drift.output.mp4" ffmpeg version 7.0.2-5 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 8.5.0 (GCC) configuration: --target-os=linux --cross-prefix=/github/workspace/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --prefix=/var/packages/ffmpeg7/target --extra-cflags=-I/github/workspace/spk/ffmpeg7/work-x64-7.1/install/var/packages/ffmpeg7/target/include --extra-ldflags=-L/github/workspace/spk/ffmpeg7/work-x64-7.1/install/var/packages/ffmpeg7/target/lib --extra-libs='-lxml2 -ldl -lm' --pkg-config=/usr/bin/pkg-config --ranlib=/github/workspace/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ranlib --enable-cross-compile --enable-rpath --enable-pic --enable-shared --enable-gpl --enable-version3 --disable-debug --disable-static --disable-doc --extra-version=5 --extra-cflags=-DSYNO_VIDEOSTATION --extra-cflags=-fno-if-conversion --extra-cflags=-O3 --extra-cflags=-Wno-deprecated-declarations --x86asmexe=nasm --enable-libcodec2 --enable-libxml2 --enable-demuxer=dash --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libopenjpeg --enable-libmp3lame --enable-libbluray --enable-libspeex --enable-libtheora --enable-libcaca --enable-libdc1394 --enable-libvorbis --enable-libwebp --enable-libzmq --enable-gnutls --enable-libopenh264 --enable-libopus --enable-libsoxr --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librabbitmq --enable-libtwolame --enable-libzvbi --enable-libx264 --enable-libx265 --enable-libvpx --enable-libshine --enable-chromaprint --enable-libdav1d --enable-librist --enable-libzimg --enable-libsnappy --enable-libfdk-aac --enable-nonfree --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-lto --enable-libdrm --enable-libmfx --enable-vaapi --enable-opencl --enable-libass --enable-frei0r libavutil 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat 61. 1.100 / 61. 1.100 libavdevice 61. 1.100 / 61. 1.100 libavfilter 10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc 58. 1.100 / 58. 1.100 [matroska,webm @ 0x55cee348ee40] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options [matroska,webm @ 0x55cee348ee40] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options [matroska,webm @ 0x55cee348ee40] Could not find codec parameters for stream 6 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options [vist#0:0/h264 @ 0x55cee34e78c0] WARNING: defaulting hwaccel_output_format to qsv for compatibility with old commandlines. This behaviour is DEPRECATED and will be removed in the future. Please explicitly set "-hwaccel_output_format qsv". Input #0, matroska,webm, from '/volume2/video/2.动画/Ice.Age.Continental.Drift.2012.1080p.BluRay.x264.DTS-HDC/Ice.Age.Continental.Drift.2012.1080p.BluRay.x264.DTS-HDC.mkv': Metadata: encoder : libebml v1.2.3 + libmatroska v1.3.0 creation_time : 2012-10-13T05:31:12.000000Z Duration: 01:27:45.31, start: 0.000000, bitrate: 13931 kb/s Chapters: Chapter #0:0: start 0.000000, end 204.037000 Metadata: title : 00:00:00.000 Chapter #0:1: start 204.037000, end 307.224000 Metadata: title : 00:03:24.037 Chapter #0:2: start 307.224000, end 573.406000 Metadata: title : 00:05:07.224 Chapter #0:3: start 573.406000, end 788.705000 Metadata: title : 00:09:33.406 Chapter #0:4: start 788.705000, end 955.329000 Metadata: title : 00:13:08.705 Chapter #0:5: start 955.329000, end 1102.643000 Metadata: title : 00:15:55.329 Chapter #0:6: start 1102.643000, end 1343.717000 Metadata: title : 00:18:22.643 Chapter #0:7: start 1343.717000, end 1556.555000 Metadata: title : 00:22:23.717 Chapter #0:8: start 1556.555000, end 1757.965000 Metadata: title : 00:25:56.555 Chapter #0:9: start 1757.965000, end 1977.601000 Metadata: title : 00:29:17.965 Chapter #0:10: start 1977.601000, end 2174.381000 Metadata: title : 00:32:57.601 Chapter #0:11: start 2174.381000, end 2321.653000 Metadata: title : 00:36:14.381 Chapter #0:12: start 2321.653000, end 2628.709000 Metadata: title : 00:38:41.653 Chapter #0:13: start 2628.709000, end 2729.644000 Metadata: title : 00:43:48.709 Chapter #0:14: start 2729.644000, end 2978.976000 Metadata: title : 00:45:29.644 Chapter #0:15: start 2978.976000, end 3229.476000 Metadata: title : 00:49:38.976 Chapter #0:16: start 3229.476000, end 3442.856000 Metadata: title : 00:53:49.476 Chapter #0:17: start 3442.856000, end 3751.039000 Metadata: title : 00:57:22.856 Chapter #0:18: start 3751.039000, end 4088.334000 Metadata: title : 01:02:31.039 Chapter #0:19: start 4088.334000, end 4270.475000 Metadata: title : 01:08:08.334 Chapter #0:20: start 4270.475000, end 4394.640000 Metadata: title : 01:11:10.475 Chapter #0:21: start 4394.640000, end 4613.400000 Metadata: title : 01:13:14.640 Chapter #0:22: start 4613.400000, end 4763.634000 Metadata: title : 01:16:53.400 Chapter #0:23: start 4763.634000, end 5265.312000 Metadata: title : 01:19:23.634 Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x800, SAR 1:1 DAR 12:5, 23.98 fps, 23.98 tbr, 1k tbn (default) Stream #0:1(eng): Audio: dts (dca) (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default) Stream #0:2(chi): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s Metadata: title : mandarin Stream #0:3(chi): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s Metadata: title : cantonese Stream #0:4(eng): Subtitle: hdmv_pgs_subtitle (pgssub) (default) Stream #0:5(chi): Subtitle: hdmv_pgs_subtitle (pgssub) Metadata: title : 台译中字 Stream #0:6(chi): Subtitle: hdmv_pgs_subtitle (pgssub) Metadata: title : 港译中字 [AVHWDeviceContext @ 0x55cee34e7640] Error initializing an MFX session: -3. Device creation failed: -1313558101. [vist#0:0/h264 @ 0x55cee34e78c0] [dec:h264_qsv @ 0x55cee34c8f40] No device available for decoder: device type qsv needed for codec h264_qsv. [vist#0:0/h264 @ 0x55cee34e78c0] [dec:h264_qsv @ 0x55cee34c8f40] Hardware device setup failed for decoder: Unknown error occurred [vost#0:0/h264_qsv @ 0x55cee34e9f00] Error initializing a simple filtergraph Error opening output file /volume2/temp/Ice.Age.Continental.Drift.output.mp4. Error opening output files: Unknown error occurred

shikaiwei1 avatar Nov 16 '24 15:11 shikaiwei1

解决了吗?我这边N100也是转码失败

langsisi avatar Dec 21 '24 11:12 langsisi

后来用docker跑jellfin,可以正常硬解了

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年12月21日 19:29 | | 收件人 | @.> | | 抄送至 | John @.>@.> | | 主题 | Re: [RROrg/rr] N100核显直通,ffmpeg只要使用qsv转码就会报错 (Issue #4391) |

解决了吗?我这边N100也是转码失败

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

shikaiwei1 avatar Dec 21 '24 11:12 shikaiwei1

version: '3' services: emby: image: jellyfin/jellyfin container_name: jellyfin2 # 容器名称 ports: - '8296:8096' # 将容器的 8096 端口映射到主机的 8296 端口 volumes: - /volume2/docker/jellyfin2/config:/config
- /volume2/docker/jellyfin2/cache:/cache - /volume3/迅雷:/media privileged: true devices: - /dev/dri:/dev/dri # 将主机的 /dev/dri 设备挂载到容器 我用docker还是不行,缺少了什么吗?

langsisi avatar Dec 22 '24 10:12 langsisi

docker run -d --volume /volume2/docker/jellyfin2/config:/config --volume /volume2/docker/jellyfin2/cache:/cache --mount type=bind,source=/volume3/迅雷,target=/media --net=host --restart=always --device /dev/dri/renderD128:/dev/dri/renderD128 --device /dev/dri/card0:/dev/dri/card0 --name="jellyfin2" jellyfin/jellyfin 容器运行是正常的,有些视频不能解码,有的能硬解

langsisi avatar Dec 22 '24 10:12 langsisi

问题终于解决了,使用nyanmisaka/jellyfin镜像,可以硬解了,记录一下,方便其他人看到: version: '3' services: jellyfin: volumes: - /volume2/docker/jellyfin/config:/config - /volume2/docker/jellyfin/cache:/cache - /volume3/迅雷:/media network_mode: host restart: always privileged: true ports: - 8096:8096 devices: - /dev/dri/renderD128:/dev/dri/renderD128 - /dev/dri/card0:/dev/dri/card0 container_name: jellyfin image: nyanmisaka/jellyfin

langsisi avatar Dec 23 '24 07:12 langsisi

问题终于解决了,使用nyanmisaka/jellyfin镜像,可以硬解了,记录一下,方便其他人看到: version: '3' services: jellyfin: volumes: - /volume2/docker/jellyfin/config:/config - /volume2/docker/jellyfin/cache:/cache - /volume3/迅雷:/media network_mode: host restart: always privileged: true ports: - 8096:8096 devices: - /dev/dri/renderD128:/dev/dri/renderD128 - /dev/dri/card0:/dev/dri/card0 container_name: jellyfin image: nyanmisaka/jellyfin

我这边硬解会出现播放器致命错误,然后退出,12300T物理机安装的黑群,是按照你的配置构建的,不知道什么原因

zhouhuan18 avatar Jan 01 '25 15:01 zhouhuan18