Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[BUG] Stop playing some formats that played before patching #95

Closed
dmoskovchenko opened this issue Sep 29, 2023 · 26 comments · Fixed by #102
Closed

[BUG] Stop playing some formats that played before patching #95

dmoskovchenko opened this issue Sep 29, 2023 · 26 comments · Fixed by #102

Comments

@dmoskovchenko
Copy link

dmoskovchenko commented Sep 29, 2023

Provide System Details
Model: DS220+
DSM version: DSM 7.2-64570 Update 3
Video Station: 3.1.0-3153
FFmpeg 4 /5 /6 from Community centre
Logs: https://gist.github.com/dmoskovchenko/2c2a719e4d9c0ab98fbbd13c43aa3955

Describe the bug
After patching some videos stop playing,
image

If I tried -s -- -a unpatch this videos begin playing.

I need a patch to play videos with eac3 sound. After patching, videos with eac3 sound working well.

Please help me with this issue.

@AlexPresso
Copy link
Owner

Hello,

I'll have a look at it as soon as I can

@AlexPresso
Copy link
Owner

Hello @dmoskovchenko

I made a fix attempt in the linked PR, could you try to use the following procedure to test it please:

  • uninstall the patch : curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/fix_scale_vaapi/patcher.sh | bash -s -- -a unpatch
  • install the new patch curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/fix_scale_vaapi/patcher.sh | bash -s -- -a patch -b fix_scale_vaapi

If you still have an issue please run the issue-report tool and post the result here again

@dmoskovchenko
Copy link
Author

dmoskovchenko commented Oct 1, 2023

Hello, first of all I want to thank you for your work.
I have treid ^
image

No changes for me

Here is log file: https://gist.github.com/dmoskovchenko/c8f058d6149bbf83341ac551b14ca1a0

@dmoskovchenko
Copy link
Author

dmoskovchenko commented Oct 1, 2023

After patching on this link(branch) the video picture is strange:
image

and if I do unpatch video picture format became normal but without eac3(( :
image

@AlexPresso
Copy link
Owner

AlexPresso commented Oct 1, 2023

My bad, I inverted the width and height, could you please unpatch and repatch using the same above commands

@dmoskovchenko
Copy link
Author

dmoskovchenko commented Oct 1, 2023

After patching on this link(branch) the video picture is strange: image

and if I do unpatch video picture format became normal but without eac3(( : image

this part is fixed, but in general the videos that plays in unpatched mode still has problem with playing after patching

Here is log: https://gist.github.com/dmoskovchenko/ce76407af830f24ef1257a18c123f64a

@AlexPresso
Copy link
Owner

Thank you for the feedback
I tried to re-add the vaapi to the filter chain, could you please unpatch/repatch using the same commands and give it a try

Could you also give me the ouput of the following command:

  • vainfo
  • (only in case the first one didn't work) /bin/vainfo

@dmoskovchenko
Copy link
Author

dmoskovchenko commented Oct 1, 2023

Tried to repatch - nothig changed :(
Here is vainfo: https://gist.github.com/dmoskovchenko/4d87abe48fa9fa470ac94618b0069366

@AlexPresso
Copy link
Owner

Do you have any output if running /var/packages/VideoStation/target/bin/vainfo ?
Unfortunately, I can't test it by myself because my NAS is not having an Intel CPU and so doesn't have VAAPI

@dmoskovchenko
Copy link
Author

dmoskovchenko commented Oct 1, 2023

Here is /var/packages/VideoStation/target/bin/vainfo
vainfo.zip

If it is neccesarry I could make a vpn with acces to my nas to fix an issue

@AlexPresso
Copy link
Owner

AlexPresso commented Oct 1, 2023

Thank you for the report :)

Hello @th0ma7, I hope you're doing well
By any chance, do you have an idea why the OP is able to play the video with default ffmpeg but not with the SC's ffmpeg ? For me the args looks pretty similar, could it be possible the SC's ffmpeg is missing the MPEG4 Advanced Simple profile ?

Key infos: https://gist.github.com/dmoskovchenko/c8f058d6149bbf83341ac551b14ca1a0

@th0ma7
Copy link

th0ma7 commented Oct 2, 2023

@AlexPresso the following should provide the list of decoders available, which in turn depends of the platform and ffmpeg version in usage:

$ /usr/local/bin/ffmpeg6 -hide_banner -decoders | grep -i mpeg
 VFS..D ffv1                 FFmpeg video codec #1
 VF..BD ffvhuff              Huffyuv FFmpeg variant
 VFS..D h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
 V....D libopenh264          OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
 V.S.BD mpeg1video           MPEG-1 video
 V..... mpeg1_v4l2m2m        V4L2 mem2mem MPEG1 decoder wrapper (codec mpeg1video)
 V.S.BD mpeg2video           MPEG-2 video
 V.S.BD mpegvideo            MPEG-1 video (codec mpeg2video)
 V..... mpeg2_v4l2m2m        V4L2 mem2mem MPEG2 decoder wrapper (codec mpeg2video)
 V....D mpeg2_qsv            MPEG2VIDEO video (Intel Quick Sync Video acceleration) (codec mpeg2video)
 VF..BD mpeg4                MPEG-4 part 2
 V..... mpeg4_v4l2m2m        V4L2 mem2mem MPEG4 decoder wrapper (codec mpeg4)
 V...BD msmpeg4v1            MPEG-4 part 2 Microsoft variant version 1
 V...BD msmpeg4v2            MPEG-4 part 2 Microsoft variant version 2
 V...BD msmpeg4              MPEG-4 part 2 Microsoft variant version 3 (codec msmpeg4v3)
 A....D mp1                  MP1 (MPEG audio layer 1)
 A....D mp1float             MP1 (MPEG audio layer 1) (codec mp1)
 A....D mp2                  MP2 (MPEG audio layer 2)
 A....D mp2float             MP2 (MPEG audio layer 2) (codec mp2)
 A....D mp3float             MP3 (MPEG audio layer 3) (codec mp3)
 A....D mp3                  MP3 (MPEG audio layer 3)
 A....D mp3adufloat          ADU (Application Data Unit) MP3 (MPEG audio layer 3) (codec mp3adu)
 A....D mp3adu               ADU (Application Data Unit) MP3 (MPEG audio layer 3)
 A....D als                  MPEG-4 Audio Lossless Coding (ALS) (codec mp4als)

And to get more details on a specific decoder:

$ /usr/local/bin/ffmpeg6 -hide_banner -h decoder=mpeg4
Decoder mpeg4 [MPEG-4 part 2]:
    General capabilities: horizband dr1 delay threads 
    Threading capabilities: frame
    Supported hardware devices: vaapi 
    Supported pixel formats: vaapi yuv420p
MPEG4 Video Decoder AVOptions:

Considering DS220+ is a geminilake (x64) pretty much everything should be enabled including vaapi acceleration.

EDIT: in order to use vainfo you must use sudo access or a user account that has group videodriver permissions:

sudo su -s /bin/bash sc-ffmpeg -c '/var/packages/ffmpeg6/target/bin/vainfo'
Password:  ************
Trying display: drm
libva info: VA-API version 1.18.0
libva info: Trying to open /var/packages/ffmpeg6/target/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.18 (libva 2.18.1)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.1.6 (3359d2df)
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
      VAProfileVP9Profile0            :	VAEntrypointVLD

So issue may well be that the @dmoskovchenko may be using an account which isn't part of the videodriver group

@dmoskovchenko
Copy link
Author

Hello, @th0ma7 thx for your answer. Here is New logs: https://gist.github.com/dmoskovchenko/4e5f79795ac0b0da7541e0e7dc1bd0ac with the commands that you provided.

For this time I found another resource with wrapper patcher(as a work around) that helps me to solve the issue , now all formats are played well.

I still want to understand if this problem is only mine and still want to help @AlexPresso to enchance his project :)

@AlexPresso
Copy link
Owner

Thank you for the feedback @th0ma7 :)

And thank to you @dmoskovchenko for your will to help and for giving informations from the commands, it's highly appreciated 👌.
But the one you used are for ffmpeg6 and I see from the issue-report that your patch configuration is using ffmpeg4, could you give me the output of the following commands for ffmpeg4 please (needs sudo):

  • /var/packages/ffmpeg/target/bin/ffmpeg4 -hide_banner -decoders | grep -i mpeg
  • sudo su -s /bin/bash sc-ffmpeg -c '/var/packages/ffmpeg/target/bin/vainfo'
  • and also this one to see what are the capabilities of VideoStation's default ffmpeg: /var/packages/VideoStation/target/bin/ffmpeg.orig -hide_banner -decoders | grep -i mpeg

To give some explainations about my thoughts:
The reason why it's working with the other wrapper you're using, is because the other wrapper is in first case, trying to run the transcoding with the default VideoStation's ffmpeg. My wrapper is only using the SynoCommunity's ffmpeg. I decided to do it this way because the SC ffmpeg is having way more capabilities and is containing latest ffmpeg optimizations.

@AlexPresso
Copy link
Owner

AlexPresso commented Oct 6, 2023

Hello @dmoskovchenko

If you have time, I made a new patch to try my theory about the previous comment, if you are okay to try it here are the steps:

  • uninstall the other patch (the two patches are incompatible)
  • uninstall the patch : curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/multitry_ffmpeg/patcher.sh | bash -s -- -a unpatch
  • install the new patch curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/multitry_ffmpeg/patcher.sh | bash -s -- -a patch -b multitry_ffmpeg

If you still have an issue please run the issue-report tool and post the result here again

PS : If you have time, please also send me the output of the other commands ;)

@dmoskovchenko
Copy link
Author

Hello, I have tried new solution and at once everything works fine for me now.
Great job.
I will stay on your solution, it is nice to be intouch with developer in resolving an issue.
I wat to thank you one more time for your work .

@dmoskovchenko
Copy link
Author

Fixed

@AlexPresso
Copy link
Owner

Thank you very much for testing :)
I'm glad everything working fine, but could you please just give me the output of the commands in the following comment so I can have a deep understanding of what was not working fine in the first try please: #95 (comment)

@dmoskovchenko
Copy link
Author

@AlexPresso
Copy link
Owner

Thank you :)

@Gargaj
Copy link

Gargaj commented Oct 10, 2023

@AlexPresso
Getting the same issue with some HEVC files - work fine before patching, don't work at all after.
Log: https://pastebin.com/raw/aWjq4cej

@AlexPresso
Copy link
Owner

Hi @Gargaj
Thank you for the report, could you provide me the video file so I can do some tests locally please ?

@AlexPresso AlexPresso reopened this Oct 10, 2023
@Gargaj
Copy link

Gargaj commented Oct 10, 2023

@AlexPresso
Copy link
Owner

AlexPresso commented Oct 11, 2023

I made a fix attempt in the linked PR (#102) , could you try to use the following procedure to test it please:

  • uninstall the patch : curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/fix_err_code/patcher.sh | bash -s -- -a unpatch
  • install the new patch curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/fix_err_code/patcher.sh | bash -s -- -a patch -b fix_err_code

If you still have an issue please run the issue-report tool and post the result here again

@Gargaj
Copy link

Gargaj commented Oct 11, 2023

Seems to be working on the few I tried! If I run into issues I'll come back.

@AlexPresso
Copy link
Owner

Alright, thank you for testing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants