Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMD AMF H264(AVC)/H265(HEVC) seg faults in jellyfin ffmpeg, while it works fine in system ffmpeg #188

Open
CosmicFusion opened this issue Oct 15, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@CosmicFusion
Copy link

Describe The Bug
Attempting to encode a video using jellyfin ffmpeg results in a segfault

Steps To Reproduce

  1. Install vulkan-amdgpu-pro, amf-amdgpu-pro, amdgpu-dkms-firmware
  2. run jellyfin-ffmpeg with vk_pro (to use vulkan-amdgpu-pro)

Expected Behavior
A Functional Encode just like the system ffmpeg build

System (please complete the following information):

  • Platform: GNU/Linux
  • Operating System: Ubuntu 22.04 LTS
  • Virtualization: None
  • Jellyfin Version: 10.8.5
  • Jellyfin-FFmpeg Version: 5.1.2-Jellyfin
  • Hardware Acceleration: AMD AMF
  • CPU & GPU Model: Ryzen 9 4900H, Vega 8

MediaInfo

FFmpeg Logs

/videos/bd8d732e-8ea0-b584-b66c-a0948bc39ce1/hls1/main/0.ts
 
{"Protocol":0,"Id":"bd8d732e8ea0b584b66ca0948bc39ce1","Path":"/data/media/In.Bruges.2008.2160p.UHD.BluRay.x265-B0MBARDiERS/in.bruges.2008.2160p.uhd.bluray.x265-b0mbardiers.mkv","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mkv,webm","Size":42531713024,"Name":"in.bruges.2008.2160p.uhd.bluray.x265-b0mbardiers","IsRemote":false,"ETag":"69d26c17a9c32234ecc0e67120482feb","RunTimeTicks":64131309568,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"OpenToken":null,"RequiresClosing":false,"LiveStreamId":null,"BufferMs":null,"RequiresLooping":false,"SupportsProbing":true,"VideoType":0,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"hevc","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":"bt2020nc","ColorTransfer":"smpte2084","ColorPrimaries":"bt2020","DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":null,"VideoRange":"HDR","VideoRangeType":"HDR10","VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"4K HEVC HDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":53055785,"BitDepth":10,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":false,"Height":1604,"Width":3840,"AverageFrameRate":24,"RealFrameRate":24,"Profile":"Main 10","Type":1,"AspectRatio":"2.40:1","Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p10le","Level":153,"IsAnamorphic":null},{"Codec":"dts","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":null,"VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"English - DTS-HD MA - 5.1 - Default","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"5.1","BitRate":3876985,"BitDepth":24,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":"DTS-HD MA","Type":0,"AspectRatio":null,"Index":1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"PGSSUB","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":"English","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Undefined","LocalizedDefault":"Default","LocalizedForced":"Forced","LocalizedExternal":"External","DisplayTitle":"English - PGSSUB","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":56932770,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}
 
/usr/lib/jellyfin-ffmpeg/ffmpeg_amf -analyzeduration 200M  -canvas_size 2584x1080 -i file:"/data/media/In.Bruges.2008.2160p.UHD.BluRay.x265-B0MBARDiERS/in.bruges.2008.2160p.uhd.bluray.x265-b0mbardiers.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -codec:v:0 h264_amf -quality speed -rc cbr -qmin 0 -qmax 32 -b:v 88426308 -maxrate 88426308 -bufsize 176852616 -profile:v:0 high -level 51 -g:v:0 72 -keyint_min:v:0 72 -filter_complex "[0:2]scale=trunc(min(max(iw\,ih*a)\,min(3840\,1604*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(3840/a\,1604))/2)*2[sub];[0:0]setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,min(3840\,1604*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(3840/a\,1604))/2)*2,format=yuv420p[main];[main][sub]overlay=eof_action=endall:shortest=1:repeatlast=0" -start_at_zero -codec:a:0 libfdk_aac -ac 2 -ab 384000 -af "volume=2" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/var/lib/jellyfin/transcodes/3110671981f9831601a325a0d9164b62%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/var/lib/jellyfin/transcodes/3110671981f9831601a325a0d9164b62.m3u8"
 
 
ffmpeg version 5.1.2-Jellyfin Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3f --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-shared --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-static --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
 
 
[matroska,webm @ 0x55767a9750c0] Could not find codec parameters for stream 2 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' (200000000) and 'probesize' (5000000) options
Input #0, matroska,webm, from 'file:/data/media/In.Bruges.2008.2160p.UHD.BluRay.x265-B0MBARDiERS/in.bruges.2008.2160p.uhd.bluray.x265-b0
mbardiers.mkv':
  Metadata:
    encoder         : libebml v1.4.2 + libmatroska v1.6.4
    creation_time   : 2022-10-02T12:30:13.000000Z
  Duration: 01:46:53.13, start: 0.000000, bitrate: 53055 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 604.750000
      Metadata:
        title           : Chapter 01
    Chapter #0:1: start 604.750000, end 1223.625000
      Metadata:
        title           : Chapter 02
    Chapter #0:2: start 1223.625000, end 1836.333000
 
      Metadata:
        title           : Chapter 03
    Chapter #0:3: start 1836.333000, end 2603.000000
      Metadata:
        title           : Chapter 04
    Chapter #0:4: start 2603.000000, end 3101.375000
      Metadata:
        title           : Chapter 05
    Chapter #0:5: start 3101.375000, end 3550.708000
      Metadata:
        title           : Chapter 06
    Chapter #0:6: start 3550.708000, end 4036.292000
      Metadata:
        title           : Chapter 07
    Chapter #0:7: start 4036.292000, end 4652.458000
      Metadata:
        title           : Chapter 08
    Chapter #0:8: start 4652.458000, end 5447.625000
      Metadata:
        title           : Chapter 09
    Chapter #0:9: start 5447.625000, end 6412.125000
      Metadata:
        title           : Chapter 10
    Chapter #0:10: start 6412.125000, end 6413.131000
      Metadata:
        title           : Chapter 11
  Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x1604 [SAR 1:1 DAR 960:401], 24 fps, 24 tbr, 1k tbn (default)
    Metadata:
      BPS             : 49159413
      DURATION        : 01:46:53.125000000
      NUMBER_OF_FRAMES: 153915
      NUMBER_OF_BYTES : 39408183148
      _STATISTICS_WRITING_APP: mkvmerge v69.0.0 ('Day And Age') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2022-10-02 12:30:13
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:1(eng): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), s32p (24 bit) (default)
    Metadata:
      BPS             : 3876985
      DURATION        : 01:46:53.131000000
      NUMBER_OF_FRAMES: 601231
      NUMBER_OF_BYTES : 3107951792
      _STATISTICS_WRITING_APP: mkvmerge v69.0.0 ('Day And Age') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2022-10-02 12:30:13
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:2(eng): Subtitle: hdmv_pgs_subtitle, 2584x1080
    Metadata:
      title           : English
      BPS             : 34584
      DURATION        : 01:40:02.083000000
      NUMBER_OF_FRAMES: 2246
      NUMBER_OF_BYTES : 25947318
      _STATISTICS_WRITING_APP: mkvmerge v69.0.0 ('Day And Age') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2022-10-02 12:30:13
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
  Stream #0:0 (hevc) -> setparams:default (graph 0)
  Stream #0:2 (pgssub) -> scale:default (graph 0)
  overlay:default (graph 0) -> Stream #0:0 (h264_amf)
  Stream #0:1 -> #0:1 (dts (dca) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[matroska,webm @ 0x55767a9750c0] sub2video: using 3840x1604 canvas
/usr/bin/vk_pro: line 52:  5863 Segmentation fault      (core dumped) "$@"

Additional Context
System ffmpeg from this ppa https://launchpad.net/~cosmohq/+archive/ubuntu/multimedia-test work fine!
in both hevc and avc

@CosmicFusion CosmicFusion added the bug Something isn't working label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant