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] HEVC+AAC_LC and H264+EAC3 videos don't play after patching #113

Closed
pedroms opened this issue Dec 6, 2023 · 17 comments · Fixed by #117
Closed

[BUG] HEVC+AAC_LC and H264+EAC3 videos don't play after patching #113

pedroms opened this issue Dec 6, 2023 · 17 comments · Fixed by #117

Comments

@pedroms
Copy link

pedroms commented Dec 6, 2023

Issue report: https://gist.github.com/pedroms/79121ad8aaf5aa2abea923690ee801be

Describe the bug
HEVC+AAC_LC and H264+EAC3 videos are not playing after patching.

Additional context
Attempted to play through browser, iOS app, and streaming to Chromecast.

Formats that I tried and are failing to play:

Container Video codec Audio codec
mp4 hevc aac_lc
matroska,webm h264 eac3

Video that was able to play successfully:

  • Container: mp4
  • Video codec: h264
  • Audio codec: aac_lc
@AlexPresso
Copy link
Owner

Hi @pedroms

I don't see any issue or sign that ffmpeg was running from the issue-report, did you played rhe video (and kept it playing in the background) when running the issue-report ?

Are these videos playing without the patch ?

@AlexPresso
Copy link
Owner

AlexPresso commented Dec 7, 2023

I just seen that the patch_utils.sh script was not loaded by the ffmpeg wrapper, it's required to run:

FFMPEG prev logs...................................
Cannot load patch_utils.sh

Could you please give me the output of the following commands:

  • ls -al /var/packages/VideoStation/patch
  • ls -al /var/packages/CodecPack/patch

@pedroms
Copy link
Author

pedroms commented Dec 10, 2023

did you played rhe video (and kept it playing in the background) when running the issue-report ?

@AlexPresso yes, but it just keeps loading, showing the loading spinner.

Are these videos playing without the patch ?

Here's the result with and without the patch:

Container Video codec Audio codec Plays with patch? Plays without patch?
mp4 hevc aac_lc
matroska,webm h264 eac3
mp4 h264 aac_lc

As for checking the patch_utils.sh script, here you go:

root@:~#     ls -al /var/packages/VideoStation/patch
total 16
drwxr-xr-x 2 root root 4096 Dec 10 08:53 .
drwxr-xr-x 6 root root 4096 Dec 10 08:55 ..
-rw-r--r-- 1 root root   62 Dec 10 08:53 patch_config.sh
-rw-r--r-- 1 root root 1497 Dec 10 08:53 patch_utils.sh
root@:~#     ls -al /var/packages/CodecPack/patch
total 16
drwxr-xr-x 2 root root 4096 Dec 10 08:53 .
drwxr-xr-x 5 root root 4096 Dec 10 08:54 ..
-rw-r--r-- 1 root root   62 Dec 10 08:53 patch_config.sh
-rw-r--r-- 1 root root 1497 Dec 10 08:53 patch_utils.sh

Thank you for your time and help with this 🙇

@AlexPresso
Copy link
Owner

Hi @pedroms, thanks to you for the feedback :) .

I don't have this issue using DSM 7.0+ but it could be a permission issue on DMS 6.2, could you please try to run the following commands to change the permissions of the patch files in VideoStation and CodecPack:

VideoStation

chown -R root:VideoStation /var/packages/VideoStation/patch
chmod -R 755 /var/packages/VideoStation/patch

CodecPack:

chmod -R 755 /var/packages/CodecPack/patch

After changing the permissions, please try to play a video file again and after waiting maximum 1 min, if nothing plays, please run the issue-report tool again and copy paste the output; so we can check if something changed or not :)

@pedroms
Copy link
Author

pedroms commented Dec 15, 2023

@AlexPresso after updating the permissions with those commands, this is the result:

root@:~#     ls -al /var/packages/VideoStation/patch
total 16
drwxr-xr-x 2 root VideoStation 4096 Dec 15 09:35 .
drwxr-xr-x 6 root root         4096 Dec 15 09:45 ..
-rwxr-xr-x 1 root VideoStation   62 Dec 15 09:35 patch_config.sh
-rwxr-xr-x 1 root VideoStation 1497 Dec 15 09:35 patch_utils.sh
root@:~#     ls -al /var/packages/CodecPack/patch
total 16
drwxr-xr-x 2 root root 4096 Dec 15 09:35 .
drwxr-xr-x 5 root root 4096 Dec 15 09:36 ..
-rwxr-xr-x 1 root root   62 Dec 15 09:35 patch_config.sh
-rwxr-xr-x 1 root root 1497 Dec 15 09:35 patch_utils.sh

I tried playing the video again (mp4, hevc, aac_lc) and it did not work 🙁 Here's the report: https://gist.github.com/pedroms/59173b5eb2eb10da2b14d2a58517e2d5

@AlexPresso
Copy link
Owner

@pedroms if you run the following command in your terminal, do you have any error ? source /var/packages/VideoStation/patch/patch_utils.sh ?

@pedroms
Copy link
Author

pedroms commented Dec 16, 2023

@AlexPresso no error, it does not return anything:

root@:~# source /var/packages/VideoStation/patch/patch_utils.sh
root@:~# 

@AlexPresso
Copy link
Owner

Hi @pedroms

Thank you for the tests, I added some error logging in the following PR (#116) it's not a fix for your issue yet, just a step for me to try get more informations about your issue, would it be possible for you to try it please:

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

Please try to run another video file and run the issue-report script again, hopefully we can get the error thrown when the script is trying to load patch_utils.sh

@pedroms
Copy link
Author

pedroms commented Dec 20, 2023

@AlexPresso followed your instructions. Here's the latest issue report: https://gist.github.com/pedroms/01f2e056d9557abdc7e26bc091c284d8

@AlexPresso
Copy link
Owner

Thank you for testing, that's great news we're making progress and I know how to fix it, I'll make some change in the patcher to give right permissions to the scripts, I'll get back to you when everything ready :)

@AlexPresso
Copy link
Owner

AlexPresso commented Dec 20, 2023

Could you just do this one last try before I make changes to the patcher please:
chmod -R 755 /var/packages/CodecPack/target/pack/bin

And try to play a video file as is

@AlexPresso
Copy link
Owner

AlexPresso commented Dec 20, 2023

I pushed a new test wrapper in #116

You can try it out using the following:

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

I'm not facing the same issue on DSM 7.0+, so it's possible the setuid on the CodecPack's scripts is messing with DSM 6.2 apparmor configuration, let's try :)

@pedroms
Copy link
Author

pedroms commented Dec 20, 2023

@AlexPresso thank you for your work to fix this. I followed your latest instructions and, even with the new test patch, the video fails to play 😕 Similar to the previous times, I ran the report tool while the video is trying to play: https://gist.github.com/pedroms/b5c18c64d22c0300a085fabebe4f66ce

@AlexPresso
Copy link
Owner

Okay, I'll remove these utils script and put everything back in the ffmpeg wrapper directly, so the script won't need to load any external file again

Sorry, it took long time but I wanted to test everything before choosing this solution

@AlexPresso
Copy link
Owner

AlexPresso commented Dec 21, 2023

Hi @pedroms

I pushed a new test wrapper in #117

You can try it out using the following:

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

There are no more external scripts to load so there should not be any permission issue anymore

@pedroms
Copy link
Author

pedroms commented Dec 22, 2023

@AlexPresso 🎉 it's all fixed now! Here's the result with the test patch:

Container Video codec Audio codec Plays?
mp4 hevc aac_lc
matroska,webm h264 eac3
mp4 h264 aac_lc

Thank you so much for your help and for keeping this patcher alive and well. Happy holidays!

@AlexPresso
Copy link
Owner

You're welcome, thanks to you for testing and for your patience :)

Happy Holidays ! 🎅

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.

2 participants