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] Fileplay stutter [need someone with DS916+ to reproduce] #15

Closed
Joeri87 opened this issue Oct 25, 2021 · 67 comments
Closed

[BUG] Fileplay stutter [need someone with DS916+ to reproduce] #15

Joeri87 opened this issue Oct 25, 2021 · 67 comments
Labels
good first issue Good for newcomers

Comments

@Joeri87
Copy link

Joeri87 commented Oct 25, 2021

https://gist.github.com/BenjaminPoncet/bbef9edc1d0800528813e75c1669e57e
Dear Alex,

Thanks for this amazing work but I have an issue.

My setup is:

  • DS916+ with 8GB ram
  • DSM 6.2.4-25556 Update 2
  • Video Station 2.5.0.-1656
  • ffmpeg 4.3.2-38
  • Advanced Media Extensions 1.0.1-0025.

I ran the scripts and now the video's play, but there is some issues when playing this file:

  • Video: HVC1 1920x960 23.976fps [V: hevc main 10 L4.0, yuv420p10le, 1920x960 [default]]
  • Audio: DD+ 48000Hz 6ch 640kbps [A: English [eng] (eac3, 48000 Hz, 5.1, 640 kb/s)]

I use a Chromium 93 browser to play and have VLC player installed

  1. When playing this file there is a buffer/reload every 3 seconds that lasts almost 5 seconds on high and on low a stutter of 1-2 seconds every 5 seconds.
  2. I can not choose play original stream, only low, medium and high are available in browser.
  3. After closing the browser the FFmpeg task keeps burning CPU percentages and only uninstalling ffmpeg / rebooting the unit helps.
  4. Opening the video again makes another never ending FFmpeg task again draining 10-20% CPU per task.
  • Is my setup too weak for this type of file or is it not using hardware decoding?
  • Why can I not choose original?
  • The ffmpeg task not closing seems a bug.

This is already proof it could work and I'm happy and now hoping it's fixable :).
p.s. im a linux noob, so getting the ffmpeg logs I need more help with the exact steps... sorry....

@AlexPresso
Copy link
Owner

AlexPresso commented Oct 25, 2021

Hello Joeri,

Thank you for your issue, I'm glad you appreciate the script 😉.

Before I answer your questions, I need to give you a bit of context on how all of that works:

By default, when using the legacy VideoStation (without patch), playing a video calls an embeded ffmpeg library (a library used to encode/decode/transcode and manipulate video files), which only "decodes" your video files.
But when using the patched version, VideoStation is having a different behavior. When it tries to call what it thinks to be the embeded ffmpeg library, it runs the "ffmpeg-wrapper" script.
At first, that script tries to play the video using the default VideoStation's ffmpeg library. If it fails, it tries to "wrap" the decoding inside the SynoCommunity's ffmpeg library to realtime transcode (convert video/audio codec from one to another) unreadable codecs (in your case, audio from EAC3 to MP3).

Is my setup too weak for this type of file or is it not using hardware decoding ?

I often have this bug on a DS218Play too. Because realtime transcoding is a heavy task, I assume it is because of the NAS specs, but we can investigate to check it if you want.

Why can I not choose original ?

The "original" setting is only choosable when the embeded (default) ffmpeg is used, if it's using the SynoCommunity's ffmpeg (wrapper), it's transcoding and then it's impossible to have an "original" quality (there's a bit of quality loss when transcoding).

The ffmpeg task not closing seems a bug.

Yes, that is probably a bug, we need to investigate that.

@AlexPresso
Copy link
Owner

AlexPresso commented Oct 25, 2021

Here are the steps to get the logs:

  • Start the video on VideoStation, wait for the video to play and put the browser in background (keep the video playing)
  • Connect through SSH (help)
  • Switch to root user: sudo -i

ffmpeg.log (containing the ffmpeg-wrapper execution logs)

  • Go to the temporary directory: cd /tmp
  • Type ls -al | grep ffmpeg to list all files containing "ffmpeg" and check you have one named ffmpeg.log
  • Type tail -200 ffmpeg.log to print the last 200 lines to the console
  • Copy paste those lines in a new gist

ffmpeg-FFMxxxx.stderr (containing chunks transcoding operations)

  • When you ran ls -al | grep ffmpeg you should have seen another file that looks like ffmpeg-FFMxxxx.stderr
  • Type tail -100 ffmpeg-FFMxxxx.stderr (replacing the filename by the correct one)
  • Copy paste those lines in a new gist
  • Type head -300 ffmpeg-FFMxxxx.stderr (replacing the filename by the correct one)
  • Copy paste those lines in another new gist
  • Copy paste all the gists links in a new comment :)

@AlexPresso AlexPresso added the good first issue Good for newcomers label Oct 25, 2021
@Joeri87
Copy link
Author

Joeri87 commented Oct 25, 2021

Dear Alex,

Thank you for the quick response and the help!

Here they are:
https://gist.github.com/Joeri87/51c89dacdb8d06ca320d5cd414933c22
https://gist.github.com/Joeri87/43abb04598abf90cbca41772cfd199a8
https://gist.github.com/Joeri87/63e5a0ca3b091486a77050db192d0d52

Indeed it seems something with the codec?
2021-10-25 19:25:27 - FFM3275 - = Decoder (codec hevc) not found for input stream #0:0

I often have this bug on a DS218Play too. Because realtime transcoding is a heavy task, I assume it is because of the NAS specs, but we can investigate to check it if you want

Well, it's called hardware transcoding for a reason. I was expecting it would do the decoding part as well in hardware. It seams that was misleading of Synology. Inside is an Intel Pentium N3710
https://www.cpu-monkey.com/en/igpu-intel_hd_graphics_405_16eu-142
(Synology sales statements Hardware transcodingengine supported codecs: H.264 (AVC), H.265 (Hevc), MPEG-2 and VC-1; Maximum resolution: 4k (4096 x 2160); Maximum frame rate per second (fps): 30)
Still wonder if this decoding is the problem of the 5sec. stutters. It only uses 20-40% CPU

The "original" setting is only choosable when the embeded (default) ffmpeg is used, if it's using the SynoCommunity's ffmpeg (wrapper), it's transcoding and then it's impossible to have an "original" quality (there's a bit of quality loss when transcoding).

I hope this passthrough (no transcoding) can be achieved someday.... Maybe this is a Synology thing?

Yes, that is probably a bug, we need to investigate that.

I hope you can help :D

@AlexPresso
Copy link
Owner

AlexPresso commented Oct 26, 2021

Hey there,

That "codec not found" error is an expected behavior, I need to work on that but at the moment, the patch isn't wrapping Advanced Media Extensions at all, so it can guess the codec but not decode it. The SynoCommunity ffmpeg is handling it.

I would say your buffering occurs because of that: https://gist.github.com/Joeri87/51c89dacdb8d06ca320d5cd414933c22#file-ffmpeg-log-L203 because the audio in your file is not always synchronized with the video, it needs to "resync" and it's what the buffering task does. That desync could happen if you lose packets too, but in your case (and because of that Mkvmerge software), I'm pretty sure the file is having an encoding issue.

About hardware transcoding, it seems like it failed to initialize:

Could you:

  • Connect through SSH
  • Switch to root user sudo -i
  • Run sudo /var/packages/ffmpeg/target/bin/vainfo
  • Copy paste output to a new gist

I hope this passthrough (no transcoding) can be achieved someday.... Maybe this is a Synology thing?

I don't think it will, Synology don't want to pay for the DTS license so it's not included in the embeded ffmpeg library. Also, HEVC/x265 isn't natively supported by browsers, so it need to be transcoded to at least x264.

About the bug (ffmpeg process stays alive after you close the app) could you open the "Resources monitor" on DSM and give me the ffmpeg process name that is staying alive. Also try to wait for a minute to see if it gets killed later or not.

@Joeri87
Copy link
Author

Joeri87 commented Oct 26, 2021

the patch isn't wrapping Advanced Media Extensions at all,

I'm not that well educated in this matter, but I can see its missing something.
Now im just curious whats so good about these advanced media extensions?

About hardware transcoding, it seems like it failed to initialize:

Since I saw the chips specification I think saying hardware transcoding is a lie and it can only be software decoding / hardware encoding. So then I imagine the decoding part is going very inefficient/wrong?

because the audio in your file is not always synchronized with the video, it needs to "resync" and it's what the buffering task does

I'll try and look into this.

  • Run sudo /var/packages/ffmpeg/target/bin/vainfo

I did the and here's the output: https://gist.github.com/Joeri87/b64fb71c55db802ce68f682021b2e68f

Also, HEVC/x265 isn't natively supported by browsers

I see

About the bug (ffmpeg process stays alive after you close the app) could you open the "Resources monitor" on DSM and give me the ffmpeg process name that is staying alive. Also try to wait for a minute to see if it gets killed later or not.

Just start the stream and stop the stream now suddenly works, but, I did some more tests and this only happens when I open the video and it autimatically goes to High-Quality and I switch it manually to low quality. Both handmaid tale and rick and morty files, both H265 files. Now it's eating CPU....
Naamloos
It stay's like this for over 10 minutes now....
https://gist.github.com/Joeri87/635f6c4c8762a39624b52f4299160412

@AlexPresso
Copy link
Owner

AlexPresso commented Oct 26, 2021

Now im just curious whats so good about these advanced media extensions?

It's supposed to bring HEVC & cie capabilities to VideoStation / other DSM apps

I did the and here's the output: https://gist.github.com/Joeri87/b64fb71c55db802ce68f682021b2e68f

@th0ma7 (sorry for the ping but you're more qualified than me for that topic), do you know if the iHD driver failing to load is a normal behavior ?

@th0ma7
Copy link

th0ma7 commented Oct 26, 2021

That's a possibility. DS916 uses a braswell processor (https://github.com/SynoCommunity/spksrc/wiki/Architecture-per-Synology-model) and supported CPU starts with bradwell for iHD driver (https://github.com/intel/media-driver). With that in mind, yes, it looks unsupported. The easy fix is to rename the iHD driver file so you use the legacy vaapi driver:

$ sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so /var/packages/ffmpeg/target/lib/iHD_drv_video.so.disable

Here's the output on my DS918+ using DSM-6.2.4 (apollolake CPU) before disabling iHD:

$ /var/packages/ffmpeg/target/bin/vainfo 
libva info: VA-API version 1.13.0
libva info: Trying to open /var/packages/ffmpeg/target/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_13
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.3.5 (fd039c57)
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
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointFEI
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD

And output after:

$ /var/packages/ffmpeg/target/bin/vainfo 
libva info: VA-API version 1.13.0
libva info: Trying to open /var/packages/ffmpeg/target/lib/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /var/packages/ffmpeg/target/lib/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_13
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Broxton - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD

@Joeri87
Copy link
Author

Joeri87 commented Oct 26, 2021

With that in mind, yes, it looks unsupported. The easy fix is to rename the iHD driver file so you use the legacy vaapi driver:

It seems like this is probrably the same kind of issue, being the vaapi driver not being properly used/implemented?
https://youtu.be/fTISHfy-rYg?t=502

I'd love to try this command, but I hope I can manage to repair it when needed since i'm a noob when it comes to command line.
$ sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so /var/packages/ffmpeg/target/lib/iHD_drv_video.so.disable

@Joeri87
Copy link
Author

Joeri87 commented Oct 26, 2021

Okay, now this happend:

sudo /var/packages/ffmpeg/target/bin/vainfo
libva info: VA-API version 1.11.0
libva info: Trying to open /var/packages/ffmpeg/target/lib/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /var/packages/ffmpeg/target/lib/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_11
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.11 (libva 2.11.0)
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 2.4.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD

So like both drivers are missing in the FFMPEG package??

@AlexPresso
Copy link
Owner

It's perfect, now could you try to play your movie and redo all the following please:

Here are the steps to get the logs:

  • Start the video on VideoStation, wait for the video to play and put the browser in background (keep the video playing)
  • Connect through SSH (help)
  • Switch to root user: sudo -i

ffmpeg.log (containing the ffmpeg-wrapper execution logs)

  • Go to the temporary directory: cd /tmp
  • Type ls -al | grep ffmpeg to list all files containing "ffmpeg" and check you have one named ffmpeg.log
  • Type tail -200 ffmpeg.log to print the last 200 lines to the console
  • Copy paste those lines in a new gist

ffmpeg-FFMxxxx.stderr (containing chunks transcoding operations)

  • When you ran ls -al | grep ffmpeg you should have seen another file that looks like ffmpeg-FFMxxxx.stderr
  • Type tail -100 ffmpeg-FFMxxxx.stderr (replacing the filename by the correct one)
  • Copy paste those lines in a new gist
  • Type head -300 ffmpeg-FFMxxxx.stderr (replacing the filename by the correct one)
  • Copy paste those lines in another new gist
  • Copy paste all the gists links in a new comment :)

@Joeri87
Copy link
Author

Joeri87 commented Oct 26, 2021

Well, same issue... Nothing has changed when you watch it...
I understand something is up with the file (even though it plays perfect on windows and libre elec).

Sill im curious if there is a driver issue?

Here are the outputs
https://gist.github.com/Joeri87/29515780084bea68989b1f61fe9b70b5
and
https://gist.github.com/Joeri87/321ddee88369704f98fe3fbbb5df4a14

@EngMarc
Copy link

EngMarc commented Nov 21, 2021

@AlexPresso
So, been on here a lot in the past and really appreciate @th0ma7 (Vincent) work. We could never be where we are without it.
Of late, I have recently updated VideoStation to 3.0.1-2067 and have ffmpeg 4.3.3-39 from the community forum. I've mod'd several updrages in the past to be able to play DTS, eac3 and TrueHD with good success. I use the script to do the mods once VideoStation is updated to get back to be able to play the formats.

This last time, I did the script post update and it won't play eac3 files. I could get it to play simple files (mkv, etc.) but it just spins with the video red circle spinning. On the server, there isn't any ffmpeg process running nor is the any ffm*.log file in the /tmp directory. It seems like it must be launching the ffmpeg process that then dies for some reason or it isn't launching at all.

Has anyone seen this recently with the new VideoStation? (I'm on DSM 7.0.1-42218).

Any help is appreciated,
Marc

The script I use is below:
ssh to server

Run the below uncommented lines sequentially

First STOP VideoStation package

These are the full steps I take to get everything working on my DS1817+ (Intel Atom as well):

sudo mv /var/packages/VideoStation/target/bin/ffmpeg /var/packages/VideoStation/target/bin/ffmpeg.old
sudo mv /var/packages/VideoStation/target/bin/ffprobe /var/packages/VideoStation/target/bin/ffprobe.old
sudo ln -sf /var/packages/ffmpeg/target/bin/ffprobe /var/packages/VideoStation/target/bin/ffprobe
sudo mv /var/packages/VideoStation/target/bin/vainfo /var/packages/VideoStation/target/bin/vainfo.old
sudo ln -sf /var/packages/ffmpeg/target/bin/vainfo /var/packages/VideoStation/target/bin/vainfo
sudo cp -p /var/packages/VideoStation/target/lib/libsynovte.so /var/packages/VideoStation/target/lib/libsynovte.so.old
sudo sed -i 's/eac3/BLAH/' /var/packages/VideoStation/target/lib/libsynovte.so
sudo sed -i 's/dts/ZAP/' /var/packages/VideoStation/target/lib/libsynovte.so
sudo sed -i 's/truehd/IGNORE/' /var/packages/VideoStation/target/lib/libsynovte.so

@AlexPresso
Copy link
Owner

AlexPresso commented Nov 21, 2021

Hi @EngMarc

The script/steps you are using are not working because they're not patching the files from Advanced Media Extensions.

To start from a clean install of VideoStation, could you try to:

Note that: there's a known issue on x265 10bits transcoding, but I've planned to fix it later.

@EngMarc
Copy link

EngMarc commented Nov 21, 2021

Ok I looked through the 'patcher.sh' script. Seems to be the same files but could be wrong.
Your script
mv libsynovte.so -> .orig
sed to replace eac3, dts, truehd in libsynovte.so
renames orig ffmpeg -> ffmpeg.orig
ln new ffmpeg to orig ffmpeg

You do have the processing of these libraries which is likely the problem. Are your library mods compatible with ffmpeg 4 and DSM 7?
modded libraries:
"libavcodec.so.56", "libavdevice.so.56", "libavfilter.so.5", "libavformat.so.56", "libavutil.so.54", "libpostproc.so.53", "libswresample.so.1", "libswscale.so.3"

Also, I didn't get any 'Advanced Media Extensions' related questions on install or uninstall.

I do have surveillance running and found that VideoStation calls /var/packages/CodecPack/target/bin/ffmpeg41 instead of the one under VideoStation/target/bin. I did add that to my mv and ln but still get spinning red circle.

@AlexPresso
Copy link
Owner

Ok I looked through the 'patcher.sh' script. Seems to be the same files but could be wrong

For the default procedure yes, but as you say, you're not patching the ffmpeg41, ffmpeg33 an ffmpeg27 from Advanced Media Extensions, which is likely to be the problem.

Also, I didn't get any 'Advanced Media Extensions' related questions on install or uninstall.

Advanced Media Extensions is the "public" name for Codec Pack, it may have been installed by default when you upgraded to DSM 7.

You do have the processing of these libraries which is likely the problem. Are your library mods compatible with ffmpeg 4 and DSM 7

These files are only replaced on ARMv8 architectures (and for older DSM versions), your NAS will only get the "wrapper_procedure", injecting an improved version of the ffmpeg_wrapper (using SynoCommunity's ffmpeg latest version when needed).

Have you tried to run the patcher ?

@EngMarc
Copy link

EngMarc commented Nov 21, 2021

Just checked and my libraries are not the same as referenced in your patcher.sh script. Here's mine:
libavcodec.so.58
libavdevice.so.58
libavfilter.so.7
libavformat.so.58
libavutil.so.56
libpostproc.so.55
libswresample.so.3
libswscale.so.5

I did ln the ffmpeg41 in the CodecPack dir which didn't make any difference.

As for my CodecPack, there's only this in the bin dir:
ffmpeg33-for-surveillance
4 lrwxrwxrwx 1 root root 38 Nov 21 17:12 ffmpeg41 -> /var/packages/ffmpeg/target/bin/ffmpeg
ffmpeg41-for-synoface
ffmpeg41.old
synocodectool
vainfo

Maybe I need to also link the 'ffmpeg41-for-synoface' ?

@EngMarc
Copy link

EngMarc commented Nov 21, 2021

So took a look at the ffmpeg-wrapper.sh
That was used a long time ago on DSM 6 as I recall as a work around until Vincent could get the native ffmpeg compiled. Once that was compiled, I went back to using the linked ffmpeg file and it worked nicely with less resources.

So, are you saying now that the ONLY work around is to use the ffmpeg-wrapper.sh script to redirect the ffmpeg call? Seems the compiled ffmpeg4.1 should support all the command line options that synology used (according to Vincent).

I could be wrong but trying to understand the history from and why going back to the script?

@AlexPresso
Copy link
Owner

Let's open a new issue for that as it's not related in any way with a Stutter

@EngMarc
Copy link

EngMarc commented Nov 21, 2021

ok, not sure how to do that but I'm game

@Joeri87
Copy link
Author

Joeri87 commented Apr 25, 2022

BUMP
How is the progress going on this bug?

@AlexPresso
Copy link
Owner

Unfortunately, I cannot reproduce the issue on my NAS and have no idea why it does it to you.

Updating to the latest DSM version would grant you to update VideoStation to the latest version and maybe fix the problem, but it may also break some other packages (like if you're using Transmission, Bazar and this kind of packages).

It's the only idea I have for the moment.
I'll keep the issue open in case someone else with the same specs has the ability to try reproduce it.

@AlexPresso AlexPresso added the help wanted Extra attention is needed label May 8, 2022
@AlexPresso AlexPresso changed the title [BUG] Fileplay stutter [BUG] Fileplay stutter [need someone with DS916+ to reproduce] May 8, 2022
@AlexPresso AlexPresso mentioned this issue May 10, 2022
@AlexPresso AlexPresso linked a pull request Jun 1, 2022 that will close this issue
@AlexPresso
Copy link
Owner

Hi @Joeri87 Could you please try the new wrapper using the following commands and tell me if you still have the issue:

  • curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/main/patcher.sh | bash -s -- -a unpatch
  • curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/main/patcher.sh | bash -s -- -b new_wrapper

@AlexPresso
Copy link
Owner

Hi Joeri, I pushed the fix, could you please try to run the following:

  • Connect through SSH and switch to root user
  • (only if you haven't unpatched your VideoStation's installation) curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/main/patcher.sh | bash -s -- -a unpatch
  • Patch with the new_wrapper: curl https://raw.githubusercontent.com/AlexPresso/VideoStation-FFMPEG-Patcher/main/patcher.sh | bash -s -- -b new_wrapper

@Joeri87
Copy link
Author

Joeri87 commented Jun 8, 2022

Dear @AlexPresso ,

Thank you for your update and work.
I unpatched last time already so did only the new wrapper patch.

Now ffmpeg33 starts but has 0% cpu en ffmpeg has 40% cpu usage. Lots of hiccups. Now its even a bit worst then last time.
How is the driver? Is it using hardware decoding?

Here is the output
ls -al /var/packages/VideoStation/target/bin
total 2148
drwxr-xr-x 1 VideoStation VideoStation 832 Jun 8 19:43 .
drwxr-xr-x 1 VideoStation VideoStation 198 Jun 4 18:31 ..
-rwxr-xr-x 1 VideoStation VideoStation 54163 Jul 1 2021 cffmpeg
-rwxr-xr-x 1 VideoStation VideoStation 33403 Jul 1 2021 check_folder_conf
-rwsr-x--- 1 root VideoStation 25203 Jul 1 2021 db_setup_handler
-rwxr-xr-x 1 VideoStation VideoStation 12627 Jul 1 2021 dtvstreamserver
-rwxr-xr-x 1 VideoStation VideoStation 247200 Jul 1 2021 dvblast
-rwxr-xr-x 1 VideoStation VideoStation 119792 Jul 1 2021 dvblastctl
-rwsr-x--- 1 root VideoStation 857 Jun 8 19:43 ffmpeg
-rwsr-x--- 1 root VideoStation 251184 Jul 1 2021 ffmpeg.orig
-rwxr-xr-x 1 VideoStation VideoStation 151520 Jul 1 2021 ffprobe
-rwxr-xr-x 1 VideoStation VideoStation 59768 Jul 1 2021 hdhomerun_config
-rwxr-xr-x 1 VideoStation VideoStation 25179 Jul 1 2021 hdhomerunscan
-rwxr-xr-x 1 VideoStation VideoStation 10264 Jul 1 2021 lsdvb
-rwxr-xr-x 1 VideoStation VideoStation 8371 Jul 1 2021 plugin_check
-rwxr-xr-x 1 VideoStation VideoStation 12963 Jul 1 2021 plugin_runner
-rwxr-xr-x 1 VideoStation VideoStation 58768 Jul 1 2021 scan
-rwsr-x--- 1 root VideoStation 38009 Jul 1 2021 synocodectool
-rwxr-xr-x 1 VideoStation VideoStation 8379 Jul 1 2021 synodtvd_ffmpeg_record
-rwxr-xr-x 1 VideoStation VideoStation 64574 Jul 1 2021 synodvbepg
-rwsr-x--- 1 root VideoStation 103804 Jul 1 2021 synovideoconversion
-rwsr-x--- 1 root VideoStation 90931 Jul 1 2021 synovideoindex
-rwsr-x--- 1 root VideoStation 103459 Jul 1 2021 synovideopreprocess
-rwsr-x--- 1 root VideoStation 8411 Jul 1 2021 synovideostation
-rwsr-x--- 1 root VideoStation 41603 Jul 1 2021 synovideostation_update_conf
-rwsr-x--- 1 root VideoStation 8379 Jul 1 2021 synovideostation_user_check
-rwsr-x--- 1 root VideoStation 8347 Jul 1 2021 synovideostation_user_del
-rwsr-x--- 1 root VideoStation 90907 Jul 1 2021 synovideosubtitleextraction
-rwxr-xr-x 1 VideoStation VideoStation 18960 Jul 1 2021 szap
-rwxr-xr-x 1 VideoStation VideoStation 24304 Jul 1 2021 szap-s2
-rwxr-xr-x 1 VideoStation VideoStation 23120 Jul 1 2021 tzap
-rwxr-xr-x 1 VideoStation VideoStation 14768 Jul 1 2021 vainfo
-rwsr-x--- 1 root VideoStation 95203 Jul 1 2021 video_hash
-rwxr-xr-x 1 VideoStation VideoStation 298512 Jul 1 2021 w_scan

ls -al /var/packages/CodecPack/target/bin
total 1016
drwxr-xr-x 1 root root 214 Jun 8 19:43 .
drwxr-xr-x 1 root root 24 Jun 4 18:30 ..
lrwxrwxrwx 1 root root 44 Jun 8 19:43 ffmpeg27 -> /var/packages/VideoStation/target/bin/ffmpeg
-rwxr-xr-x 1 root root 217960 Mar 18 2021 ffmpeg27.orig
lrwxrwxrwx 1 root root 44 Jun 8 19:43 ffmpeg33 -> /var/packages/VideoStation/target/bin/ffmpeg
-rwxr-xr-x 1 root root 242800 Mar 18 2021 ffmpeg33-for-surveillance
-rwxr-xr-x 1 root root 247088 Mar 18 2021 ffmpeg33.orig
-rwxr-xr-x 1 root root 254984 Mar 18 2021 ffmpeg41-for-synoface
-rwxr-xr-x 1 root root 38073 Mar 18 2021 synocodectool
-rwxr-xr-x 1 root root 14768 Mar 18 2021 vainfo

ls -al /var/packages/CodecPack/target/pack/bin
ls: cannot access /var/packages/CodecPack/target/pack/bin: No such file or directory

tail -200 ffmpeg.log

[2022-06-08 19:48:20] [INFO] ========================================[start ffmpeg 4886]
[2022-06-08 19:48:20] [INFO] DEFAULT_ARGS: -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/video/TV shows/The Handmaid's Tale/Season 04/The Handmaid's Tale - S04E01 - Pigs.mkv -vcodec h264_vaapi -vf format=nv12|vaapi,hwupload,setsar=sar=1,scale_vaapi=w=1920:h=960 -vsync 2 -bf 0 -vb 8000000 -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 -avoid_negative_ts 0 -break_non_keyframes 1 -max_muxing_queue_size 1024 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_iRb1IIQf/slice-%05d.ts

[2022-06-08 19:49:01] [INFO] ========================================[start ffmpeg 5332]
[2022-06-08 19:49:01] [INFO] DEFAULT_ARGS: -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/video/TV shows/The Handmaid's Tale/Season 04/The Handmaid's Tale - S04E01 - Pigs.mkv -vcodec h264_vaapi -vf format=nv12|vaapi,hwupload,setsar=sar=1,scale_vaapi=w=1280:h=640 -vsync 2 -bf 0 -vb 1000000 -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 -avoid_negative_ts 0 -break_non_keyframes 1 -max_muxing_queue_size 1024 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_2poT5BJo/slice-%05d.ts
[2022-06-08 19:49:06] [INFO] ========================================[end ffmpeg 4886]

[2022-06-08 19:50:09] [INFO] ========================================[end ffmpeg 5332]

[2022-06-08 19:50:30] [INFO] ========================================[start ffmpeg 6666]
[2022-06-08 19:50:30] [INFO] DEFAULT_ARGS: -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/video/TV shows/The Handmaid's Tale/Season 04/The Handmaid's Tale - S04E01 - Pigs.mkv -vcodec h264_vaapi -vf format=nv12|vaapi,hwupload,setsar=sar=1,scale_vaapi=w=1920:h=960 -vsync 2 -bf 0 -vb 8000000 -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 -avoid_negative_ts 0 -break_non_keyframes 1 -max_muxing_queue_size 1024 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-%05d.ts

head -300 ffmpeg-6666.stderr
ffmpeg version 4.4.2-44 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 4.9.3 (crosstool-NG 1.20.0) 20150311 (prerelease)
configuration: --target-os=linux --cross-prefix=/home/spksrc/ffmpeg-extras/spksrc/toolchain/syno-x64-6.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --prefix=/var/packages/ffmpeg/target --extra-cflags=-I/home/spksrc/ffmpeg-extras/spksrc/spk/ffmpeg/work-x64-6.1/install/var/packages/ffmpeg/target/include --extra-ldflags=-L/home/spksrc/ffmpeg-extras/spksrc/spk/ffmpeg/work-x64-6.1/install/var/packages/ffmpeg/target/lib --extra-libs='-lxml2 -ldl' --pkg-config=/usr/bin/pkg-config --ranlib=/home/spksrc/ffmpeg-extras/spksrc/toolchain/syno-x64-6.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=44 --extra-cflags=-DSYNO_VIDEOSTATION --extra-cflags=-fno-if-conversion --extra-cflags=-O3 --extra-cflags=-Wno-deprecated-declarations --enable-libxml2 --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-libopus --enable-libsoxr --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librabbitmq --enable-libzvbi --enable-libx264 --enable-libx265 --enable-libvpx --enable-libshine --enable-libdav1d --enable-frei0r --enable-librist --enable-libzimg --enable-libfdk-aac --enable-nonfree --enable-libass --enable-libaom --enable-libsvtav1 --enable-libsvthevc --arch=x86_64 --enable-vaapi --enable-libmfx --enable-libdrm
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, matroska,webm, from '/volume1/video/TV shows/The Handmaid's Tale/Season 04/The Handmaid's Tale - S04E01 - Pigs.mkv':
Metadata:
encoder : libebml v1.4.2 + libmatroska v1.6.4
creation_time : 2021-06-06T22:41:22.000000Z
Duration: 00:55:55.74, start: 0.000000, bitrate: 4780 kb/s
Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709), 1920x960, SAR 1:1 DAR 2:1, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Metadata:
BPS : 4138498
DURATION : 00:55:55.728000000
NUMBER_OF_FRAMES: 80457
NUMBER_OF_BYTES : 1735959328
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
Metadata:
BPS : 640000
DURATION : 00:55:55.744000000
NUMBER_OF_FRAMES: 104867
NUMBER_OF_BYTES : 268459520
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Subtitle: subrip
Metadata:
BPS : 42
DURATION : 00:55:38.802000000
NUMBER_OF_FRAMES: 646
NUMBER_OF_BYTES : 17603
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:3(eng): Subtitle: subrip
Metadata:
title : SDH
BPS : 51
DURATION : 00:55:38.802000000
NUMBER_OF_FRAMES: 794
NUMBER_OF_BYTES : 21472
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
Stream #0:1 -> #0:1 (eac3 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[hevc @ 0x1a97400] No support for codec hevc profile 2.
[hevc @ 0x1a97400] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
Incompatible pixel format 'yuv420p' for codec 'h264_vaapi', auto-selecting format 'vaapi_vld'
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00000.ts' for writing
Output #0, stream_segment,ssegment, to '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-%05d.ts':
Metadata:
encoder : Lavf58.76.100
Stream #0:0: Video: h264 (High), vaapi_vld(tv, bt709, progressive), 1920x960 [SAR 1:1 DAR 2:1], q=2-31, 8000 kb/s, 23.98 fps, 90k tbn (default)
Metadata:
BPS : 4138498
DURATION : 00:55:55.728000000
NUMBER_OF_FRAMES: 80457
NUMBER_OF_BYTES : 1735959328
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
encoder : Lavc58.134.100 h264_vaapi
Stream #0:1(eng): Audio: mp3, 48000 Hz, stereo, fltp, 128 kb/s
Metadata:
BPS : 640000
DURATION : 00:55:55.744000000
NUMBER_OF_FRAMES: 104867
NUMBER_OF_BYTES : 268459520
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
encoder : Lavc58.134.100 libmp3lame
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00001.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00002.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00003.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00004.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00005.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00006.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00007.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00008.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00009.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00010.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00011.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00012.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00013.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00014.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00015.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00016.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00017.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00018.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00019.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00020.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00021.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00022.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00023.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00024.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00025.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00026.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00027.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00028.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00029.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00030.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00031.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00032.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00033.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00034.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00035.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00036.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00037.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00038.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00039.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00040.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00041.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00042.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00043.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00044.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00045.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00046.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00047.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00048.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00049.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00050.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00051.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00052.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00053.ts' for writing
root@I-NO2:/tmp# 17 q=-0.0 size=N/A time=00:04:27.33 bitrate=N/A speed=0.689x

tail -100 ffmpeg-6666.stderr
DURATION : 00:55:55.744000000
NUMBER_OF_FRAMES: 104867
NUMBER_OF_BYTES : 268459520
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Subtitle: subrip
Metadata:
BPS : 42
DURATION : 00:55:38.802000000
NUMBER_OF_FRAMES: 646
NUMBER_OF_BYTES : 17603
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:3(eng): Subtitle: subrip
Metadata:
title : SDH
BPS : 51
DURATION : 00:55:38.802000000
NUMBER_OF_FRAMES: 794
NUMBER_OF_BYTES : 21472
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
Stream #0:1 -> #0:1 (eac3 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[hevc @ 0x1a97400] No support for codec hevc profile 2.
[hevc @ 0x1a97400] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
Incompatible pixel format 'yuv420p' for codec 'h264_vaapi', auto-selecting format 'vaapi_vld'
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00000.ts' for writing
Output #0, stream_segment,ssegment, to '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-%05d.ts':
Metadata:
encoder : Lavf58.76.100
Stream #0:0: Video: h264 (High), vaapi_vld(tv, bt709, progressive), 1920x960 [SAR 1:1 DAR 2:1], q=2-31, 8000 kb/s, 23.98 fps, 90k tbn (default)
Metadata:
BPS : 4138498
DURATION : 00:55:55.728000000
NUMBER_OF_FRAMES: 80457
NUMBER_OF_BYTES : 1735959328
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
encoder : Lavc58.134.100 h264_vaapi
Stream #0:1(eng): Audio: mp3, 48000 Hz, stereo, fltp, 128 kb/s
Metadata:
BPS : 640000
DURATION : 00:55:55.744000000
NUMBER_OF_FRAMES: 104867
NUMBER_OF_BYTES : 268459520
_STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2021-06-06 22:41:22
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
encoder : Lavc58.134.100 libmp3lame
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00001.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00002.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00003.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00004.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00005.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00006.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00007.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00008.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00009.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00010.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00011.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00012.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00013.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00014.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00015.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00016.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00017.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00018.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00019.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00020.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00021.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00022.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00023.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00024.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00025.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00026.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00027.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00028.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00029.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00030.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00031.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00032.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00033.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00034.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00035.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00036.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00037.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00038.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00039.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00040.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00041.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00042.ts' for writing
[stream_segment,ssegment @ 0x1a4c8c0] Opening '/tmp/VideoStation/HLS/61899e48550b5d4288aa76c94a78a15e_zrpwhB0Z/slice-00043.ts' for writing

I hope it helps

@AlexPresso
Copy link
Owner

Yes, it does help, thanks a lot.

ffmpeg33 starting and having 0% usage is a normal behavior, because of the patch, ffmpeg33 is now a script running SynoCommunity ffmpeg, so it does appear as a running process but the one consuming CPU is the sub-process (ffmpeg).

could you give me the output of the following command please: /var/packages/ffmpeg/target/bin/vainfo

@Joeri87
Copy link
Author

Joeri87 commented Jun 8, 2022

Sure:

/var/packages/ffmpeg/target/bin/vainfo
libva info: VA-API version 1.14.0
libva info: Trying to open /var/packages/ffmpeg/target/lib/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /var/packages/ffmpeg/target/lib/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.14.0)
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 2.4.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD

@AlexPresso
Copy link
Owner

AlexPresso commented Jun 8, 2022

It seems like iHD is not loaded, there's a way to enable it but I don't know if iHD is supported on your achitecture, @th0ma7 do you have an idea how we could check that ?

@th0ma7
Copy link

th0ma7 commented Jun 8, 2022

It seems like iHD is not loaded, there's a way to enable it but I don't know if iHD is supported on your achitecture, @th0ma7 do you have an idea how we could check that ?

It's actually quite easy, just rename /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED to /var/packages/ffmpeg/target/lib/iHD_drv_video.so and it will superseed i965 by default.

$ sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED /var/packages/ffmpeg/target/lib/iHD_drv_video.so

Also note that if it does work well with your CPU arch let it me know so I can enable it by default in the next ffmpeg release. Currently its only enabled on apollolake 918+ and geminilake DS920+. Your CPU arch can be found with a uname -a command.

@Joeri87
Copy link
Author

Joeri87 commented Jun 9, 2022

Dear @th0ma7 and @AlexPresso . I did the command sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED /var/packages/ffmpeg/target/lib/iHD_drv_video.so
Now it stopped working completely. Im going to do a reboot and give the output as well

We did talk about it before. It would be a pitty if HVEC is in hardware unsupported. I'ts strange since it only gives issues with this one file that has the audio codec. All other HVEC without this audio codec work just perfect...
#15 (comment)

/var/packages/ffmpeg/target/bin/vainfo
libva info: VA-API version 1.14.0
libva info: Trying to open /var/packages/ffmpeg/target/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva error: /var/packages/ffmpeg/target/lib/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /var/packages/ffmpeg/target/lib/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.14.0)
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 2.4.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD

And after a reboot, same, it keeps the circle spinning...

@AlexPresso
Copy link
Owner

AlexPresso commented Jun 9, 2022

A reboot won't fix it, you need to redo the mv command but invert the two parameters to disable iHD. Then it will use back the last driver (i965)

  • sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED

Unfortunately I can't do more about your issue, the new wrapper now directly uses the parameters generated by VideoStation and passes it to ffmpeg. There's no args edition at all.

@EngMarc
Copy link

EngMarc commented Jun 9, 2022

@AlexPresso @th0ma7
Any updates on the eac3 to play on Videostation?
The last Synology update does play the HVEC files fine but won't play eac3.

@AlexPresso
Copy link
Owner

AlexPresso commented Jun 9, 2022

Check the repo readme please

@EngMarc
Copy link

EngMarc commented Jun 9, 2022

where?

@AlexPresso
Copy link
Owner

AlexPresso commented Jun 9, 2022

On the project home page, also, please do not create a side discussion in this issue, create a new one if you have any question or any problem

Repository owner deleted a comment from EngMarc Jun 9, 2022
@Joeri87
Copy link
Author

Joeri87 commented Jun 9, 2022

A reboot won't fix it, you need to redo the mv command but invert the two parameters to disable iHD. Then it will use back the last driver (i965)

  • sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED

Unfortunately I can't do more about your issue, the new wrapper now directly uses the parameters generated by VideoStation and passes it to ffmpeg. There's no args edition at all.

So I did your command. Now it works like it did before, with 40% cpu load and shorter stutters, like every 4 seconds 0,5 seconds pause. Something is up with the hardware decoder happening in software if I understand correct instead of in hardware, Not sure if it is in drivers or in the chip design. Other HVEC files works fine so far but as soons as it is this file it breaks. Although its not smooth, its a huge improvement from before! Im going to try other files later as well.

/var/packages/ffmpeg/target/bin/vainfo
libva info: VA-API version 1.14.0
libva info: Trying to open /var/packages/ffmpeg/target/lib/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /var/packages/ffmpeg/target/lib/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.14.0)
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 2.4.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD

Is it now using the old driver (i965)? What if I want to revert back to the new driver? I'm sorry. But im very bad with command line...

Thanks for trying so much and fixing the script! At least a lot works and you helped a lot of people!!!!

Update: Other less heavy files work fine and playback smooth! They are still decoded in software I guess with 40% cpu.

@AlexPresso
Copy link
Owner

If you mean the default driver, i965 is the default one, you already loaded it

@AlexPresso
Copy link
Owner

I'm sorry but I can't do anything about your issue, the patch seems not to be the issue

@Joeri87
Copy link
Author

Joeri87 commented Jun 9, 2022

If you mean the default driver, i965 is the default one, you already loaded it

But how to undo the:
sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED

Is it? sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED /var/packages/ffmpeg/target/lib/iHD_drv_video.so

@Joeri87
Copy link
Author

Joeri87 commented Jun 9, 2022

I'm sorry but I can't do anything about your issue, the patch seems not to be the issue

That I understand. I'm very gratefull you are the one (not forget T0ma7 and others for indredible work to keep Synology stuff working) that was able to make it happen, make it work and use 1 single command to make it all possible for people like me!!! Do you have a donate page?

@Joeri87
Copy link
Author

Joeri87 commented Jun 9, 2022

If you mean the default driver, i965 is the default one, you already loaded it

But how to undo the: sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED

Is it? sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED /var/packages/ffmpeg/target/lib/iHD_drv_video.so

Okay, so using the iHD driver makes it fail... So with the DS916+ the i965 driver is absolutely needed and depending on the file, the software decoding might be to heavy but it will work. I will do more tests.

@Joeri87
Copy link
Author

Joeri87 commented Jun 9, 2022

If you mean the default driver, i965 is the default one, you already loaded it

But how to undo the: sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED
Is it? sudo mv /var/packages/ffmpeg/target/lib/iHD_drv_video.so-DISABLED /var/packages/ffmpeg/target/lib/iHD_drv_video.so

Okay, so using the iHD driver makes it fail... So with the DS916+ the i965 driver is absolutely needed and depending on the file, the software decoding might be to heavy but it will work. I will do more tests.

Update: Yes, disabling the iHD driver is important and the i965 driver will work fine with all my tested files. Thanks!
Maybe to update the script to auto disable the iHD driver on the DS916+ and other brasswell models. Other then that I guess this issue is closed. Thanks!

@th0ma7
Copy link

th0ma7 commented Jun 9, 2022

Maybe to update the script to auto disable the iHD driver on the DS916+ and other brasswell models. Other then that I guess this issue is closed. Thanks!

@Joeri87 disabling of iHD driver (e.g. newer Intel driver) is already done by latest ffmpeg at installation for all platforms except the latest ones (e.g. apollolake & geminilake)

@xavave
Copy link

xavave commented Aug 4, 2022

Hi Alex,
Thanks for your great work!
I've just installed the latest script with standard command.My device is a DS718+, DSM 7.1-42661 Update 3)
Here are some issue logs with a file (matroska,webm, hevc, eac3, 3602.0 Kbps)
https://gist.github.com/xavave/e32e1050391cdc517ead974838d0d5d1
https://gist.github.com/xavave/9b0699535fcd4240d7ed181e1e33511c

the movie (on chrome Version 103.0.5060.134 64 bits) starts full screen with no button display, it plays music 3 seconds with a black screen, and then stops
Thank you

@AlexPresso
Copy link
Owner

Hi Xavier,

Could you give me your VideoStation's version please ? are you also using Advanced Media Extensions ? I also need to get the output of the following command: ls -al /var/packages/CodecPack/target/pack/bin

Thank you

@xavave
Copy link

xavave commented Aug 4, 2022

Hi Alex, yes sure :
I'm using
video station 3.0.3-2084 and advanced media extensions 1.0.0.50001

here is the command result:
ls -al /var/packages/CodecPack/target/pack/bin

-rwxr-xr-x 1 root root 254912 Mar 3 07:48 ffmpeg33-for-audio
-rwxr-xr-x 1 root root 254904 Mar 3 07:48 ffmpeg33-for-surveillance
lrwxrwxrwx 1 root root 44 Aug 4 19:05 ffmpeg41 -> /var/packages/VideoStation/target/bin/ffmpeg
-rwxr-xr-x 1 root root 263016 Mar 3 07:48 ffmpeg41-for-synoface
-rwxr-xr-x 1 root root 263016 Mar 3 07:48 ffmpeg41.orig
-rwxr-xr-x 1 root root 14736 Mar 3 07:48 vainfo

thanks :)

@AlexPresso
Copy link
Owner

Sorry for the late reply, I had lot of things to do these days.

The good news is that Advanced Media Extensions (CodecPack) doesn't use GStreamer, so the problem isn't GStreamer.
According to the args generated by VideoStation (and directly passed to ffmpeg), your NAS is using hardware transcoding (which is great :) ).

If I'm right, the logs you provided here aren't containing the full log lines (there's only the slices directory, not the HLS slice full name). Could you provide me the full logs please ? :)

The problem may also be that: Incompatible pixel format 'yuv420p' for codec 'h264_vaapi', auto-selecting format 'vaapi_vld' I need to try reproduce the issue when I have time.

Is the problem only occurring with this video or also with other videos ?

@xavave
Copy link

xavave commented Aug 12, 2022

Sorry for the late reply, I had lot of things to do these days.

The good news is that Advanced Media Extensions (CodecPack) doesn't use GStreamer, so the problem isn't GStreamer. According to the args generated by VideoStation (and directly passed to ffmpeg), your NAS is using hardware transcoding (which is great :) ).

If I'm right, the logs you provided here aren't containing the full log lines (there's only the slices directory, not the HLS slice full name). Could you provide me the full logs please ? :)

The problem may also be that: Incompatible pixel format 'yuv420p' for codec 'h264_vaapi', auto-selecting format 'vaapi_vld' I need to try reproduce the issue when I have time.

Is the problem only occurring with this video or also with other videos ?

Hi Alex, I did not notice other problems with other videos
here are the full logs
https://gist.github.com/xavave/47b711bdafed0e2ad281e5ea3e3fc515
https://gist.github.com/xavave/b7b5df124c0a605b330c4a0ad200acd8
https://gist.github.com/xavave/6ceda9d4b6811dcc6fbf6489ec8b9141
Thanks

@AlexPresso
Copy link
Owner

It's strange, everything seems to work fine on ffmpeg side, could the video be the problem ?

@xavave
Copy link

xavave commented Aug 17, 2022

It's strange, everything seems to work fine on ffmpeg side, could the video be the problem ?

yes, maybe. do you have an email so I can send you the video link in pm please?

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

No branches or pull requests

5 participants