Jump to content
XPEnology Community

Video Station 使用vaapi 硬解 的方法


Recommended Posts

Posted (edited)

为了Video Station 使用vaapi 硬解 我研究了一下 最终获得不错的成果,以下内容仅供学习

首先分享下,具体步骤

Video Station 使用vaapi 硬解 

1 .首先必须安装Advanced Media Extensions ,因为只有Advanced Media Extensions 这里面的ffmpg41 才支持vaapi硬解 (不幸的是CodecPack 里的ffmpeg 硬解有问题不得不替换成synocommunity 里的ffmpeg4)

2.在套件中心安装 synocommunity 里的 ffmpeg 4  

3.需要打补丁的文件

/var/packages/VideoStation/target

     lib\libvideostation_webapi.so,

     lib\libsynovideostation.so,

     lib\libsynovte.so

 

/var/packages/VideoStation/target/ui/cgi

     advanced_manage.cgi

     

4.我为了方便调试写了个代理程序ffmpeg41 调用/var/packages/ffmpeg/target/bin/ffmpeg 实际上可以使用ln -s /var/packages/ffmpeg/target/bin/ffmpeg /var/packages/CodecPack/target/bin/ffmpeg41

 

本测试项目环境

     4.thumb.jpg.68298333e5b011561d3e00007b851a93.jpg

     实际上我的CPU集成显卡是HD P630

     SA6400 x86_64 ,

     Video Station 3.1.1-3168,

     Advanced Media Extensions 3.1.0-3005

 

下面为测试效果 视频为8K视频

5.thumb.jpg.5e28c533548a38084b126610e1de9ce9.jpg

3.thumb.jpg.a186db0df8e3b8268711893fa91d79d6.jpg

2.jpg.3a8dc1ab0769c5da266e67b02a0dae7b.jpg

 

感谢 rr 各个成员 和 MoetaYuko 的GPU驱动

如果这对你有用, 可以来这里留下记号

 

 

patch.zip

Edited by Martian
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Posted (edited)
В 20.06.2024 в 09:43, Martian сказал:

为了Video Station 使用vaapi 硬解 我研究了一下 最终获得不错的成果,以下内容仅供学习

首先分享下,具体步骤

Video Station 使用vaapi 硬解 

1 .首先必须安装Advanced Media Extensions ,因为只有Advanced Media Extensions 这里面的ffmpg41 才支持vaapi硬解 (不幸的是CodecPack 里的ffmpeg 硬解有问题不得不替换成synocommunity 里的ffmpeg4)

2.在套件中心安装 synocommunity 里的 ffmpeg 4  

3.需要打补丁的文件

/var/packages/VideoStation/target

     lib\libvideostation_webapi.so,

     lib\libsynovideostation.so,

     lib\libsynovte.so

 

/var/packages/VideoStation/target/ui/cgi

     advanced_manage.cgi

     

4.我为了方便调试写了个代理程序ffmpeg41 调用/var/packages/ffmpeg/target/bin/ffmpeg 实际上可以使用ln -s /var/packages/ffmpeg/target/bin/ffmpeg /var/packages/CodecPack/target/bin/ffmpeg41

 

本测试项目环境

     4.thumb.jpg.68298333e5b011561d3e00007b851a93.jpg

     实际上我的CPU集成显卡是HD P630

     SA6400 x86_64 ,

     Video Station 3.1.1-3168,

     Advanced Media Extensions 3.1.0-3005

 

下面为测试效果 视频为8K视频

5.thumb.jpg.5e28c533548a38084b126610e1de9ce9.jpg

3.thumb.jpg.a186db0df8e3b8268711893fa91d79d6.jpg

2.jpg.3a8dc1ab0769c5da266e67b02a0dae7b.jpg

 

感谢 rr 各个成员 和 MoetaYuko 的GPU驱动

如果这对你有用, 可以来这里留下记号

 

 

patch.zip 688.86 \u043a\u0411 · 8 загрузок

Hello!
Thank for your work! I've just few days ago trying to find such kind of solution.

I'd like to test your solution but unfortunately, seems to me, it doesn't work in my case.
I've done everything in accordance with all steps in your instruction. May be I miss something.

Could you please look on that?

My system is:
CPU - i5 12400 (with iGPU)
Model - SA6400 
Loader - RR

In accordance with output bellow iGPU works correctly:

sh-4.4# ls /dev/dri/
by-path  card0  renderD128

sh-4.4# lspci -n | grep 0300
00:02.0 0300: 8086:4692 (rev 0c)
01:00.0 0300: 10de:2188 (rev a1)


sh-4.4# dmesg | grep i915
[   27.438642] i915 0000:00:02.0: [drm] Transparent Hugepage support is recommended for optimal performance on this platform!
[   27.451362] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[   27.462116] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/adls_dmc_ver2_01.bin (v2.1)
[   27.496007] i915 0000:00:02.0: [drm] GT0: GuC firmware i915/tgl_guc_70.bin version 70.20.0
[   27.512031] i915 0000:00:02.0: [drm] GT0: HuC firmware i915/tgl_huc.bin version 7.9.3
[   27.523049] i915 0000:00:02.0: [drm] GT0: HuC: authenticated for all workloads
[   27.531303] i915 0000:00:02.0: [drm] GT0: GUC: submission enabled
[   27.537991] i915 0000:00:02.0: [drm] GT0: GUC: SLPC enabled
[   27.544388] i915 0000:00:02.0: [drm] GT0: GUC: RC enabled
[   27.559866] [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
[   27.567842] i915 display info: display version: 12
[   27.573097] i915 display info: cursor_needs_physical: no
[   27.578935] i915 display info: has_cdclk_crawl: no
[   27.584220] i915 display info: has_cdclk_squash: no
[   27.589587] i915 display info: has_ddi: yes
[   27.594184] i915 display info: has_dp_mst: yes
[   27.599064] i915 display info: has_dsb: yes
[   27.603673] i915 display info: has_fpga_dbg: yes
[   27.608755] i915 display info: has_gmch: no
[   27.613365] i915 display info: has_hotplug: yes
[   27.618339] i915 display info: has_hti: yes
[   27.622942] i915 display info: has_ipc: yes
[   27.627532] i915 display info: has_overlay: no
[   27.632411] i915 display info: has_psr: yes
[   27.637022] i915 display info: has_psr_hw_tracking: no
[   27.642669] i915 display info: overlay_needs_physical: no
[   27.664101] i915 display info: supports_tv: no
[   27.668974] i915 display info: has_hdcp: yes
[   27.673680] i915 display info: has_dmc: yes
[   27.678278] i915 display info: has_dsc: yes

 

image.thumb.png.2eb675d3256258cbf4211823091d9eb7.png

image.thumb.png.c9c4f09d0b0c79e2c1dec38b49d6f158.png
image.thumb.png.ba932ef6a5042cb6d81758ea20af5596.png

image.png

image.png

Edited by Alekc
additional description and images
Link to comment
Share on other sites

Posted (edited)

我重新整理了这些资料,现在有一个代理程序 在ffmpeg_proxy/ffmpeg41

他会复制到/var/packages/CodecPack/target/pack/bin/ffmpeg41
你需要在ffmpeg41.ini 编辑app_path=/var/packages/ffmpeg/target/bin/ffmpeg ,

他会记录真实ffmpeg41的日志 并记录到/tmp/logs/ffmpeg41_proxy.log 方便调试

vs_patch.zip

Edited by Martian
Link to comment
Share on other sites

Posted (edited)

Could not find codec parameters for stream 0 (Video: none (vvc1 / 0x31637676), none, 3840x2160, 10014 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options

 

看上去 是显卡不支持vvc1这种格式解码(vvc1 是 vc1 么) , 下面是UHD730支持的列表

UHD730.thumb.jpg.f8123f1d98034414370fca370e70ed7f.jpg

 

 

你可以尝试解码别的格式..

 

建议增加使用这个补丁 

curl https://mirror.ghproxy.com/https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/main/patcher.sh | bash -s -- -p https://mirror.ghproxy.com/https://raw.githubusercontent.com -v 4

 

先装这个补丁. 然后再使用我的补丁

 

Edited by Martian
Link to comment
Share on other sites

21 hours ago, Alekc said:

@Martian Hello, thanks!

Also I've added into patch file the following lines:

rm /var/packages/CodecPack/target/bin/ffmpeg41
ln -s /var/packages/ffmpeg/target/bin/ffmpeg /var/packages/CodecPack/target/bin/ffmpeg41

Please find log file bellow.

ffmpeg41_proxy.log 7.1 kB · 1 download

 

正常的硬解参数应该是这样的格式

/volume1/@appstore/CodecPack/pack/bin/ffmpeg41 -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/video/test.mkv -r 24 -vcodec h264_vaapi -vf format=nv12|vaapi,hwupload,scale_vaapi=w=1280:h=720 -vsync 2 -bf 0 -vb 2000000 -acodec libmp3lame -ab 128K -ac 2 -f ssegment -pix_fmt yuv420p -segment_format mpegts -segment_list_type m3u8 -hls_seek_time 0 -segment_time 5 -segment_time_delta 0.000 -segment_start_number 00000 -individual_header_trailer 0 -avoid_negative_ts 0 -break_non_keyframes 1 -max_muxing_queue_size 1024 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/945107f7cd4ccf24a9c38288f3682b3e_ub5nLLCx/slice-%05d.ts

Link to comment
Share on other sites

@Martian
I've made careful check and may confirm that solution works! Thank you for your hard work!


Sample video with successful hardware transcoding on PC in chrome browser and mobile app:

/var/packages/CodecPack/target/bin/ffmpeg41 -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/photo/TheaterSquare_3840x2160.mp4 -r 24 -vcodec h264_vaapi -vf format=nv12|vaapi,hwupload,scale_vaapi=w=1920:h=1072 -vsync 2 -bf 0 -vb 9000000 -acodec libmp3lame -ab 128K -ac 2 -f ssegment -segment_format mpegts -segment_list_type m3u8 -hls_seek_time 0 -segment_time 5 -segment_time_delta 0.000 -segment_start_number 00000 -individual_header_trailer 0 -avoid_negative_ts 0 -break_non_keyframes 1 -max_muxing_queue_size 1024 -map 0:0 /tmp/VideoStation/HLS/e06841b446be6e07eca2dc36d6bd7b07_s6KYr1pb/slice-%05d.ts
ffmpeg version 4.4.4-49 Copyright (c) 2000-2023 the FFmpeg developers

  built with gcc 8.5.0 (GCC)
  configuration: --target-os=linux --cross-prefix=/home/spksrc/ffmpeg4-dsm6-fix/spksrc/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --prefix=/var/packages/ffmpeg/target --extra-cflags=-I/home/spksrc/ffmpeg4-dsm6-fix/spksrc/spk/ffmpeg4/work-x64-7.1/install/var/packages/ffmpeg/target/include --extra-ldflags=-L/home/spksrc/ffmpeg4-dsm6-fix/spksrc/spk/ffmpeg4/work-x64-7.1/install/var/packages/ffmpeg/target/lib --extra-libs='-lxml2 -ldl -lm' --pkg-config=/usr/bin/pkg-config --ranlib=/home/spksrc/ffmpeg4-dsm6-fix/spksrc/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 --enable-avresample --disable-debug --disable-static --disable-doc --extra-version=49 --extra-cflags=-DSYNO_VIDEOSTATION --extra-cflags=-fno-if-conversion --extra-cflags=-O3 --extra-cflags=-Wno-deprecated-declarations --x86asmexe=nasm --enable-libcodec2 --enable-libxm
l2 --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-libfdk-aac --enable-nonfree --enable-libaom --enable-libsvtav1 --enable-libsvthevc --arch=x86_64 --enable-vaapi --enable-libmfx --enable-libdrm --enable-libass --enable-frei0r
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100

  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100

  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/volume1/photo/TheaterSquare_3840x2160.mp4':
  Metadata:
    major_brand     : mp42

    minor_version   : 0
    compatible_brands: mp42isom
    creation_time   : 2022-07-04T05:15:30.000000Z
  Duration: 00:00:10.00, start: 0.000000, bitrate: 40631 kb/s

  Stream #0:0(unk): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv), 3840x2160 [SAR 1:1 DAR 16:9], 40624 kb/s, 
60 fps, 60 tbr, 90k tbn, 120 tbc (default)
    Metadata:
      creation_time   : 2022-07-04T05:15:30.000000Z
      handler_name    : 
ISO Video Handler
      vendor_id       : [0][0][0][0]

Stream mapping:

  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
Press [q] to stop, [?] for help

[stream_segment,ssegment @ 0x55c00e6b0b80] Opening '/tmp/VideoStation/HLS/e06841b446be6e07eca2dc36d6bd7b07_s6KYr1pb/slice-00000.ts' for writing

Output #0, stream_segment,ssegment, to '/tmp/VideoStation/HLS/e06841b446be6e07eca2dc36d6bd7b07_s6KYr1pb/slice-%05d.ts':

  Metadata:
    major_brand     : mp42

    minor_version   : 0
    compatible_brands: 
mp42isom
    encoder         : Lavf58.76.100

  Stream #0:0(unk)
: Video: h264 (High), vaapi_vld(tv, progressive), 1920x1072 [SAR 134:135 DAR 16:9], q=2-31, 9000 kb/s, 
24 fps, 
90k tbn (default)

    Metadata:
      creation_time   : 2022-07-04T05:15:30.000000Z
      handler_name    : 
ISO Video Handler
      vendor_id       : [0][0][0][0]

      encoder         : Lavc58.134.100 h264_vaapi

frame=    1 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed=   0x    

frame=   47 fps=0.0 q=-0.0 size=N/A time=00:00:01.79 bitrate=N/A dup=0 drop=68 speed=3.26x    

frame=   91 fps= 86 q=-0.0 size=N/A time=00:00:03.62 bitrate=N/A dup=0 drop=133 speed=3.44x    

[stream_segment,ssegment @ 0x55c00e6b0b80] Opening '/tmp/VideoStation/HLS/e06841b446be6e07eca2dc36d6bd7b07_s6KYr1pb/slice-00001.ts' for writing

frame=  135 fps= 87 q=-0.0 size=N/A time=00:00:05.45 bitrate=N/A dup=0 drop=199 speed=3.51x    

frame=  179 fps= 87 q=-0.0 size=N/A time=00:00:07.29 bitrate=N/A dup=0 drop=265 speed=3.54x    

frame=  222 fps= 87 q=-0.0 size=N/A time=00:00:09.08 bitrate=N/A dup=0 drop=330 speed=3.55x    

[stream_segment,ssegment @ 0x55c00e6b0b80] Opening '/tmp/VideoStation/HLS/e06841b446be6e07eca2dc36d6bd7b07_s6KYr1pb/slice-00002.ts' for writing

frame=  241 fps= 86 q=-0.0 Lsize=N/A time=00:00:10.00 bitrate=N/A dup=0 drop=359 speed=3.58x    

video:12430kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown


/var/packages/CodecPack/target/bin/ffmpeg41 -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/photo/20240511_134828.mp4 -vcodec h264_vaapi -vf format=nv12|vaapi,hwupload,scale_vaapi=w=1280:h=720 -vsync 2 -bf 0 -vb 1000000 -acodec copy -f ssegment -segment_format mpegts -segment_list_type m3u8 -hls_seek_time 0 -segment_time 5 -segment_time_delta 0.000 -segment_start_number 00000 -avoid_negative_ts 0 -break_non_keyframes 1 -max_muxing_queue_size 1024 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-%05d.ts
ffmpeg version 4.4.4-49 Copyright (c) 2000-2023 the FFmpeg developers

  built with gcc 8.5.0 (GCC)
  configuration: --target-os=linux --cross-prefix=/home/spksrc/ffmpeg4-dsm6-fix/spksrc/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --prefix=/var/packages/ffmpeg/target --extra-cflags=-I/home/spksrc/ffmpeg4-dsm6-fix/spksrc/spk/ffmpeg4/work-x64-7.1/install/var/packages/ffmpeg/target/include --extra-ldflags=-L/home/spksrc/ffmpeg4-dsm6-fix/spksrc/spk/ffmpeg4/work-x64-7.1/install/var/packages/ffmpeg/target/lib --extra-libs='-lxml2 -ldl -lm' --pkg-config=/usr/bin/pkg-config --ranlib=/home/spksrc/ffmpeg4-dsm6-fix/spksrc/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 --enable-avresample --disable-debug --disable-static --disable-doc --extra-version=49 --extra-cflags=-DSYNO_VIDEOSTATION --extra-cflags=-fno-if-conversion --extra-cflags=-O3 --extra-cflags=-Wno-deprecated-declarations --x86asmexe=nasm --enable-libcodec2 --enable-libxml
2 --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-libfdk-aac --enable-nonfree --enable-libaom --enable-libsvtav1 --enable-libsvthevc --arch=x86_64 --enable-vaapi --enable-libmfx --enable-libdrm --enable-libass --enable-frei0r

  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100

  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100

  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0

  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100

  libpostproc    55.  9.100 / 55.  9.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/volume1/photo/20240511_134828.mp4':
  Metadata:
    major_brand     : mp42

    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2024-05-11T10:49:28.000000Z
    location        : +55.5883+038.0924/
    location-eng    : +55.5883+038.0924/
    com.android.version: 14
    com.android.capture.fps: 30.000000
  Duration: 00:00:58.45, start: 0.000000, bitrate: 17229 kb/s

  Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 17022 kb/s, 
29.93 fps, 30 tbr, 90k tbn, 180k tbc (default)
    Metadata:

      creation_time   : 2024-05-11T10:49:28.000000Z
      handler_name    : VideoHandle
      vendor_id       : [0][0][0][0]

  Stream #0:1(eng)
: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
    Metadata:
      creation_time   : 
2024-05-11T10:49:28.000000Z
      handler_name    : SoundHandle

      vendor_id       : [0][0][0][0]

Stream mapping:

  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))

  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00000.ts' for writing

Output #0, stream_segment,ssegment, to '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-%05d.ts':

  Metadata:
    major_brand     : mp42

    minor_version   : 0
    compatible_brands: 
isommp42
    com.android.capture.fps: 30.000000

    location        : +55.5883+038.0924/
    location-eng    : 
+55.5883+038.0924/
    com.android.version: 14

    encoder         : Lavf58.76.100

  Stream #0:0(eng)
: Video: h264 (High), vaapi_vld(tv, bt709, progressive), 1280x720, q=2-31, 1000 kb/s, 
30 fps, 
90k tbn (default)
    Metadata:

      creation_time   : 2024-05-11T10:49:28.000000Z
      handler_name    : VideoHandle

      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 h264_vaapi

  Stream #0:1(eng)
: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
    Metadata:
      creation_time   : 
2024-05-11T10:49:28.000000Z
      handler_name    : SoundHandle
      vendor_id       : 
[0][0][0][0]

frame=    1 fps=0.0 q=0.0 size=N/A time=00:00:01.57 bitrate=N/A speed= 117x    

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00001.ts' for writing

frame=  264 fps=0.0 q=-0.0 size=N/A time=00:00:10.36 bitrate=N/A speed=20.1x    

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00002.ts' for writing

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00003.ts' for writing

frame=  553 fps=544 q=-0.0 size=N/A time=00:00:19.98 bitrate=N/A speed=19.7x    

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00004.ts' for writing

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00005.ts' for writing

frame=  828 fps=546 q=-0.0 size=N/A time=00:00:28.97 bitrate=N/A speed=19.1x    

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00006.ts' for writing

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00007.ts' for writing

frame= 1101 fps=545 q=-0.0 size=N/A time=00:00:38.25 bitrate=N/A speed=  19x    

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00008.ts' for writing

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00009.ts' for writing

frame= 1396 fps=554 q=-0.0 size=N/A time=00:00:47.97 bitrate=N/A speed=  19x    

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00010.ts' for writing

[stream_segment,ssegment @ 0x55e34d09e9c0] Opening '/tmp/VideoStation/HLS/77bb74b56a7ecbfdf4c9ec83476334b7_n2XXnTJs/slice-00011.ts' for writing

frame= 1679 fps=556 q=-0.0 size=N/A time=00:00:57.66 bitrate=N/A speed=19.1x    

frame= 1744 fps=555 q=-0.0 Lsize=N/A time=00:00:58.40 bitrate=N/A speed=18.6x    
video:7198kB audio:1821kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown


But I've got several questions:

  1. Why there are differences in files libsynovte.so in initial patch and libsynovte.so.dts in second message?
  2. Probably this step isn't works "4.我为了方便调试写了个代理程序ffmpeg41 调用/var/packages/ffmpeg/target/bin/ffmpeg 实际上可以使用ln -s /var/packages/ffmpeg/target/bin/ffmpeg /var/packages/CodecPack/target/bin/ffmpeg41" because initial patch still not usable in the same condition?
  3. Would be possible to make the same modification for synology photos?
     
Link to comment
Share on other sites

Posted (edited)

@Martian

Could you please check one of these test videos: https://drive.google.com/drive/folders/19x0YQoaM4tFI5zYTLKnoHMcGIpmRSR8E ? Currently, hardware transcoding doesn't work on them due to hvec codec. 

I recall that it did work on these videos with a DSM model DS920 using an i5-8400.

I'll probably have access to that setup tomorrow and can perform additional checks then.

 

/var/packages/CodecPack/target/bin/ffmpeg41 -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/photo/Sony 4K HDR Demo - Whale in Tonga.mp4 -r 24 -vcodec h264_vaapi -vf format=nv12|vaapi,hwupload,scale_vaapi=w=1920:h=1072 -vsync 2 -bf 0 -vb 15000000 -acodec copy -f ssegment -pix_fmt yuv420p -segment_format mpegts -segment_list_type m3u8 -hls_seek_time 0 -segment_time 5 -segment_time_delta 0.000 -segment_start_number 00000 -individual_header_trailer 0 -avoid_negative_ts 0 -break_non_keyframes 1 -max_muxing_queue_size 1024 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/f428c6c9d5a63ac5ed3ea555018747b8_T7r9s8SI/slice-%05d.ts
ffmpeg version 4.4.4-49
 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 8.5.0 (GCC)

  configuration: --target-os=linux --cross-prefix=/home/spksrc/ffmpeg4-dsm6-fix/spksrc/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --prefix=/var/packages/ffmpeg/target --extra-cflags=-I/home/spksrc/ffmpeg4-dsm6-fix/spksrc/spk/ffmpeg4/work-x64-7.1/install/var/packages/ffmpeg/target/include --extra-ldflags=-L/home/spksrc/ffmpeg4-dsm6-fix/spksrc/spk/ffmpeg4/work-x64-7.1/install/var/packages/ffmpeg/target/lib --extra-libs='-lxml2 -ldl -lm' --pkg-config=/usr/bin/pkg-config --ranlib=/home/spksrc/ffmpeg4-dsm6-fix/spksrc/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 --enable-avresample --disable-debug --disable-static --disable-doc --extra-version=49 --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 --ena
ble-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-libfdk-aac --enable-nonfree --enable-libaom --enable-libsvtav1 --enable-libsvthevc --arch=x86_64 --enable-vaapi --enable-libmfx --enable-libdrm --enable-libass --enable-frei0r

  libavutil      56. 70.100 / 56. 70.100

  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100

  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100

  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100

  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/volume1/photo/Sony 4K HDR Demo - Whale in Tonga.mp4':
  Metadata:

    major_brand     : mp42
    minor_version   : 16785407
    compatible_brands: mp42iso4
    creation_time   : 2017-02-27T03:31:16.000000Z
  Duration: 00:01:31.63, start: 0.000000, bitrate: 74630 kb/s

  Stream #0:0(und): Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 74462 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2017-02-27T03:31:16.000000Z

      handler_name    : Video Media Handler

      vendor_id       : [0][0][0][0]
      encoder         : 
HEVC Coding

  Stream #0:1(eng)
: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      creation_time   : 
2017-02-27T03:31:16.000000Z
      handler_name    : Sound Media Handler

      vendor_id       : [0][0][0][0]

Stream mapping:

  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))

  Stream #0:1 -> #0:1 (copy)

Press [q] to stop, [?] for help

Incompatible pixel format 'yuv420p' for codec 'h264_vaapi', auto-selecting format 'vaapi_vld'

[h264_vaapi @ 0x55b26b6a9880] No usable encoding profile found.

Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Conversion failed!

 

Edited by Alekc
Link to comment
Share on other sites

9 часов назад, Alekc сказал:

@Martian

Could you please check one of these test videos: https://drive.google.com/drive/folders/19x0YQoaM4tFI5zYTLKnoHMcGIpmRSR8E ? Currently, hardware transcoding doesn't work on them due to hvec codec. 

I recall that it did work on these videos with a DSM model DS920 using an i5-8400.

I'll probably have access to that setup tomorrow and can perform additional checks then.

 

/var/packages/CodecPack/target/bin/ffmpeg41 -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/photo/Sony 4K HDR Demo - Whale in Tonga.mp4 -r 24 -vcodec h264_vaapi -vf format=nv12|vaapi,hwupload,scale_vaapi=w=1920:h=1072 -vsync 2 -bf 0 -vb 15000000 -acodec copy -f ssegment -pix_fmt yuv420p -segment_format mpegts -segment_list_type m3u8 -hls_seek_time 0 -segment_time 5 -segment_time_delta 0.000 -segment_start_number 00000 -individual_header_trailer 0 -avoid_negative_ts 0 -break_non_keyframes 1 -max_muxing_queue_size 1024 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/f428c6c9d5a63ac5ed3ea555018747b8_T7r9s8SI/slice-%05d.ts
ffmpeg version 4.4.4-49
 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 8.5.0 (GCC)

  configuration: --target-os=linux --cross-prefix=/home/spksrc/ffmpeg4-dsm6-fix/spksrc/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --prefix=/var/packages/ffmpeg/target --extra-cflags=-I/home/spksrc/ffmpeg4-dsm6-fix/spksrc/spk/ffmpeg4/work-x64-7.1/install/var/packages/ffmpeg/target/include --extra-ldflags=-L/home/spksrc/ffmpeg4-dsm6-fix/spksrc/spk/ffmpeg4/work-x64-7.1/install/var/packages/ffmpeg/target/lib --extra-libs='-lxml2 -ldl -lm' --pkg-config=/usr/bin/pkg-config --ranlib=/home/spksrc/ffmpeg4-dsm6-fix/spksrc/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 --enable-avresample --disable-debug --disable-static --disable-doc --extra-version=49 --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 --ena
ble-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-libfdk-aac --enable-nonfree --enable-libaom --enable-libsvtav1 --enable-libsvthevc --arch=x86_64 --enable-vaapi --enable-libmfx --enable-libdrm --enable-libass --enable-frei0r

  libavutil      56. 70.100 / 56. 70.100

  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100

  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100

  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100

  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/volume1/photo/Sony 4K HDR Demo - Whale in Tonga.mp4':
  Metadata:

    major_brand     : mp42
    minor_version   : 16785407
    compatible_brands: mp42iso4
    creation_time   : 2017-02-27T03:31:16.000000Z
  Duration: 00:01:31.63, start: 0.000000, bitrate: 74630 kb/s

  Stream #0:0(und): Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 74462 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2017-02-27T03:31:16.000000Z

      handler_name    : Video Media Handler

      vendor_id       : [0][0][0][0]
      encoder         : 
HEVC Coding

  Stream #0:1(eng)
: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      creation_time   : 
2017-02-27T03:31:16.000000Z
      handler_name    : Sound Media Handler

      vendor_id       : [0][0][0][0]

Stream mapping:

  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))

  Stream #0:1 -> #0:1 (copy)

Press [q] to stop, [?] for help

Incompatible pixel format 'yuv420p' for codec 'h264_vaapi', auto-selecting format 'vaapi_vld'

[h264_vaapi @ 0x55b26b6a9880] No usable encoding profile found.

Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Conversion failed!

 

Hello @Martian!

I've checked the video 'Sony 4K HDR Demo - Whale in Tonga.mp4' mentioned in the previous message on a DVA1622 model with an i5-8400 CPU, and it works with hw transcoding. How is this possible?

 

image.png

Link to comment
Share on other sites

Posted (edited)
On 7/1/2024 at 3:52 PM, Alekc said:

Hello @Martian!

I've checked the video 'Sony 4K HDR Demo - Whale in Tonga.mp4' mentioned in the previous message on a DVA1622 model with an i5-8400 CPU, and it works with hw transcoding. How is this possible?

 

image.png

如果需要支持hevc 请使用
curl https://mirror.ghproxy.com/https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/main/patcher.sh | bash -s -- -p https://mirror.ghproxy.com/https://raw.githubusercontent.com -v 4


最近账号总是出现问题

block.jpg

Edited by Martian
Link to comment
Share on other sites

1 час назад, Martian сказал:


@Martian Thank you for the proposal! I'll check.

It’s a bit strange, but in dva1622, this video plays with HW transcoding using advanced media codecs only. So, it isn’t necessary to install any additional external package.

You may download this test video from the following links:

https://www.hdclub.ua/files/avpedia_test/Sony_Whale_in_Tonga_4K_UHD_HDR.mp4
https://www.demolandia.net/downloads.html?id=5465624

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...