Jump to content

Enable hardware acceleration on FreeBSD


Duffyx

Recommended Posts

It's probably something that needs to be included in the ffmpeg build but we're just not sure what that is yet. If you know anyone from the FreeBSD community who is seasoned with ffmpeg and knowledgeable about this, we'd be interested in hiring them to help us get this done. 

Link to comment
Share on other sites

All I know is I tried it and it doesn't work in TrueNAS which uses FreeBSD. Anyone here seen it work in TrueNAS?

Link to comment
Share on other sites

3 hours ago, Luke said:

It's probably something that needs to be included in the ffmpeg build but we're just not sure what that is yet. If you know anyone from the FreeBSD community who is seasoned with ffmpeg and knowledgeable about this, we'd be interested in hiring them to help us get this done. 

So ffmpeg determines the list of encoders and decoders that Emby uses?

If anyone has ffmpeg working with hardware acceleration in FreeBSD, then that would be the build to use. According to some posters, they have it working. Let's get it done.

Link to comment
Share on other sites

Does ffdetect use procfs to detect hardware capabilities? => This might not work on FreeBSD.

I don't think its related to ffmpeg itself but more to ffdetect. The ffmpeg build in the emby-server FreeBSD port is almost identical to the official ffmpeg port. Or how do they interact? The way I see it, ffmpeg just gets stupidly executed by emby-server. The command executed by emby-server is depending on what ffdetect finds for which hardware to use and thus which flags to pass to the ffmpeg command.

PS: I found this:

/dev/dri/card0 is a symlink to ../drm/0 on FreeBSD. When CK2 tries to determine the device type, the path gets resolved, and so it's not card0. Also the subsystem is not set by libudev-devd.

Maybe this is also something you might bump against:

FreeBSD has the option to mount a linsysfs which is pretty similar to Linux. Would this help?

 

Edited by Duffyx
Link to comment
Share on other sites

39 minutes ago, Duffyx said:

Does ffdetect use procfs to detect hardware capabilities? => This might not work on FreeBSD.

I don't think its related to ffmpeg itself but more to ffdetect. The ffmpeg build in the emby-server FreeBSD port is almost identical to the official ffmpeg port. Or how do they interact? The way I see it, ffmpeg just gets stupidly executed by emby-server. The command executed by emby-server is depending on what ffdetect finds for which hardware to use and thus which flags to pass to the ffmpeg command.

PS: I found this:

/dev/dri/card0 is a symlink to ../drm/0 on FreeBSD. When CK2 tries to determine the device type, the path gets resolved, and so it's not card0. Also the subsystem is not set by libudev-devd.

Maybe this is also something you might bump against:

FreeBSD has the option to mount a linsysfs which is pretty similar to Linux. Would this help?

 

ffdetect uses the same libraries that ffmpeg uses, so generally if doesn't work in one then it won't work in the other. But of course there might be something freebsd-specific at play that we're not aware of yet.

Link to comment
Share on other sites

11 minutes ago, Luke said:

ffdetect uses the same libraries that ffmpeg uses, so generally if doesn't work in one then it won't work in the other. But of course there might be something freebsd-specific at play that we're not aware of yet.

Ok I see, so we are using native function calls from those libraries. I expect libva-utils (https://github.com/intel/libva-utils) to utilize the same or similar functions to achieve the list of render modes. Maybe check the source there? Just a rough idea as vainfo does seem to work on FreeBSD.

Link to comment
Share on other sites

Hi Guys,

last time I had looked into this (2-3y), there's didn't seem to be (realistic) support for VAAPI on FreeBSD (without going into extreme tweaking/development), that's why we hadn't spent any more effort in this area.

What you can take as a key indicator is whether libva is working and va-info runs successfully and returns a detected device. I've seen some va-info results, that seems to be promising.

To go forward, I'd need some help from you for getting some logs and answering a few questions:

1. What is IOCAGE?

Unfortunately I'm totally agnostic of all those consumer-grade NAS devices and with FreeBSD it's not much better, so please apologize when I may sound a bit clueless here.
IOCAGE sounds like some virtualization or containerization - what is it exactly?
Are those cages running their own operating system? (if yes - which ones?`)

2. ffdetect

It seems that some of you were able to run ffdetect manually - could you please all try this command and post the results?

ffdetect -hide_banner -show_program_version -loglevel 99 -show_error -show_log 99 vaencdec -print_format json

3. ffmpeg transcoding logs

Some of you have mentioned to be able to successfully run ffmpeg with VAAPI hw acceleration.

Could you please post ffmpeg logs showing that?

(please also add -loglevel debug as the first parameter to the command. No need to keep it running, you can cancel right after the initialization is done and it's running)

4. Plex Transcoding Logs

It has been claimed that hw acceleration is working with Plex. 

Could you please post a transcoding log from Plex which shows hw acceleration working?

 

If you could get all this information for me, this would be awesome!

Thanks a lot,
softworkz

PS: I apologize for the confusing H.264 hw encoder entry. It is an artifact from early days and it was intended for systems where hw detection does not work - it's time to remove that one, I guess.

Link to comment
Share on other sites

bingemeister
33 minutes ago, softworkz said:

1. What is IOCAGE?

What you are talking about are Jails. iocage is just a management tool for them. Jails are a security feature of FreeBSD and offer an easy way to enclose applications in a safe chroot environment to protect the resources of the host and other jails. Jails don't run a separate operating system.

33 minutes ago, softworkz said:

2. ffdetect

# /usr/local/lib/emby-server/bin/ffdetect -hide_banner -show_program_version -loglevel 99 -show_error -show_log 99 vaencdec -print_format json
ffdetect version 4.3.0-emby_2020_05_23 Copyright (c) 2018-2019 softworkz for Emby LLC
  built with FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
  configuration: --cc=clang --prefix=/usr/home/embybuilder/x64_freebsd12/ffdetect-x64_freebsd12/staging --pkg-config=pkg-config --disable-debug --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-vdpau --enable-vaapi --extra-libs='-ldrm -lva -lva-drm -ldl -lm -lpthread' --arch=x86_64 --disable-shared --enable-static
  libavutil      56. 36.100 / 56. 36.100
{
    "ProgramVersion": {
        "Version": "4.3.0-emby_2020_05_23",
        "Copyright": "Copyright (c) 2018-2019 softworkz for Emby Llc",
        "Compiler": "FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)",
        "Configuration": "--cc=clang --prefix=/usr/home/embybuilder/x64_freebsd12/ffdetect-x64_freebsd12/staging --pkg-config=pkg-config --disable-debug --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-vdpau --enable-vaapi --extra-libs='-ldrm -lva -lva-drm -ldl -lm -lpthread' --arch=x86_64 --disable-shared --enable-static"
    },
    "Devices": [
Begin GetVaAdapterInfo
Found -1 device entries
End GetVaAdapterInfo

    ],
    "Log": [
        {
            "Level": 48,
            "Category": 0,
            "Message": "Begin GetVaAdapterInfo"
        },
        {
            "Level": 40,
            "Category": 0,
            "Message": "Found -1 device entries"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "End GetVaAdapterInfo"
        }
    ]
}

 

33 minutes ago, softworkz said:

3. ffmpeg transcoding logs

# ffmpeg -loglevel debug -vaapi_device /dev/dri/card0 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
  configuration: --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --pkgconfigdir=/usr/local/libdata/pkgconfig --enable-shared --enable-pic --enable-gpl --enable-avresample --cc=cc --cxx=c++ --disable-alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --enable-libaom --disable-libaribb24 --enable-asm --enable-libass --disable-libbs2b --disable-libcaca --disable-libcdio --disable-libcelt --disable-libcodec2 --enable-libdav1d --disable-libdavs2 --disable-libdc1394 --disable-debug --enable-htmlpages --enable-libdrm --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --disable-libfribidi --disable-gcrypt --disable-libglslang --disable-libgme --enable-gmp --enable-gnutls --enable-version3 --disable-libgsm --enable-iconv --disable-libilbc --disable-libjack --disable-libklvanc --disable-libkvazaar --disable-ladspa --disable-libmp3lame --disable-liblensfun --disable-libbluray --disable-librsvg --disable-librtmp --enable-libxml2 --disable-lto --disable-lv2 --disable-mbedtls --disable-libmfx --disable-libmodplug --disable-libmysofa --disable-nonfree --disable-openal --disable-opencl --enable-libopencv --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-libopenmpt --disable-openssl --enable-optimizations --enable-libopus --disable-pocketsphinx --disable-libpulse --disable-librabbitmq --disable-librav1e --enable-runtime-cpudetect --disable-librubberband --disable-sdl2 --disable-libsmbclient --disable-libsnappy --disable-sndio --disable-libsoxr --disable-libspeex --disable-libsrt --disable-libssh --disable-libtensorflow --disable-libtesseract --enable-libtheora --disable-libtwolame --enable-libv4l2 --enable-vaapi --disable-vapoursynth --enable-vdpau --disable-libvidstab --disable-libvmaf --enable-libvorbis --disable-libvo-amrwbenc --enable-libvpx --disable-vulkan --disable-libwavpack --disable-libwebp --enable-libx264 --enable-libx265 --disable-libxavs2 --enable-libxcb --enable-libxvid --disable-outdev=xv --disable-libzimg --disable-libzmq --disable-libzvbi
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-vaapi_device' ... matched as option 'vaapi_device' (set VAAPI hardware device (DRM path or X11 display name)) with argument '/dev/dri/card0'.
Reading option '-i' ... matched as input url with argument 'input.mp4'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'format=nv12,hwupload'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'h264_vaapi'.
Reading option 'output.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option vaapi_device (set VAAPI hardware device (DRM path or X11 display name)) with argument /dev/dri/card0.
[AVHWDeviceContext @ 0x8009fe1c0] libva: VA-API version 1.9.0
[AVHWDeviceContext @ 0x8009fe1c0] libva: Trying to open /usr/local/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x8009fe1c0] libva: va_openDriver() returns -1
[AVHWDeviceContext @ 0x8009fe1c0] libva: Trying to open /usr/local/lib/dri/i965_drv_video.so
[AVHWDeviceContext @ 0x8009fe1c0] libva: Found init function __vaDriverInit_1_8
[AVHWDeviceContext @ 0x8009fe1c0] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x8009fe1c0] Initialised VAAPI connection: version 1.9
[AVHWDeviceContext @ 0x8009fe1c0] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0x8009fe1c0] Format 0x30323449 -> yuv420p.
[AVHWDeviceContext @ 0x8009fe1c0] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x8009fe1c0] Format 0x32595559 -> yuyv422.
[AVHWDeviceContext @ 0x8009fe1c0] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0x8009fe1c0] Format 0x48323234 -> yuv422p.
[AVHWDeviceContext @ 0x8009fe1c0] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0x8009fe1c0] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0x8009fe1c0] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0x8009fe1c0] VAAPI driver: Intel i965 driver for Intel(R) Haswell Server - 2.4.1.
[AVHWDeviceContext @ 0x8009fe1c0] Driver not found in known nonstandard list, using standard behaviour.
Successfully parsed a group of options.
Parsing a group of options: input url input.mp4.
Successfully parsed a group of options.
Opening an input file: input.mp4.

.... a lot of stts ctts info...

[hevc @ 0x80670f900] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80670f900] Decoding VPS
[hevc @ 0x80670f900] Main 10 profile bitstream
[hevc @ 0x80670f900] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80670f900] Decoding SPS
[hevc @ 0x80670f900] Main 10 profile bitstream
[hevc @ 0x80670f900] Decoding VUI
[hevc @ 0x80670f900] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80670f900] Decoding PPS
[hevc @ 0x80670f900] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80670f900] Decoding SEI
[hevc @ 0x80670f900] Skipped PREFIX SEI 5
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x8067bac00] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x8067bac00] After avformat_find_stream_info() pos: 34377 bytes read:1155333 seeks:2 frames:3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.20.100
  Duration: 00:21:57.44, start: 0.000000, bitrate: 1883 kb/s
    Stream #0:0(und), 1, 1/16000: Video: hevc (Main 10), 1 reference frame (hvc1 / 0x31637668), yuv420p10le(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 0/1, 1741 kb/s, 23.98 fps, 23.98 tbr, 16k tbn, 23.98 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng), 2, 1/48000: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 135 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Successfully opened the file.
Parsing a group of options: output url output.mp4.
Applying option vf (set video filters) with argument format=nv12,hwupload.
Applying option c:v (codec name) with argument h264_vaapi.
Successfully parsed a group of options.
Opening an output file: output.mp4.
File 'output.mp4' already exists. Overwrite? [y/N] y
[file @ 0x80787c100] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
detected 4 logical cores
[hevc @ 0x80766ca00] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80766ca00] Decoding VPS
[hevc @ 0x80766ca00] Main 10 profile bitstream
[hevc @ 0x80766ca00] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80766ca00] Decoding SPS
[hevc @ 0x80766ca00] Main 10 profile bitstream
[hevc @ 0x80766ca00] Decoding VUI
[hevc @ 0x80766ca00] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80766ca00] Decoding PPS
[hevc @ 0x80766ca00] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80766ca00] Decoding SEI
[hevc @ 0x80766ca00] Skipped PREFIX SEI 5
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[graph_1_in_0_1 @ 0x8067e7c00] Setting 'time_base' to value '1/48000'
[graph_1_in_0_1 @ 0x8067e7c00] Setting 'sample_rate' to value '48000'
[graph_1_in_0_1 @ 0x8067e7c00] Setting 'sample_fmt' to value 'fltp'
[graph_1_in_0_1 @ 0x8067e7c00] Setting 'channel_layout' to value '0x3'
[graph_1_in_0_1 @ 0x8067e7c00] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
[format_out_0_1 @ 0x8067e7d80] Setting 'sample_fmts' to value 'fltp'
[format_out_0_1 @ 0x8067e7d80] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[AVFilterGraph @ 0x80787ca00] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 2 times
[hevc @ 0x80766ca00] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0, temporal_id: 0
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[hevc @ 0x80766ca00] Format yuv420p10le chosen by get_format().
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[hevc @ 0x80766d900] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 2 times
[hevc @ 0x80766e300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[hevc @ 0x80766e300] Output frame with POC 0.
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[hevc @ 0x80766ed00] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[hevc @ 0x80766ed00] Output frame with POC 1.
[hevc @ 0x80766f700] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80766f700] Output frame with POC 2.
[hevc @ 0x80766ca00] Decoded frame with POC 0.
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 2 times
[hevc @ 0x80766ca00] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80766ca00] Output frame with POC 3.
[hevc @ 0x80766d900] Decoded frame with POC 4.
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 2 times
[hevc @ 0x80766d900] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x80766e300] Decoded frame with POC 2.
[hevc @ 0x80766d900] Output frame with POC 4.
[hevc @ 0x80766f700] Decoded frame with POC 3.
[hevc @ 0x80766ed00] Decoded frame with POC 1.
[Parsed_format_0 @ 0x8067e7f00] Setting 'pix_fmts' to value 'nv12'
[graph 0 input from stream 0:0 @ 0x8067e8080] Setting 'video_size' to value '1920x1080'
[graph 0 input from stream 0:0 @ 0x8067e8080] Setting 'pix_fmt' to value '64'
[graph 0 input from stream 0:0 @ 0x8067e8080] Setting 'time_base' to value '1/16000'
[graph 0 input from stream 0:0 @ 0x8067e8080] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x8067e8080] Setting 'frame_rate' to value '24000/1001'
[graph 0 input from stream 0:0 @ 0x8067e8080] w:1920 h:1080 pixfmt:yuv420p10le tb:1/16000 fr:24000/1001 sar:1/1
[format @ 0x8067e8200] Setting 'pix_fmts' to value 'vaapi_vld'
[auto_scaler_0 @ 0x8067e82c0] Setting 'flags' to value 'bicubic'
[auto_scaler_0 @ 0x8067e82c0] w:iw h:ih flags:'bicubic' interl:0
[Parsed_format_0 @ 0x8067e7f00] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_format_0'
[AVFilterGraph @ 0x80787c400] query_formats: 5 queried, 3 merged, 1 already done, 0 delayed
[auto_scaler_0 @ 0x8067e82c0] w:1920 h:1080 fmt:yuv420p10le sar:1/1 -> w:1920 h:1080 fmt:nv12 sar:1/1 flags:0x4
[hwupload @ 0x807b84e80] Surface format is nv12.
[AVHWFramesContext @ 0x8077f9500] Created surface 0x4000000.
[AVHWFramesContext @ 0x8077f9500] Direct mapping possible.
[AVHWFramesContext @ 0x8077f9500] Map surface 0x4000000.
[AVHWFramesContext @ 0x8077f9500] Unmap surface 0x4000000.
[h264_vaapi @ 0x806712100] Using input frames context (format vaapi_vld) with h264_vaapi encoder.
[h264_vaapi @ 0x806712100] Input surface format is nv12.
[h264_vaapi @ 0x806712100] Using VAAPI profile VAProfileH264High (7).
[h264_vaapi @ 0x806712100] Using VAAPI entrypoint VAEntrypointEncSlice (6).
[h264_vaapi @ 0x806712100] Using VAAPI render target format YUV420 (0x1).
[h264_vaapi @ 0x806712100] Driver supports RC modes CQP, CBR, VBR.
[h264_vaapi @ 0x806712100] Driver does not support ICQ RC mode.
[h264_vaapi @ 0x806712100] No quality level set; using default (20).
[h264_vaapi @ 0x806712100] RC mode: CQP.
[h264_vaapi @ 0x806712100] RC quality: 20.
[h264_vaapi @ 0x806712100] RC framerate: 24000/1001 (23.98 fps).
[h264_vaapi @ 0x806712100] Using intra, P- and B-frames (supported references: 1 / 1).
[h264_vaapi @ 0x806712100] All wanted packed headers available (wanted 0xd, found 0x1f).
[h264_vaapi @ 0x806712100] Using nv12 as format of reconstructed frames.
[AVHWFramesContext @ 0x8077f9780] Created surface 0x4000001.
[AVHWFramesContext @ 0x8077f9780] Direct mapping possible.
[h264_vaapi @ 0x806712100] Using fixed QP = 20 / 20 / 24 for IDR- / P- / B-frames.
[h264_vaapi @ 0x806712100] Using level 4.
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.45.100
    Stream #0:0(und), 0, 1/24000: Video: h264 (h264_vaapi) (High), 1 reference frame (avc1 / 0x31637661), vaapi_vld, 1920x1080 [SAR 1:1 DAR 16:9], 0/1, q=-1--1, 23.98 fps, 24k tbn, 23.98 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.91.100 h264_vaapi
    Stream #0:1(eng), 0, 1/48000: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, delay 1024, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc58.91.100 aac
*** 3 dup!

I cut the log off at this point. If you need more just tell me.

I ran this inside a jail. To make it work I only had to make the device files (/dev/dri/*) accessible to the jail using devfs rules.

Edited by bingemeister
Link to comment
Share on other sites

1) IOCAGE is a front-end to setup jails, the FreeBSD native of docker containers. (https://www.freebsd.org/doc/handbook/jails.html). A jail is basically a userland started by the kernel. Operating system level virtualization. (jails and the host share the same kernel). I use it to containerize services that I let access to from the outside of my network, like Emby, Nextcloud, LibreNMS etc.

2)  Can't help with this one as I haven't been able to get it working

3) Ffmpeg.log

4) Plex Transcoder Statistics (Elona Holmes was trascoding with HW accel)

 

Edit: PS: Bingemeister beat me to it :D

 

Plex Transcoder Statistics.2.log ffmpeg.log

Edited by Duffyx
Because
Link to comment
Share on other sites

Thanks a lot for your replies!

I think I found the issue. ffdetect tries to enumerate /sys/bus/pci/devices and that doesn't probably exist on FreeBSD.

Is there an equivalent?

Edited by softworkz
Link to comment
Share on other sites

There is no directory /dev/pci. TBH I don't think there is a "directory" alternative to the /sys/bus/pci/devices. On FreeBSD we execute "pciconf -l" to list all our pci devices.

Link to comment
Share on other sites

ffdetect is an application, not a shell script and as such it doesn't work by running other cli tools, so we'd have to see how pciconf  does it or find another way. Unfortunately this isn't something that can be done quickly, so it might take a while until we get to it.

A possible "quick solution" might be linsysfs (https://www.freebsd.org/cgi/man.cgi?query=linsysfs&sektion=5&manpath=FreeBSD+7.0-RELEASE) but I'm not sure whether it will provide the exact same structure..

 

Link to comment
Share on other sites

bingemeister
14 minutes ago, softworkz said:

ffdetect is an application, not a shell script and as such it doesn't work by running other cli tools, so we'd have to see how pciconf  does it or find another way. Unfortunately this isn't something that can be done quickly, so it might take a while until we get to it.

I don't see why a binary application wouldn't be able to run other processes to gather informationen.

But alternatively you should be able to get results from /dev/pci using the documented ioctl calls. Then you don't have to run other commands. And I'm pretty sure that's how pciconf works internally.

Edit: Yep, it uses /dev/pci and ioctl calls. See here and here.

Edited by bingemeister
Link to comment
Share on other sites

On 10/30/2020 at 10:51 PM, bingemeister said:

I don't see why a binary application wouldn't be able to run other processes to gather informationen.

Of course it would be possible. Many things are always possible....
Otherwise you are probably right regarding the use of ioctl - unfortunately that will take a while.

Though - there might be a change for a quick happy ending..

Extract the attached file to the root of your file system - then rerun ffdetect.

EDIT: Please see the fixed sys.tar from @bingemeister a few posts down.

 

Edited by softworkz
Link to comment
Share on other sites

bingemeister
56 minutes ago, softworkz said:

@Duffyx - In your case you'd need to rename the 'card0' file to 'renderD128'

Ah okay, I see what you're trying to do. Okay here are the results of my tests.

At first after adding the files I received this:

...
"Devices": [
Begin GetVaAdapterInfo
Found 1 device entries
Check device at index 0: /sys/bus/pci/devices/pci0000:00/class
Failed to open device at index 0: /sys/bus/pci/devices/pci0000:00/class
End GetVaAdapterInfo

    ],
    "Log": [
        {
            "Level": 48,
            "Category": 0,
            "Message": "Begin GetVaAdapterInfo"
        },
        {
            "Level": 40,
            "Category": 0,
            "Message": "Found 1 device entries"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "Check device at index 0: /sys/bus/pci/devices/pci0000:00/class"
        },
        {
            "Level": 24,
            "Category": 0,
            "Message": "Failed to open device at index 0: /sys/bus/pci/devices/pci0000:00/class"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "End GetVaAdapterInfo"
        }
    ]
}

So I moved all files inside 0000/00/01.0 one level down to pci0000:00. Then I got this:

"Devices": [
Begin GetVaAdapterInfo
Found 1 device entries
Check device at index 0: /sys/bus/pci/devices/pci0000:00/class
Adding adapter '/sys/bus/pci/devices/pci0000:00' - VendorId: 4660 DeviceId: 4369 - Subsystem: V: 6900, D: 4352
GetDeviceName: unable to open pci.ids file
GetDeviceName unable to load pci.ids file
       adapter '/sys/bus/pci/devices/pci0000:00' - VendorName: (null)
       adapter '/sys/bus/pci/devices/pci0000:00' - DeviceName: (null)
       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem VendorName: (null)
       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem DeviceName: (null)
Begin get_nodes
Found 1 drm entries
Found drm node '/dev/dri/card0'
End GetVaAdapterInfo
        {
            "DeviceIndex": 0,
            "DeviceInfo": {
                "VendorId": 4660,
                "DeviceId": 4369,
                "SubsytemVendorId": 6900,
                "SubsytemDeviceId": 4352,
                "DevPath": "/sys/bus/pci/devices/pci0000:00",
                "DrmCard": "/dev/dri/card0",
                "IsEnabled": 1,
                "IsBootVga": 1,
                "Error": {
                    "Number": -1,
                    "Message": "Failed to open the drm device (null)"
                }
            }
        }
    ],
    "Log": [
        {
            "Level": 48,
            "Category": 0,
            "Message": "Begin GetVaAdapterInfo"
        },
        {
            "Level": 40,
            "Category": 0,
            "Message": "Found 1 device entries"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "Check device at index 0: /sys/bus/pci/devices/pci0000:00/class"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "Adding adapter '/sys/bus/pci/devices/pci0000:00' - VendorId: 4660 DeviceId: 4369 - Subsystem: V: 6900, D: 4352"
        },
        {
            "Level": 24,
            "Category": 0,
            "Message": "GetDeviceName: unable to open pci.ids file "
        },
        {
            "Level": 24,
            "Category": 0,
            "Message": "GetDeviceName unable to load pci.ids file"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - VendorName: (null)"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - DeviceName: (null)"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem VendorName: (null)"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem DeviceName: (null)"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "Begin get_nodes"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "Found 1 drm entries"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "Found drm node '/dev/dri/card0'"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "End GetVaAdapterInfo"
        }
    ]
}

Okay, we're getting closer. Now the different location of pci.ids in FreeBSD is the issue. After installing the misc/pciids port, the file can be found here: /usr/local/share/pciids/pci.ids. Easily fixed with a symbolic link. So finally:

"Devices": [
Begin GetVaAdapterInfo
Found 1 device entries
Check device at index 0: /sys/bus/pci/devices/pci0000:00/class
Adding adapter '/sys/bus/pci/devices/pci0000:00' - VendorId: 4660 DeviceId: 4369 - Subsystem: V: 6900, D: 4352
GetDeviceName - Start
find_record: no record found
       adapter '/sys/bus/pci/devices/pci0000:00' - VendorName: (null)
GetDeviceName - Start
find_record: no record found
       adapter '/sys/bus/pci/devices/pci0000:00' - DeviceName: (null)
GetDeviceName - Start
find_record: found: Red Hat, Inc.
       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem VendorName: Red Hat, Inc.
GetDeviceName - Start
find_record: no record found
find_record: no record found
       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem DeviceName: (null)
Begin get_nodes
Found 1 drm entries
Found drm node '/dev/dri/card0'
End GetVaAdapterInfo
        {
            "DeviceIndex": 0,
            "DeviceInfo": {
                "SubsytemVendorName": "Red Hat, Inc.",
                "VendorId": 4660,
                "DeviceId": 4369,
                "SubsytemVendorId": 6900,
                "SubsytemDeviceId": 4352,
                "DevPath": "/sys/bus/pci/devices/pci0000:00",
                "DrmCard": "/dev/dri/card0",
                "IsEnabled": 1,
                "IsBootVga": 1,
                "Error": {
                    "Number": -1,
                    "Message": "Failed to open the drm device (null)"
                }
            }
        }
    ],
    "Log": [
        {
            "Level": 48,
            "Category": 0,
            "Message": "Begin GetVaAdapterInfo"
        },
        {
            "Level": 40,
            "Category": 0,
            "Message": "Found 1 device entries"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "Check device at index 0: /sys/bus/pci/devices/pci0000:00/class"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "Adding adapter '/sys/bus/pci/devices/pci0000:00' - VendorId: 4660 DeviceId: 4369 - Subsystem: V: 6900, D: 4352"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "GetDeviceName - Start"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "find_record: no record found"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - VendorName: (null)"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "GetDeviceName - Start"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "find_record: no record found"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - DeviceName: (null)"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "GetDeviceName - Start"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "find_record: found: Red Hat, Inc."
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem VendorName: Red Hat, Inc."
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "GetDeviceName - Start"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "find_record: no record found"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "find_record: no record found"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem DeviceName: (null)"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "Begin get_nodes"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "Found 1 drm entries"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "Found drm node '/dev/dri/card0'"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "End GetVaAdapterInfo"
        }
    ]
}

I have no idea why it can't open /dev/dri/card0, though. It definitely exists and it can't be due to a lack of permissions as I am running this as root.

Link to comment
Share on other sites

Damn - so close...

The problem is that it collects the 'cardX' node name, but it only works with the render node. During the past years, it never occurred that there was a need to use a 'cardX' node.

Only idea I have would be to rename the 'card0' file to 'render0' (better not use the typical name with ..128) - and then create a symbolic link between from /dev/dri/card0 to /dev/dri/render0 - but I don't know whether that would even work...

Link to comment
Share on other sites

Or do you even have a renderDRI128 node? In that case, you would just need to rename the file to renderDRI128..

Edited by softworkz
Link to comment
Share on other sites

bingemeister

Success! Creating a link at /dev/dri/render0 did the trick! 😃

"Devices": [
Begin GetVaAdapterInfo
Found 1 device entries
Check device at index 0: /sys/bus/pci/devices/pci0000:00/class
Adding adapter '/sys/bus/pci/devices/pci0000:00' - VendorId: 4660 DeviceId: 4369 - Subsystem: V: 6900, D: 4352
GetDeviceName - Start
find_record: no record found
       adapter '/sys/bus/pci/devices/pci0000:00' - VendorName: (null)
GetDeviceName - Start
find_record: no record found
       adapter '/sys/bus/pci/devices/pci0000:00' - DeviceName: (null)
GetDeviceName - Start
find_record: found: Red Hat, Inc.
       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem VendorName: Red Hat, Inc.
GetDeviceName - Start
find_record: no record found
find_record: no record found
       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem DeviceName: (null)
Begin get_nodes
Found 1 drm entries
Found drm node '/dev/dri/render0'
End GetVaAdapterInfo
        {
            "DeviceIndex": 0,
            "DeviceInfo": {
                "SubsytemVendorName": "Red Hat, Inc.",
                "VendorId": 4660,
                "DeviceId": 4369,
                "SubsytemVendorId": 6900,
                "SubsytemDeviceId": 4352,
                "DevPath": "/sys/bus/pci/devices/pci0000:00",
                "DrmRender": "/dev/dri/render0",
                "IsEnabled": 1,
/dev/dri/render0: VA-API version: 1.9 (libva 1.8.0)
                "IsBootVga": 1,
                "ApiVersionMajor": 1,
/dev/dri/render0: Driver version: Intel i965 driver for Intel(R) Haswell Server - 2.4.1
                "ApiVersionMinor": 9,
                "Driver": "Intel i965 driver for Intel(R) Haswell Server - 2.4.1"
            },
            "Decoders": [
                {
                    "CodecName": "MPEG2VIDEO",
                    "CodecProfile": "MPEG2_SIMPLE",
                    "CodecId": 2,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 1,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "MPEG2VIDEO",
                    "CodecProfile": "MPEG2_MAIN",
                    "CodecId": 2,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 1,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "H264",
                    "CodecProfile": "H264_CONSTRAINED_BASELINE",
                    "CodecId": 27,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 17,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "H264",
                    "CodecProfile": "H264_MAIN",
                    "CodecId": 27,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 17,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "H264",
                    "CodecProfile": "H264_HIGH",
                    "CodecId": 27,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 17,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "WMV3",
                    "CodecProfile": "VC1_SIMPLE",
                    "CodecId": 71,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 1,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "VC1",
                    "CodecProfile": "VC1_SIMPLE",
                    "CodecId": 70,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 1,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "WMV3",
                    "CodecProfile": "VC1_MAIN",
                    "CodecId": 71,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 1,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "VC1",
                    "CodecProfile": "VC1_MAIN",
                    "CodecId": 70,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 1,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "WMV3",
                    "CodecProfile": "VC1_COMPLEX",
                    "CodecId": 71,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 1,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "WMV3",
                    "CodecProfile": "VC1_ADVANCED",
                    "CodecId": 71,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 1,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "VC1",
                    "CodecProfile": "VC1_COMPLEX",
                    "CodecId": 70,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 1,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "VC1",
                    "CodecProfile": "VC1_ADVANCED",
                    "CodecId": 70,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "NV12 ",
                    "RTFormat": 1,
                    "DecSliceMode": 1
                },
                {
                    "CodecName": "MJPEG",
                    "CodecProfile": "MJPEG_HUFFMAN_BASELINE_DCT",
                    "CodecId": 7,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "ColorFormats": "GRAY8 YUV411P YUV422P YUV440P YUV444P ",
                    "RTFormat": 31,
                    "DecSliceMode": 1
                }
            ],
            "Encoders": [
                {
                    "CodecName": "MPEG2VIDEO",
                    "CodecProfile": "MPEG2_SIMPLE",
                    "CodecId": 2,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "MinWidth": 32,
                    "MinHeight": 32,
                    "ColorFormats": "NV12 YUV420P YUV420P ",
                    "RTFormat": 1,
                    "RateControl": 16,
                    "EncPackedHeaders": 11,
                    "EncMaxRefFrames": 65537,
                    "EncQualityRange": 1,
                    "EncROI": 0
                },
                {
                    "CodecName": "MPEG2VIDEO",
                    "CodecProfile": "MPEG2_MAIN",
                    "CodecId": 2,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "MinWidth": 32,
                    "MinHeight": 32,
                    "ColorFormats": "NV12 YUV420P YUV420P ",
                    "RTFormat": 1,
                    "RateControl": 16,
                    "EncPackedHeaders": 11,
                    "EncMaxRefFrames": 65537,
                    "EncQualityRange": 1,
                    "EncROI": 0
                },
                {
                    "CodecName": "H264",
                    "CodecProfile": "H264_CONSTRAINED_BASELINE",
                    "CodecId": 27,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "MinWidth": 32,
                    "MinHeight": 32,
                    "ColorFormats": "NV12 YUV420P YUV420P ",
                    "RTFormat": 1,
                    "RateControl": 22,
                    "EncPackedHeaders": 31,
                    "EncMaxRefFrames": 65537,
                    "EncMaxSlices": 32,
                    "EncSliceStructure": 2,
                    "EncQualityRange": 2,
                    "EncROI": 2147484168,
                    "EncRateControlExt": 2147483907
                },
                {
                    "CodecName": "H264",
                    "CodecProfile": "H264_MAIN",
                    "CodecId": 27,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "MinWidth": 32,
                    "MinHeight": 32,
                    "ColorFormats": "NV12 YUV420P YUV420P ",
                    "RTFormat": 1,
                    "RateControl": 22,
                    "EncPackedHeaders": 31,
                    "EncMaxRefFrames": 65537,
                    "EncMaxSlices": 32,
                    "EncSliceStructure": 2,
                    "EncQualityRange": 2,
                    "EncROI": 2147484168,
                    "EncRateControlExt": 2147483907
                },
                {
                    "CodecName": "H264",
                    "CodecProfile": "H264_HIGH",
                    "CodecId": 27,
                    "MaxWidth": 4096,
                    "MaxHeight": 4096,
                    "MinWidth": 32,
                    "MinHeight": 32,
                    "ColorFormats": "NV12 YUV420P YUV420P ",
                    "RTFormat": 1,
                    "RateControl": 22,
                    "EncPackedHeaders": 31,
                    "EncMaxRefFrames": 65537,
                    "EncMaxSlices": 32,
                    "EncSliceStructure": 2,
                    "EncQualityRange": 2,
                    "EncROI": 2147484168,
                    "EncRateControlExt": 2147483907
                }
            ]
        }
    ],
    "Log": [
        {
            "Level": 48,
            "Category": 0,
            "Message": "Begin GetVaAdapterInfo"
        },
        {
            "Level": 40,
            "Category": 0,
            "Message": "Found 1 device entries"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "Check device at index 0: /sys/bus/pci/devices/pci0000:00/class"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "Adding adapter '/sys/bus/pci/devices/pci0000:00' - VendorId: 4660 DeviceId: 4369 - Subsystem: V: 6900, D: 4352"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "GetDeviceName - Start"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "find_record: no record found"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - VendorName: (null)"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "GetDeviceName - Start"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "find_record: no record found"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - DeviceName: (null)"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "GetDeviceName - Start"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "find_record: found: Red Hat, Inc."
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem VendorName: Red Hat, Inc."
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "GetDeviceName - Start"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "find_record: no record found"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "find_record: no record found"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "       adapter '/sys/bus/pci/devices/pci0000:00' - Subsystem DeviceName: (null)"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "Begin get_nodes"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "Found 1 drm entries"
        },
        {
            "Level": 56,
            "Category": 0,
            "Message": "Found drm node '/dev/dri/render0'"
        },
        {
            "Level": 48,
            "Category": 0,
            "Message": "End GetVaAdapterInfo"
        },
        {
            "Level": 40,
            "Category": 0,
            "Message": "/dev/dri/render0: VA-API version: 1.9 (libva 1.8.0)"
        },
        {
            "Level": 40,
            "Category": 0,
            "Message": "/dev/dri/render0: Driver version: Intel i965 driver for Intel(R) Haswell Server - 2.4.1"
        }
    ]
}

And finally what a beautiful sight in Emby. 😍

image.png

Edited by bingemeister
Link to comment
Share on other sites

BANG! 😎

You can get it even better: When you find out the PCI VendorId and DeviceId values, you can enter them in those text files, an Emby should show the graphics device name as well...

 

Link to comment
Share on other sites

bingemeister
7 minutes ago, softworkz said:

BANG! 😎

You can get it even better: When you find out the PCI VendorId and DeviceId values, you can enter them in those text files, an Emby should show the graphics device name as well...

Haha so every time I am reminded again that I only have a weak Intel iGPU? 😁 I definitely need to get something with HEVC support now.

Do you think you will find a way to make it work without these workarounds? I mean they are quite dirty. 😄 But I guess it's fine for the time being.

Link to comment
Share on other sites

34 minutes ago, bingemeister said:

Haha so every time I am reminded again that I only have a weak Intel iGPU?

Well - you can choose any deviceId that makes you more happy 😉

34 minutes ago, bingemeister said:

Do you think you will find a way to make it work without these workarounds?

I'm totally overtasked at the moment and I don't have any setup yet for working on and testing this. In the past, FreeBSD just didn't play a role with regards to video hw acceleration.

On the good side, we know now that it's working and what needs to be done, even though it might take a while until I get to that (ideally combined with a number of other issues in the same area).

Today's workaround is somewhat insane, but effectively it doesn't do much more than to feed the device into the actual detection, which means that all other results about supported codecs and their capabilities (profiles, levels, bitrates, resolution, color formats, etc.) are still accurate.

One more thing: Could you perhaps re-tar your modified folder tree and post it here for other users?
(I'll delete mine then)

Thanks

Edited by softworkz
Link to comment
Share on other sites

11 hours ago, bingemeister said:

Success! Creating a link at /dev/dri/render0 did the trick! 😃

Have you gotten the link working in a jail? Or is this on the host? Could you share your devfs.rules :)?

NVM: In the meantime I found what's needed to create the symlink in the jail: 

exec.poststart = "cd /usr/jail/emby/dev/dri; ln -s card0 render0";

 

Edited by Duffyx
  • Like 1
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...