AlexPresso / VideoStation-FFMPEG-Patcher

Patcher to enable DTS, EAC3 and TrueHD transcoding support to Synology VideoStation (from DSM 6.2 to DSM 7.0 and above ; ffmpeg4, 5, 6 ready)
1.01k stars 99 forks source link

[BUG] Endless play #14

Closed GMib closed 2 years ago

GMib commented 2 years ago

System details

Describe the bug Can't play file with eac3 audio, playing icon endless turn, other file work. i tried uninstall and reinstall videostation, then re applying the patch without success.

FFMPEG logs

2021-10-12 14:42:53 - FFM15503 - *** PROCESS START REV AME_12.2 DS418play (apollolake) PID 15503 ***
2021-10-12 14:42:53 - FFM15503 - MOVIE    = /volume1/Share/Séries/9-1-1/Saison 4/9-1-1 - 4x07 - Nos chers voisins.mkv
2021-10-12 14:42:53 - FFM15503 - VCODEC   = hevc (Main 10)
2021-10-12 14:42:53 - FFM15503 - ACODEC   = eac3
2021-10-12 14:42:53 - FFM15503 - PARAMVS  =
2021-10-12 14:42:53 - FFM15503 -          = -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/Share/
2021-10-12 14:42:53 - FFM15503 -          = Séries/9-1-1/Saison 4/9-1-1 - 4x07 - Nos chers voisins.mkv -vcodec h264_vaapi -vf format=nv12|vaapi,hwupload,scale_vaap
2021-10-12 14:42:53 - FFM15503 -          = i=w=1920:h=1072:format=nv12 -vsync 2 -bf 0 -vb 5275218 -acodec libmp3lame -ab 128K -ac 2 -f ssegment -pix_fmt yuv420p -s
2021-10-12 14:42:53 - FFM15503 -          = egment_format mpegts -segment_list_type m3u8 -hls_seek_time 0 -segment_time 5 -segment_time_delta 0.000 -segment_start_n
2021-10-12 14:42:53 - FFM15503 -          = umber 00000 -avoid_negative_ts 0 -break_non_keyframes 1 -max_muxing_queue_size 1024 -map 0:0 -map 0:1 /tmp/VideoStation/
2021-10-12 14:42:53 - FFM15503 -          = HLS/674429cdf968961660fafd17cfe28aaf_BXW097OJ/slice-%05d.ts
2021-10-12 14:42:53 - FFM15503 - MODE     = ORIG
2021-10-12 14:42:53 - FFM15503 - FFMPEG   = /var/packages/CodecPack/target/bin/ffmpeg41.orig
2021-10-12 14:42:53 - FFM15503 - PARAMWP  =
2021-10-12 14:42:53 - FFM15503 -          = -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/Share/
2021-10-12 14:42:53 - FFM15503 -          = Séries/9-1-1/Saison 4/9-1-1 - 4x07 - Nos chers voisins.mkv -vcodec h264_vaapi -vf scale_vaapi=format=nv12,hwupload,sets
2021-10-12 14:42:53 - FFM15503 -          = ar=sar=1 -vsync 2 -bf 0 -vb 5275218 -acodec libmp3lame -ab 128K -ac 2 -f ssegment -pix_fmt yuv420p -segment_format mpegt
2021-10-12 14:42:53 - FFM15503 -          = s -segment_list_type m3u8 -hls_seek_time 0 -segment_time 5 -segment_time_delta 0.000 -segment_start_number 00000 -avoid_
2021-10-12 14:42:53 - FFM15503 -          = negative_ts 0 -break_non_keyframes 1 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/674429cdf968961660fafd17cfe28aaf_BXW097OJ/s
2021-10-12 14:42:53 - FFM15503 -          = lice-%05d.ts
2021-10-12 14:42:53 - FFM15503 - CHILDPID = 15568
2021-10-12 14:42:53 - FFM15568 - *** PROCESS START REV 12 DS418play (apollolake) PID 15568 ***
2021-10-12 14:42:53 - FFM15568 - DEVICE   =
2021-10-12 14:42:53 - FFM15568 - MOVIE    = /volume1/Share/Séries/9-1-1/Saison 4/9-1-1 - 4x07 - Nos chers voisins.mkv
2021-10-12 14:42:53 - FFM15568 - VCODEC   = hevc (Main 10)
2021-10-12 14:42:53 - FFM15568 - ACODEC   = eac3
2021-10-12 14:42:53 - FFM15568 - PARAMVS  =
2021-10-12 14:42:53 - FFM15568 -          = -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/Share/
2021-10-12 14:42:53 - FFM15568 -          = Séries/9-1-1/Saison 4/9-1-1 - 4x07 - Nos chers voisins.mkv -vcodec h264_vaapi -vf scale_vaapi=format=nv12,hwupload,sets
2021-10-12 14:42:53 - FFM15568 -          = ar=sar=1 -vsync 2 -bf 0 -vb 5275218 -acodec libmp3lame -ab 128K -ac 2 -f ssegment -pix_fmt yuv420p -segment_format mpegt
2021-10-12 14:42:53 - FFM15568 -          = s -segment_list_type m3u8 -hls_seek_time 0 -segment_time 5 -segment_time_delta 0.000 -segment_start_number 00000 -avoid_
2021-10-12 14:42:53 - FFM15568 -          = negative_ts 0 -break_non_keyframes 1 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/674429cdf968961660fafd17cfe28aaf_BXW097OJ/s
2021-10-12 14:42:53 - FFM15568 -          = lice-%05d.ts
2021-10-12 14:42:53 - FFM15568 - MODE     = WRAP
2021-10-12 14:42:53 - FFM15568 - FFMPEG   = /var/packages/ffmpeg/target/bin/ffmpeg
2021-10-12 14:42:53 - FFM15568 - PARAMWP  =
2021-10-12 14:42:53 - FFM15568 -          = -ss 0.000 -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i /volume1/Share/
2021-10-12 14:42:53 - FFM15568 -          = Séries/9-1-1/Saison 4/9-1-1 - 4x07 - Nos chers voisins.mkv -vcodec h264_vaapi -vf scale_vaapi=w=scale_vaapi=format=nv12
2021-10-12 14:42:53 - FFM15568 -          = ,hwupload,setsar=sar=1:h=scale_vaapi=format=nv12,hwupload,setsar=sar=1:format=nv12,hwupload,setsar=sar=1 -vsync 2 -bf 0
2021-10-12 14:42:53 - FFM15568 -          = -vb 5275218 -acodec libmp3lame -ab 128K -ac 2 -f ssegment -pix_fmt yuv420p -segment_format mpegts -segment_list_type m3u
2021-10-12 14:42:53 - FFM15568 -          = 8 -hls_seek_time 0 -segment_time 5 -segment_time_delta 0.000 -segment_start_number 00000 -avoid_negative_ts 0 -break_non
2021-10-12 14:42:53 - FFM15568 -          = _keyframes 1 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/674429cdf968961660fafd17cfe28aaf_BXW097OJ/slice-%05d.ts
2021-10-12 14:42:53 - FFM15568 - CHILDPID = 15625
2021-10-12 14:42:54 - FFM15568 - *** CHILD END ***
2021-10-12 14:42:54 - FFM15568 - STDOUT   =
2021-10-12 14:42:54 - FFM15568 -          =       _STATISTICS_WRITING_DATE_UTC: 2021-06-29 18:57:45
2021-10-12 14:42:54 - FFM15568 -          =       _STATISTICS_WRITING_DATE_UTC-eng: 2021-06-29 18:57:45
2021-10-12 14:42:54 - FFM15568 -          =       _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
2021-10-12 14:42:54 - FFM15568 -          =       _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
2021-10-12 14:42:54 - FFM15568 -          =       DURATION        : 00:44:07.965000000
2021-10-12 14:42:54 - FFM15568 -          = Stream mapping:
2021-10-12 14:42:54 - FFM15568 -          =   Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
2021-10-12 14:42:54 - FFM15568 -          =   Stream #0:1 -> #0:1 (eac3 (native) -> mp3 (libmp3lame))
2021-10-12 14:42:54 - FFM15568 -          = Press [q] to stop, [?] for help
2021-10-12 14:42:54 - FFM15568 -          = [Parsed_setsar_2 @ 0xffc280] Option 'h' not found
2021-10-12 14:42:54 - FFM15568 -          = [AVFilterGraph @ 0xfc3440] Error initializing filter 'setsar' with args 'sar=1:h=scale_vaapi=format=nv12'
2021-10-12 14:42:54 - FFM15568 -          = Error reinitializing filters!
2021-10-12 14:42:54 - FFM15568 -          = Failed to inject frame into filter network: Option not found
2021-10-12 14:42:54 - FFM15568 -          = Error while processing the decoded data for stream #0:0
2021-10-12 14:42:54 - FFM15568 -          = Conversion failed!
2021-10-12 14:42:54 - FFM15568 - MODE     = PIPE SV
2021-10-12 14:42:54 - FFM15568 - FFMPEG1  = /var/packages/ffmpeg/target/bin/ffmpeg
2021-10-12 14:42:54 - FFM15568 - FFMPEG2  = /var/packages/VideoStation/target/bin/ffmpeg.orig

Additional context

AlexPresso commented 2 years ago

Hey, Which SynoCommunity ffmpeg version are you using ?

GMib commented 2 years ago

hi, 4.3.2-38

AlexPresso commented 2 years ago

The issue is probably due to the fact you're not using the wrapper from my patcher.

You only uninstalled VideoStation and not VideoStation and Advanced Media Extensions. Then the old wrapper from another repository wasn't replaced in Advanced Media Extensions.

Please proceed in this order:

GMib commented 2 years ago

thx for help, now video work but not sound.

https://gist.github.com/GMib/d21de583061c23de9cce54505fe9a4ac#file-gistfile1-txt

AlexPresso commented 2 years ago

The gist you provided is the same log file than the one you already sent ;)

But there's a way to get aditional details on why it doesn't work. When a video is playing, the wrapper creates a temporary debug file storing infos from ffmpeg. To get its content, you can:

GMib commented 2 years ago

https://gist.github.com/GMib/b3111fd39cec6f4ee8959950b417d102#file-gistfile1-txt

AlexPresso commented 2 years ago

Perfect, thank you, so there's no error during stream transcoding. Could you please do the same with

GMib commented 2 years ago

the tail -200 of ffmpg.log (sorry i'm useless in bash :( https://gist.github.com/GMib/dcc266e6fb44fdb333fc91edea61615a#file-gistfile1-txt

the head : https://gist.github.com/GMib/de4b5956b7dc208ddda36dae032eaf07#file-gistfile1-txt

AlexPresso commented 2 years ago

No worries ;)

I'm sorry, I should have given you a higher count 😶, but the head part is incomplete, the video is having a lot of streams (video and audio sources) so it takes a lot of lines to print it all out. Could you increase the lines count to 300 or more if needed (head -300 ffmpeg-FFMxxxx.stderr) ?

GMib commented 2 years ago

https://gist.github.com/GMib/a2e8153a7ed25de2125aabe7a25b488b#file-gistfile1-txt

AlexPresso commented 2 years ago

Perfect ! Thank you.

As I can tell from the logs, everything is supposed to work as expected, FFMPEG is tuned to transcode from EAC3 to MP3 and there's no error when the stream segments are being processed.

I'm sorry to ask, but are you sure you haven't muted VideoStation / Chrome / your computer / speakers ? 😉

GMib commented 2 years ago

Yes i'm sure, video with aac work fine, video with ac3 or eac3 have no sound and playback cut often.

AlexPresso commented 2 years ago

Could you upload this specific file on a file host (media fire, wetransfer, ...) and post the link please

GMib commented 2 years ago

trying to upload, it's strange, some movie with ac3 have sound work some not

GMib commented 2 years ago

https://www.mediafire.com/file/om2pekymk9h7ucj/9-1-1_-_4x07_-_Nos_chers_voisins.mkv/file

AlexPresso commented 2 years ago

My NAS is playing it sucessfully, but the audio only starts to play near 00:00:17 and stops randomly. Since that problem occurs in VLC too, I'm pretty sure it's a file related issue, which probably happened when the uploader merged/muxed the video and audio streams.

Unfortunately, I won't be able to do a lot on that side, I'm also watching HEVC + EAC3 series and never had that issue so far.

GMib commented 2 years ago

There is no sound before 00:00:17 it's normal, ripper had removed this part because it was in english, for me it not stop randomly after, i've seen this with kodi without problem, and tested now with kmplayer. I can't play movies or tvshows with eac3, I've just see also a quality problem, picture is very pixelized. i never had issue before i update in dsm7 (don't remind what method i've used before update for playing eac3). I actually test Plex because videostation is too bad. thank you for taking the time to help me

AlexPresso commented 2 years ago

Yeah, VideoStation is really bad, if you have the opportunity to switch to another tool, Jellyfin is (in my opinion) a better free alternative to Plex. The quality "problem" is due to two things:

GMib commented 2 years ago

I discarded jellyfin because my nas is not docker compatible but i just see there is community package, i will test that, thx

GMenethil commented 5 months ago

it works on web video station, but on android the playing icon endless turn