nova-video-player / aos-AVP

NOVA opeN sOurce Video plAyer: main repository to build them all
Apache License 2.0
3.41k stars 200 forks source link

[Bug]: Next episode in Map mode plays at higher speed #1232

Open Quaap70 opened 3 months ago

Quaap70 commented 3 months ago

Problem description

My Nova Video Player is set to play all episodes in the same folder automatically. But since a few days Nova automatically plays the next episode, but without sound and at a higher speed. When I then stop playback and start playback again, the episode plays at the correct speed again, but the same problem occurs again with the next episode. I also tested Bingewatch mode, which gives the same problem.

It turns out that Nova does not do this with all folders, and it cannot be assigned to a specific file format or video encoding. So the question is whether this problem has arisen recently, or whether it occurs in very specific cases. Strangely enough, it happened to me on all multi-season episodes of a specific series, with each season in a separate folder.

Steps to reproduce the issue

Folder mode selected for playback

Expected behavior

No response

Your phone/tablet/androidTV model

Google 4K Chromecast

Operating system version

Android 12 Kernel 4.9.269

Application version and app store

v6.2.86-20240622.2037

Additional system information

No response

Debug logs

No response

Pentaphon commented 3 months ago

But since a few days Nova automatically plays the next episode, but without sound and at a higher speed.

@courville I get the exact same thing.

courville commented 3 months ago

@Pentaphon this is also with the same device?

Pentaphon commented 3 months ago

this is also with the same device?

@courville I get this on both the Fire TV Stick 4K 1st-Gen and the Onn 4K 2021 (which is an Amlogic device)

When it happens, the video plays like a "fast slideshow" and I have to go to another video or force close Nova.

courville commented 3 months ago

It means that somehow nova looses audio codec and then there is no limit for the playback speed. I will try to reproduce.

Quaap70 commented 3 months ago

It means that somehow nova looses audio codec and then there is no limit for the playback speed. I will try to reproduce.

Can I help you with a link (by email) to the episodes where things went wrong for me?

Pentaphon commented 3 months ago

It means that somehow nova looses audio codec and then there is no limit for the playback speed. I will try to reproduce.

@courville Here's the mediainfo for the files I've seen do this. They play fine 99% of the time but every week or so I get a complaint from the younger people in my home that the video is "playing weird" when moving to the next episode.

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L3@Main
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 24 min 28 s
Bit rate                                 : 801 kb/s
Width                                    : 720 pixels
Height                                   : 540 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.086
Stream size                              : 140 MiB (86%)
Writing library                          : x265 3.3+4-rarbg-30eb4de83092:[Linux][GCC 8.3.1][64 bit] 10bit
Encoding settings                        : cpuid=1111039 / frame-threads=4 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=720x540 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=4 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=25 / lookahead-slices=0 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=3 / limit-refs=3 / limit-modes / me=3 / subme=3 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / no-sao / no-sao-non-deblock / rd=4 / selective-sao=0 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=1.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=abr / bitrate=800 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=2 / cplxblur=20.0 / qblur=0.5 / ipratio=1.40 / pbratio=1.30 / aq-mode=3 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.01 / no-opt-cu-delta-qp / no-aq-motion / no-hdr10 / no-hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / no-scenecut-aware-qpconformance-window-offsets / right=0 / bottom=0
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : A_AAC-2
Duration                                 : 24 min 29 s
Bit rate                                 : 128 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -43 ms
Stream size                              : 22.4 MiB (14%)
Language                                 : English
Default                                  : Yes
Forced                                   : No
courville commented 3 months ago

It means that somehow nova looses audio codec and then there is no limit for the playback speed. I will try to reproduce.

Can I help you with a link (by email) to the episodes where things went wrong for me?

if you could provide a link to the files this would help indeed to reproduce if this is deterministic.

Quaap70 commented 3 months ago

link has been sent

courville commented 3 months ago

@Quaap70, @Pentaphon, I can reproduce.

EDIT: on nvidia shield but not on the Android emulator

eng3 commented 2 months ago

I posted a similar bug that got closed as duplicate.

It's a little different. It always plays fine when I start from the beginning. It only has the higher speed issue after I hold down fast forward. Especially, if I'm going forward like an hour. This also happens if I'm at the end and rewind alot.

Note that pressing pause and play again does not resolve the issue. I must completely stop (exit play back) and play again.

Pentaphon commented 2 months ago

@eng3 that sounds similar enough that it is probably the same issue, When the dev posts a fix for this issue and you're still seeing the same behavior, just @ the dev in your closed issue, ask him to re-open it and I'm sure he will reopen it and investigate for you.

Note that pressing pause and play again does not resolve the issue. I must completely stop (exit play back) and play again.

I have to do the same thing to make it work again.

Quaap70 commented 2 months ago

@Quaap70, @Pentaphon, I can reproduce.

EDIT: on nvidia shield but not on the Android emulator

@courville Strange that you can't reproduce it for Android, but you can for the nvidia shield. But if you can fix it for the nvidia shield, because you can reproduce and test that, wouldn't it be solved for Android as well? Or is this perhaps too simplistic of me? :wink: Do you expect different causes for the problem on both platforms?

Coincidentally, I ran into this bug again this week with all episodes of a season of a different serie. The series where I first reported this bug, all seasons were not from the same provider and therefore possibly not generated in the same way. In my case, it all concerns mkv files.

courville commented 2 months ago

I can reproduce but not on Android studio emulator. I will fix it when I get time.

Quaap70 commented 2 months ago

I can reproduce but not on Android studio emulator. I will fix it when I get time.

No rush, just an update. I can work with it just fine like this. :blush:

eng3 commented 2 months ago

The android emulator is an emulator, not the real thing so behavior isnt always the same.

I checked and all the videos I play on Nova happen to me mkv as well, not sure if it is just a coincidence.

The other day I did have one time where exiting out of the video and going back in did not solve the issue, I had to close the app and go back in. But usually it works when I just exit the video and go back. It happens when I fast forward or rewind alot (since there is no chapter support). If I just "skip" alot (fast forward in short bursts) it seems ok. Was this reproduced too?

Pentaphon commented 1 month ago

The other day I did have one time where exiting out of the video and going back in did not solve the issue, I had to close the app and go back in.

This is sometimes the case for me as well. Maybe its a bug with ffmpeg and it has to be updated to 7.0.2 but it could be something else.

I'm using SMBJ. Is everybody else using that too?

courville commented 1 month ago

The other day I did have one time where exiting out of the video and going back in did not solve the issue, I had to close the app and go back in.

This is sometimes the case for me as well. Maybe its a bug with ffmpeg and it has to be updated to 7.0.2 but it could be something else.

I'm using SMBJ. Is everybody else using that too?

I do not think it is related to smbj. Perhaps it is linked to ffmpeg (we still use 6.1.1 and migration to 7.x is tricky and will take longer due to deprecations). In order to narrow it down, I propose to share a build with old 4.4.x version (4.4.5 has been released not long ago).

courville commented 1 month ago

Please test this build that uses ffmpeg 4.4.5 to check that the issue does not come from the ffmpeg 5/6 upstep. I am away from home with limited testing capabilities (no nvidia shield with only a phone and local storage...). @eng3, I am interesting with your seeking feedback and @Quaap70 and @Pentaphon your feedback on the binge watching fast playing issue.

courville commented 1 month ago

I quickly checked with ffmpeg 4.4.5 when in transit through home and on the nvidia shield and I cannot reproduce the problem anymore. However I did a quick test with the updated ffmpeg 6.1.2 and it was fine too. Thus I guess I need to get feedback before drawing final conclusions.

Pentaphon commented 1 month ago

Please test this build that uses ffmpeg 4.4.5 to check that the issue does not come from the ffmpeg 5/6 upstep.

@courville Ok I tried the build all night and I did not experience the issue with this build. Although I'd like to see Nova always come with a newer ffmpeg so I'd be willing to test 6.1.2 as well if 7.0.2 is not possible at the moment.

courville commented 1 month ago

@Pentaphon, thanks for the feedback. I will also provide a 6.1.2 soon for your testing since perhaps this is an issue that got corrected in the 6.1.1->6.1.2 update (it was not obvious in my commits review). A lot of deprecation was made in ffmpeg migrating from ffmpeg 4.4 to 5.x, 6.x and even more to 7.x versions. We will adapt avos C multimedia engine of nova to cope with this of course (this is not a trivial task at least to me without creating regressions). We will get to 7.x.

courville commented 1 month ago

Here is nova based on ffmpeg 6.1.2 (instead of 6.1.1) https://drive.google.com/file/d/1aTSFK5OF6Fjc_4FMgkAB-sQ-uVD_JePl/view?usp=sharing for testing. Thanks for your help in debugging the issue.

Quaap70 commented 1 month ago

Here is nova based on ffmpeg 6.1.2 (instead of 6.1.1) https://drive.google.com/file/d/1aTSFK5OF6Fjc_4FMgkAB-sQ-uVD_JePl/view?usp=sharing for testing. Thanks for your help in debugging the issue.

@courville Sorry for the late reply. I was away from home on vacation and therefore not able to test.

I tested version 2604330-6.2.91-20240816.1234, but I still experience the bingewatch error in this version. I also have the idea that the image is now not only running at a higher speed, but also that the image is jerky.

Unfortunately I cannot install version 2603924-6.2.91-20240811.2144, I get the message that this package is invalid.

Pentaphon commented 1 month ago

Unfortunately I cannot install version 2603924-6.2.91-20240811.2144, I get the message that this package is invalid.

@Quaap70 I believe you have to uninstall the previous Nova before you can install that one.

@courville Alas, it seems that 6.1.2 also has the issue when I just sped through about 20 or so episodes on my FireTV 4K 1st Gen to see if a next episode would play like a "silent, fast slideshow" and it did. I can only guess that something was introduced in v5-v6 to cause this issue. You said you were able to reproduce this on your Shield. Did you get enough info to report it to the ffmpeg devs?

It seems that ffmpeg 4.4.5 is the best version so far for me. Waiting to see if @Quaap70 @eng3 can confirm if it also solved their issues.

We will get to 7.x.

Speaking of which, do you think moving to Exoplayer/media3 by default and using ffmpeg as an optional fallback will ever be a possibility?

eng3 commented 1 month ago

Sorry I'm currently out of town for the next week so I can't test

courville commented 1 month ago

OK thus let's revert to ffmpeg 4.4.5 for now for a release and continue to debug.

courville commented 1 month ago

ffmpeg 4.4.5 version is available here https://drive.google.com/file/d/1FOfsbM5s7YKCy4G_wsJ7gCieVINlUxvR/view?usp=sharing (that you will allow you to upgrade).

Quaap70 commented 1 month ago

ffmpeg 4.4.5 version is available here https://drive.google.com/file/d/1FOfsbM5s7YKCy4G_wsJ7gCieVINlUxvR/view?usp=sharing (that you will allow you to upgrade).

@courville I tested the above version with multiple series that give bingewatch problems in the current release version of Nova. This problem seems to be completely solved in the above version (2604355-6.2.91-20240816.1927).

Thanks for setting up a build that did allow upgrading without having to delete the current one. That would have cost me a lot of time to get the media database back in order. :blush:

courville commented 1 month ago

OK I reproduce on ffmpeg6.1 systematically with the files provided (H264, AAC Stereo 48kHz). It fails in codec_ffmpeg_audio new implementation complaining about: ffmpeg_audio_codec_decode_raw: Failed sending packet for decodingFFMPEG_AUDIO_DEC ERROR!.

eng3 commented 1 month ago

ffmpeg 4.4.5 version is available here https://drive.google.com/file/d/1FOfsbM5s7YKCy4G_wsJ7gCieVINlUxvR/view?usp=sharing (that you will allow you to upgrade).

So I tried installing this, but after the "install" it says "App not installed"

Pentaphon commented 1 month ago

So I tried installing this, but after the "install" it says "App not installed"

Try using the latest release which already rolled back ffmpeg. https://github.com/nova-video-player/aos-AVP/releases

eng3 commented 1 month ago

AH, that's the reason it wouldnt install, it already auto-updated from the play store.

courville commented 1 month ago

OK I think I fixed it on ffmpeg 6.1. I have also adapted avos code to cope with deprecations in 7.0.2 and I have an experimental build to test.

Pentaphon commented 1 month ago

OK I think I fixed it on ffmpeg 6.1. I have also adapted avos code to cope with deprecations in 7.0.2 and I have an experimental build to test.

Looking forward to it. Did you also submit a fix upstream on the ffmpeg project?

courville commented 1 month ago

@Pentaphon, there was no ffmpeg fix required: ffmpeg deprecations were to be handled at nova avos part level. Regarding the next episode playing fast, it was also an issue in avos not flushing buffers when dealing with AAC audio encoding for some reasons. The impact was noticeable with more recent than 4.4 ffmpeg versions.

Pentaphon commented 1 month ago

Regarding the next episode playing fast, it was also an issue in avos not flushing buffers when dealing with AAC audio encoding for some reasons. The impact was noticeable with more recent than 4.4 ffmpeg versions.

I see. Question: do you see any future where Nova can be simplified to no longer need AVOS so you no longer have to maintain AVOS and instead use something else to handle playback for you so you can focus on the media center and player UI aspects of Nova instead of having to fix playback issues? I don't mean any offense by this of course and I love your project but sometimes I think Nova is being held back by older code from the Archos project that would be better off being replaced entirely. This may just be wishful thinking on my part but please let me know if you've ever had the same thoughts in regards to the Nova's future. I only ask this here because this repo doesn't have a discussions section.