Closed ner00 closed 1 year ago
Hi @ner00
Could you try the following commands please, I was doing some tests and forgot to remove the limitation to ARMv8 CPUs:
curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/fix_gstreamer/patcher.sh | bash -s -- -a unpatch
curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/fix_gstreamer/patcher.sh | bash -s -- -a patch
Thanks for the reply @AlexPresso , but unfortunately that didn't seem to help.
Although, why would an ARMv8 CPU limitation influence the behavior of the wrapper with a x86_64 CPU?
Could you please provide:
/var/packages/VideoStation/target/bin/gst-inspect-1.0.orig | grep -E 'dts|eac3|truehd|h265'
Although, why would an ARMv8 CPU limitation influence the behavior of the wrapper with a x86_64 CPU?
There is no direct influence but I was not sure if the GSTOmx library was always present on every architectures
The cache clearing step was incorrect, please also try to unpatch/repatch using previous commands
No luck... although gst-inspect-1.0.orig
wasn't found :/
root@ner0-NAS:/# curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/fix_gstreamer/patcher.sh | bash -s -- -a unpatch
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7710 100 7710 0 0 18502 0 --:--:-- --:--:-- --:--:-- 18533
[2023-07-23 22:58:06] [INFO] ffmpeg-patcher v2.0
[2023-07-23 22:58:07] [Message of the day]
The patcher now supports every scenarios including gstreamer (credits to @nap-liu).
As always, please let me know of any issue you could have.
[2023-07-23 22:58:07] [INFO] You're running DSM 7.2 64570-1
[2023-07-23 22:58:07] [INFO] ====== Unpatch procedure ======
[2023-07-23 22:58:07] [INFO] Restoring libsynovte.so
[2023-07-23 22:58:07] [INFO] Restoring VideoStation's /var/packages/VideoStation/target/bin/ffmpeg.orig
[2023-07-23 22:58:07] [INFO] Restarting VideoStation...
restart package [VideoStation] successfully
[2023-07-23 22:58:17] [INFO] unpatch complete
root@ner0-NAS:/# curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/fix_gstreamer/patcher.sh | bash -s -- -a patch
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7710 100 7710 0 0 38353 0 --:--:-- --:--:-- --:--:-- 38550
[2023-07-23 23:00:06] [INFO] ffmpeg-patcher v2.0
[2023-07-23 23:00:07] [Message of the day]
The patcher now supports every scenarios including gstreamer (credits to @nap-liu).
As always, please let me know of any issue you could have.
[2023-07-23 23:00:07] [INFO] You're running DSM 7.2 64570-1
[2023-07-23 23:00:07] [INFO] ====== Patching procedure (branch: main) ======
[2023-07-23 23:00:07] [INFO] Saving current ffmpeg as ffmpeg.orig
[2023-07-23 23:00:07] [INFO] Downloading and installing ffmpeg's wrapper...
[2023-07-23 23:00:08] [INFO] Setting ffmpeg version to: ffmpeg
[2023-07-23 23:00:08] [INFO] Saving current libsynovte.so as libsynovte.so.orig
[2023-07-23 23:00:08] [INFO] Enabling eac3, dts and truehd
[2023-07-23 23:00:08] [INFO] Restarting VideoStation...
restart package [VideoStation] successfully
[2023-07-23 23:00:18] [INFO] Done patching, you can now enjoy your movies ;) (please add a star to the repo if it worked for you)
root@ner0-NAS:/# /var/packages/VideoStation/target/bin/gst-inspect-1.0.orig | grep -E 'dts|eac3|truehd|h265'
-ash: /var/packages/VideoStation/target/bin/gst-inspect-1.0.orig: No such file or directory
Hmm, the issue is that the patcher is not downloading the gstreamer files at all Do you have the following file :
/var/packages/VideoStation/target/bin/gst-launch-1.0
?Do you have the following file :
* `/var/packages/VideoStation/target/bin/gst-launch-1.0` ?
No, also says not found.
AME is installed, but not signed-in as I mentioned.
okay 🤔 what about /var/packages/CodecPack/target/pack/bin/gst-launch-1.0 ?
Negative!
root@ner0-NAS:/# ls /var/packages/CodecPack/target/bin
ffmpeg33-for-audio ffmpeg33-for-surveillance ffmpeg41 synocodectool
Okay, so my assumptions were correct, gstreamer/GSTOmx seems to only be present on ARMv8 CPUs.
the content of CodecPack you posted is after patch or "unpatched" ? I'm asking because ffmpeg41 should be copied to ffmpeg41.orig after patch
But anyway, AME is the one providing HEVC support, so you will need to inject a licence to bypass the synology account (I'm on phone right now, but there are tools to do it)
I could add it in the wrapper in a future release
the content of CodecPack you posted is after patch or "unpatched" ? I'm asking because ffmpeg41 should be copied to ffmpeg41.orig after patch
This is after patch, there is no *.orig
even in this folder, although the patcher says Saving current ffmpeg as ffmpeg.orig
; it doesn't mention ffmpeg41
or ffmpeg41.orig
That's very strange behavior, the patcher is looping over ffmpeg files in AME to create symlinks
But anyway, AME is the one providing HEVC support, so you will need to inject a licence to bypass the synology account
Oh, in that case then it would never work lol I need to try to find how this is done.
I'll send a link tomorrow
Some progress on this front, I found a patch for AME, namely a python script named amepatch.py
which happens to be compatible with the latest AME version. This patch seems to work in order to enable HEVC support in AME and now playback works, but then I have an issue with CPU usage...
ffmpeg
immediately starts gobbling 80%-90% of CPU time to decode the video, reaching 99% in a few minutes. I guess there's no HW acceleration so it ends up using the only thing it can and that's basic SW decoding. Curiously, a new ffmpeg
process is spawned every time that I seek, so after 3 seeks I'll have 4 processes running, each using 25% of the CPU.
I assume this is essentially how it's supposed to work when HEVC has no HW decoding support, unless there are any other steps I could take to minimize the impact on CPU usage?
Curiously, a new ffmpeg process is spawned every time that I seek, so after 3 seeks I'll have 4 processes running, each using 25% of the CPU
Yes this one is an issue in VideoStation's code, it's not killing the previous process when spawning a new one, I can try to make a "hack" for it, like writing the previous process PID in a file and kill it when a new process is spawned for the same file, but to make it work I need to find if the client is the same as the other process. Because if I can't do it, there's a chance two people trying to play the same file will kill each others process and... that's not good 😅
But there is something I don't understand here: Why the patcher didn't create a symlink to VideoStation's ffmpeg (once patched it's the SynoCommunity's ffmpeg)
Aaaaah I know why, you gave me the content of [...]/target/bin
but the .orig
file is in [...]/target/pack/bin
(notice the "pack") 😉
My bad, the orphan processes were due to the shell script, by default, exiting a shell script doesn't kill child processes, I fixed it It will not change anything for HW transcoding but at least you'll not eat all your NAS resources when changing video time
Yes this one is an issue in VideoStation's code, it's not killing the previous process when spawning a new one
I was about to say that this is incorrect given that, since AME license was a prerequisite, after patching that I could now play videos without your wrapper or community FFMPEG at all. And in that case there is no duplicate processes ever when seeking.
I might try some more later today, busy at the moment. I also need to get to the bottom of the lack of HW acceleration, but that's outside the scope of this wrapper.
My bad, the orphan processes were due to the shell script, by default, exiting a shell script doesn't kill child processes, I fixed it It will not change anything for HW transcoding but at least you'll not eat all your NAS resources when changing video time
Okay, so this is fixed. Seeking no longer spawns a new ffmpeg process each time. I still can't get HEVC to play smoothly since the CPU keeps getting hammered doing SW decoding or maybe transcoding, I have no clue - anyway, that's off-topic.
By the way, did you have a different AME license patch in mind or was it the same as I mentioned above? The python script looks flimsy in that a new version of AME is probably going to disable the license.
Anyway, thanks for the hard work!
Thanks for the feedback Yes I had the same tool in mind, that's the one used by many xpenology users as far as I know
Before going any further, I should clarify that I'm using DSM 7 in a PC, not an actual Synology NAS - this patches the system to boot as if it was a DS920+ Intel Gemini Lake but actually it's an Intel i5 4590. The only thing I'm not positive on is if by needing AME I also need an actual Synology account and a license or if maybe the issue is hardware-related.
I've followed the first steps:
System details
Describe the bug HEVC videos do not play (tried with AAC, OPUS and EAC3 audio)
ffmpeg.log
(containing the ffmpeg-wrapper execution logs)The playback never starts, so I assume this is the reason for no log file; I had log files there but deleted them to start with a fresh log, but no log file gets produced when attmpting to load HEVC files, although it does generate a log file when playing valid videos like H264 encoded ones.
ffmpeg-xxxx.stderr
(containing chunks transcoding operations)Same as above, no error log file gets produced since no playback occurs.
gstreamer.log
(containing the ffmpeg-wrapper execution logs)No gstreamer log exists inside /tmp
gstlaunch-xxxx.stderr
(containing chunks transcoding operations)Same as above, no error log file gets produced, probably because no playback occurs.