AlexPresso/VideoStation-FFMPEG-Patcher

[BUG] Losing HEVC Main 10 file support after patching

djhibee opened this issue · 13 comments

Describe the bug
After patching my ffmpeg4, I'm losing the support of HEVC Main 10 files. The app is waiting for something but never stop looping (no error message).

image

HEVC Main files keep on working though.
H264 and H265 main files are reading correctly eac and dts tracks as expected.
I tried with ffmpeg5 and ffmpeg6 patch, but this time it did not work at all (no eac and dts support for H264 and H265 main files AND no H265 Main 10 file playing)

This may be the same issue than in #81

Additional context
I just upgraded my video station to latest version that removes the support of aac. I suspect this bug coming from the Advanced Media extension package.
Result of: curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/main/issue-report.sh | bash

https://gist.github.com/djhibee/20263d6c02ee7856013d532bb5ba58cb

Hello @djhibee :)

I suspect the process stops before processing any file, so I improved the logging a little bit in case of error.

Please follow these steps to post a new issue report:

  • uninstall the patch : curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/main/patcher.sh | bash -s -- -a unpatch
  • install the new patch : curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/main/patcher.sh | bash -s -- -a patch
  • Play the movie causing issue (keep it playing/loading in background)
  • Run the following command : curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/main/issue-report.sh | bash
  • Copy paste the output to a new gist and place the link here

Hello, thank you for the issue report
Do you have a licensed Advanced Media Extensions ?

You can check it by opening Advanced Media Extension app through DSM. You need to have a registered Synology account inside the app to make it work.

Also what is the audio codec of the file you're trying to play please ? :)

It seems to be ok with the advanced Media Extension app, although I don't find the explicit message saying I have a licensed app.
image

Regarding the audio codec, here is are the details:
image

Metadata:
encoder : libebml v1.4.4 + libmatroska v1.7.1
creation_time : 2023-03-31T10:55:12.000000Z
Duration: 01:57:46.82, start: 0.000000, bitrate: 2232 kb/s
Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709), 1920x808, SAR 1:1 DAR 240:101, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Metadata:
BPS : 1816995
DURATION : 01:57:44.266000000
NUMBER_OF_FRAMES: 169373
NUMBER_OF_BYTES : 1604467583
_STATISTICS_WRITING_APP: mkvmerge v75.0.0 ('Goliath') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2023-03-31 10:55:12
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(fre): Audio: aac (HE-AAC), 48000 Hz, 5.1, fltp (default)
Metadata:
title : VFF
BPS : 206650
DURATION : 01:57:44.320000000
NUMBER_OF_FRAMES: 165570
NUMBER_OF_BYTES : 182480852
_STATISTICS_WRITING_APP: mkvmerge v75.0.0 ('Goliath') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2023-03-31 10:55:12
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Audio: aac (HE-AAC), 48000 Hz, 5.1, fltp
Metadata:
title : VO
BPS : 206863
DURATION : 01:57:46.795000000
NUMBER_OF_FRAMES: 165628
NUMBER_OF_BYTES : 182732830
_STATISTICS_WRITING_APP: mkvmerge v75.0.0 ('Goliath') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2023-03-31 10:55:12
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Hello, thank you for the details, could you copy paste the output of the following command please: /var/packages/ffmpeg/target/bin/vainfo (needs sudo -i before doing it)

Hello, here is the result:
Trying display: drm
libva info: VA-API version 1.17.0
libva info: Trying to open /var/packages/ffmpeg/target/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.5.4 (3bf5477a)
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointFEI
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointFEI
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointFEI
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD

Hello @djhibee
This error seems to be the same as in #81, could you please give me the output of the following command: /var/packages/ffmpeg/target/bin/ffmpeg -vaapi_device /dev/dri/renderD128 -vcodec h264_vaapi -hide_banner -h encoder=h264_vaapi

hello:

Trailing option(s) found in the command: may be ignored.
Encoder h264_vaapi [H.264/AVC (VAAPI)]:
General capabilities: dr1 delay hardware
Threading capabilities: none
Supported hardware devices: vaapi
Supported pixel formats: vaapi_vld
h264_vaapi AVOptions:
-low_power E..V....... Use low-power encoding mode (only available on some platforms; may not support all encoding features) (default false)
-idr_interval E..V....... Distance (in I-frames) between IDR frames (from 0 to INT_MAX) (default 0)
-b_depth E..V....... Maximum B-frame reference depth (from 1 to INT_MAX) (default 1)
-async_depth E..V....... Maximum processing parallelism. Increase this to improve single channel performance (from 0 to 64) (default 4)
-rc_mode E..V....... Set rate control mode (from 0 to 6) (default auto)
auto 0 E..V....... Choose mode automatically based on other parameters
CQP 1 E..V....... Constant-quality
CBR 2 E..V....... Constant-bitrate
VBR 3 E..V....... Variable-bitrate
ICQ 4 E..V....... Intelligent constant-quality
QVBR 5 E..V....... Quality-defined variable-bitrate
AVBR 6 E..V....... Average variable-bitrate
-qp E..V....... Constant QP (for P-frames; scaled by qfactor/qoffset for I/B) (from 0 to 52) (default 0)
-quality E..V....... Set encode quality (trades off against speed, higher is faster) (from -1 to INT_MAX) (default -1)
-coder E..V....... Entropy coder type (from 0 to 1) (default cabac)
cavlc 0 E..V.......
cabac 1 E..V.......
vlc 0 E..V.......
ac 1 E..V.......
-aud E..V....... Include AUD (default false)
-sei E..V....... Set SEI to include (default identifier+timing+recovery_point)
identifier E..V....... Include encoder version identifier
timing E..V....... Include timing parameters (buffering_period and pic_timing)
recovery_point E..V....... Include recovery points where appropriate
-profile E..V....... Set profile (profile_idc and constraint_set*_flag) (from -99 to 65535) (default -99)
constrained_baseline 578 E..V.......
main 77 E..V.......
high 100 E..V.......
-level E..V....... Set level (level_idc) (from -99 to 255) (default -99)
1 10 E..V.......
1.1 11 E..V.......
1.2 12 E..V.......
1.3 13 E..V.......
2 20 E..V.......
2.1 21 E..V.......
2.2 22 E..V.......
3 30 E..V.......
3.1 31 E..V.......
3.2 32 E..V.......
4 40 E..V.......
4.1 41 E..V.......
4.2 42 E..V.......
5 50 E..V.......
5.1 51 E..V.......
5.2 52 E..V.......
6 60 E..V.......
6.1 61 E..V.......
6.2 62 E..V.......

I pushed a new version of the wrapper, could you please try to unpatch and repatch

Everything seems to be OK now, both with ffmpeg v4 and v6 :-D.
I think we can close this one, thanks a lot!
However, testing made me realize that Video Station transcodes hevc main files (no HDR, just main) despite my browser (chrome desktop v116) is supporting it... Is it the same on your side?
Anyway thank again!

I'm glad we could fix it, thank you for your help as well :)
Yes, I just tried right now, this is same thing for me (and my NAS is struggling to transcode it through Gstreamer actually), unfortunately, VideoStation browser is the only one to be able to identify if display/browser supports HDR, the wrapper can't know without VideoStation giving the information somehow

I will have a look at it