theothernt / AerialViews

A screensaver for Android TV devices including Nvidia Shield, Fire TV, and Chromecast with Google TV. Inspired by Apple TV's video screensaver.
GNU General Public License v3.0
415 stars 32 forks source link

4K HDR videos not playing from SMB share #128

Closed EndorEwoksFC closed 1 month ago

EndorEwoksFC commented 6 months ago

What were you trying to do... Play local files from my SMB share.

And what actually happened (ie. describe the bug)... I connected successfully and upon clicking "Test connection settings" I get: Videos found: 17 Videos with unsupported file extensions: 0 Videos selected for playback: 17

When clicking Test Screensavers Settings I get either Loading indefinitely or a flicker of a video plays then just blackness. The videos I'm trying to play are 4K HDR and are confirmed they can play just fine through VLC on this same Nvidia Shield Pro. I also have no issue playing the Apple videos with Dolby Vision.

What kind of device do you have? (eg. Nvidia Shield, Sony TV, etc)... Nvidia Shield Pro 2019

theothernt commented 6 months ago

Just to rule out a playback issue, could you try playing the4K HDR videos with Just (Video) Player, which is free.

Both Aerial Views and Just (Video) Player use the same playback engine, ExoPlayer. VLC, although a great player, uses different methods for playback which means it'll play some formats that ExoPlayer won't.

EndorEwoksFC commented 6 months ago

I just played one of the videos on Just (Video) Player with no issue. On Dec 21, 2023, 8:35 AM -0500, Neil Turner @.***>, wrote:

Just to rule out a playback issue, could you try playing the4K HDR videos with Just (Video) Player, which is free. Both Aerial Views and Just (Video) Player use the same playback engine, ExoPlayer. VLC, although a great player, uses different methods for playback which means it'll play some formats that ExoPlayer won't. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

theothernt commented 6 months ago

I just played one of the videos on Just (Video) Player with no issue.

Thanks for testing that. There are a few more things to try...

  1. Can you copy a couple of the 4K HDR videos to the Shield, disable Samba and enable 'Local or USB Storage' only - then see if the videos play?
  2. If that doesn't work, can you enable Settings > Advanced > Use alternate MediaCodec parsing then try again (just with local videos, this option does nothing with SMB shares)
EndorEwoksFC commented 6 months ago

I moved the file to the local Shield storage and enabled 'Local or USB Storage Videos' and after setting it up and testing the settings I get: Videos found in folder: 1 Videos with unsupported file extensions: 1 Videos selected for playback: 0

I also tried changing the 'Use alternate media codec' but it didn't make a difference. The video file is an .mp4.

theothernt commented 6 months ago

I moved the file to the local Shield storage and enabled 'Local or USB Storage Videos' and after setting it up and testing the settings I get: Videos found in folder: 1 Videos with unsupported file extensions: 1 Videos selected for playback: 0

I also tried changing the 'Use alternate media codec' but it didn't make a difference. The video file is an .mp4.

On the local videos screen, if 'media scanner' is being used, you may have to restart your Shield for it to see the videos you copied over.

'Videos selected for playback' needs to be 1 or more.

EndorEwoksFC commented 6 months ago

Sorry I keep accidentally marking this as closed. Mobile site 😑

Anyways, I didn't realize I needed to use Media Scanner, I was using legacy because I didn't know I had to restart the Shield to get it to see my file. Even then, I just tested and this time the 'Test local search settings' does show 'Videos selected for playback: 1' but again, when actually hitting 'Test screensaver settings' it still shows loading for 2-3 seconds then flickers then nothing.

theothernt commented 6 months ago

Sorry I keep accidentally marking this as closed. Mobile site 😑

No worries!

Anyways, I didn't realize I needed to use Media Scanner, I was using legacy because I didn't know I had to restart the Shield to get it to see my file. Even then, I just tested and this time the 'Test local search settings' does show 'Videos selected for playback: 1' but again, when actually hitting 'Test screensaver settings' it still shows loading for 2-3 seconds then flickers then nothing.

Either should work (Media scanner or Folder access), I just thought Media Scanner would be easier.

Would it be possible to get a copy of one of these videos, by Dropbox or Onedrive for example - you could send the link to me privately if needed?

EndorEwoksFC commented 6 months ago

HERE is a link to the file on Google Drive

theothernt commented 6 months ago

Thanks for making the video available. I can only test on a Google TV (dongle) at the moment and the video works as-in.

I copied the file to the device, used the local video feature with a) Media Scanner and b) Folder access just to test everything.

I did notice that although the file is .mp4, internally the format of the video is vp9 - so you could try renaming the file extension to .webm?

EndorEwoksFC commented 6 months ago

Sorry for the late reply, busy holiday! I just got around to changing the file(s) extensions to .webm and still no dice.

theothernt commented 6 months ago

Sorry for the late reply, busy holiday! I just got around to changing the file(s) extensions to .webm and still no dice.

No worries, I took a break myself!

As the issue persists, would you be willing to install a debug version of the app if I made it available? It would be an APK you could install manually, it would not overwrite the Play Store version, just sit alongside it?

EndorEwoksFC commented 6 months ago

Yeah of course, send it on over

theothernt commented 6 months ago

Yeah of course, send it on over

Ok, (link removed) It's basically the same as 1.6.1 but it has a few library updates including ExoPlayer.

EndorEwoksFC commented 6 months ago

Still nothing when trying the same file both as a .webm or .mp4 file.

EndorEwoksFC commented 6 months ago

Here is what flashes on-screen for a few seconds and then disappears.

Available: 23.97, 24.00, 25.0, 2 29.97, 30.00, 50.0, 59.94, 60.00
Selected: 59.94 (-1.0 fps)
theothernt commented 6 months ago

Available: 23.97, 24.00, 25.0, 2 29.97, 30.00, 50.0, 59.94, 60.00 Selected: 59.94 (-1.0 fps)

Ah, so you have frame-rate match turned ON, can you disable that and try again?

EDIT: seeing "-1.0 fps" suggests a bug - that framerate should always be positive 😅

EndorEwoksFC commented 6 months ago

Disabled frame-match and it's back to just flashing one frame of the video then blackness.

theothernt commented 6 months ago

Ok, (link removed). There are no playback setting changes, but I did enable extra playback logging.

Are you familiar with ADB by chance? If not, I can provide on how to connect to the Shield with ADB to save the logs.

EndorEwoksFC commented 6 months ago

Ok let me give this one a shot a bit later. As for ADB, yes, I am familiar. What location will the logs be at?

theothernt commented 6 months ago

Once ADB is connected via PC or Mac command-line (ie. adb connect ip_address then adb shell), open Aerial Views then select the 'Test screensaver settings', after the video fails to play, type the following...

logcat | grep 'EventLogger' > aerialviews.txt

EndorEwoksFC commented 5 months ago

C:\Users\tcjoh\Documents\ADB Platform Tools>adb shell mdarcy:/ $ logcat | grep 'EventLogger' > aerialviews.txt /system/bin/sh: can't create aerialviews.txt: Read-only file system

This is what I got when I ran the command after the video failed to play on my Shield.

theothernt commented 5 months ago

Sorry about the delay, I've tested these commands on Windows...

adb connect ip_address adb logcat -d | findstr 'EventLogger' > aerialviews.txt

The text file, aerialviews.txt, should be created in the ADB Platform Tools folder

theothernt commented 5 months ago

Another Shield user has reported a playback issue with the mute feature. Although it could be unrelated, two basic features failing on the Shield (only?) is a problem. So I'm probably going to start looking at testing an earlier version of the app, maybe from a year ago, see if everything works, then go from there.

EndorEwoksFC commented 5 months ago

Sounds good, sorry I've been a bit busy to grab those logs for you. Hopefully I can get on that soon.

EndorEwoksFC commented 5 months ago

So I just ran the command and it created the log file but the .txt file is blank. I didn't see any settings in Aerial Views to enable logging (unless I missed it).

theothernt commented 5 months ago

I think you have may have to connect first using adb connect ip_address then load the debug version of Aerial Views, use the test feature to try and play a few videos (use the skip features a few times). Then use the 2nd command adb logcat -d | findstr 'EventLogger' > aerialviews.txt and it should work.

curtisbarnard commented 4 months ago

Bringing some discussion from here over to this issue as it seems more relevant.

Can you try downloading a couple of videos from the Aerial Videos website and see if they play from SMB?

I tried all five formats and none of them played. However I did get one of my videos to play. It is a 1080p 23.976fps video in H.264 and MP4 container. The bit rate is 10.46 Mbps.

It's interesting because one of the Apple videos is 1080p 29.97fps in H.264 MOV container and a bitrate of 10.26 Mbps so it seems like that should play.

Edit: Forgot to add this is on the 1.6.3 version not the beta for next release that I was testing.

theothernt commented 4 months ago

I tried all five formats and none of them played. However I did get one of my videos to play. It is a 1080p 23.976fps video in H.264 and MP4 container. The bit rate is 10.46 Mbps.

If any of the Apple videos are failing to play from SMB, that's a first. There have been problems with Dolby Vision in the past but that partly relates to the version of Dolby Vision the device or TV supports.

It's interesting because one of the Apple videos is 1080p 29.97fps in H.264 MOV container and a bitrate of 10.26 Mbps so it seems like that should play.

Honestly, if we ignore HDR/Dolby Vision for a minute - all of these videos should play as AVC and HEVC are well supported by even low-end chipsets.

Edit: Forgot to add this is on the 1.6.3 version not the beta for next release that I was testing.

The current beta has no changes around SMB + video playback.

I'm going to try and replicate the issue again with the devices I have - Sony Bravia 2015, Fire stick (2nd gen, low end) and a Google TV stick. If I can't, I will need to get the logs from someone as I don't know what the error is.

The app does have error logging but ExoPlayer (provided by Google) does not trigger an error when playback doesn't start. It's very frustrating.

curtisbarnard commented 4 months ago

Should I install the debug beta you have on the other issue and try to generate some logs per instructions above with ADB?

theothernt commented 4 months ago

I've compiled a new debug beta with playback logging enabled, so it should show a lot more detail in the logs (logcat).

curtisbarnard commented 4 months ago

Ok so interestingly one of my own 4k videos just worked, but the apple videos still didn't work. I'm attached the logs. aerialviews.txt

Also a note for the future the correct usage of findstr shouldn't have quotes. This is what worked to get the proper log: adb logcat -d | findstr EventLogger > aerialviews.txt

theothernt commented 4 months ago

Ok, here is an update to the app. It has changes to the a) read buffer size b) uses different file size info.

If this does nothing, then I can try an update to SMBJ - the Samba library I use.

And if that doesn't work, then we can look at the /etc/samba config files - maybe there's some option that SMBJ doesn't play well with.

curtisbarnard commented 4 months ago

That seems to have fixed it on my end. I was able to play all 5 apple video formats, my own MP4 videos in 4K, and images + videos together.

One bug did appear though on the apple videos: all five videos POI/location displayed as the Seals info even though I downloaded five different videos (the first 5 at the top of the page). The only modification is that I renamed the files (HDR_2K_HEVC, HDR_4K_HEVC, etc...) Maybe that messed things up?

The file names for my videos are appearing correctly.

Thanks for getting this fixed!

Edit: I attached the new logs: aerialviews.txt

theothernt commented 4 months ago

That's great to hear, I'll add that fix to the release - due tomorrow on GitHub, 5 days for the Play Store.

As for the filename issue, the titles + POIs are added based on filename so if the Apple or Community videos are renamed, it breaks.

Typically if people have the space, they download all the Apple + Community video they like, then turn off the remote sources.

theothernt commented 4 months ago

@EndorEwoksFC Version 1.7 has just been released. When you get a chance, could you check if that fixes your issue?

EndorEwoksFC commented 4 months ago

Still no luck even with 1.7.

Another thing, I have 17 videos in that SMB share I'm using, and I'm curious, when I hit test screensaver, does that shuffle the 17 videos or does it always play them in order. Wondering if it's not shuffled, then maybe just my 1st video in the playlist is just borked.

theothernt commented 4 months ago

Still no luck even with 1.7.

Ah, damn it.

Another thing, I have 17 videos in that SMB share I'm using, and I'm curious, when I hit test screensaver, does that shuffle the 17 videos or does it always play them in order. Wondering if it's not shuffled, then maybe just my 1st video in the playlist is just borked.

By default, the videos are shuffled each time so the app is having an issue playing most or all of the videos. That said, the player doesn't skip the video when there is an error - it's a long standing issue but I have a workaround I'm going to try.

Also, I want to add an option to try software decoders. I'll try and get a new beta to you soon.

theothernt commented 4 months ago

Ok, here is (link removed) - as you have the 1.7 GitHub installed, this will install on top of it and keep all the settings.

If this doesn't work then I will need to get the logs to see what the exact playback error is.

theothernt commented 3 months ago

Closing this issue until I get more info.

feerlessleadr commented 1 month ago

@theothernt I'm having the exact same issue as OP. I'm running 1.7.0 of the app on my shield pro, and am unable to play any of the downloaded Apple Aerial videos via smb.

I'm happy to help debug this so that I can stream locally instead over the internet. Thanks!

::EDIT:: Just to clarify, as it's been a while since I downloaded the files, all of the Aerial videos I downloaded from the links on the main page are the 4k SDR files, not DV/HDR.

theothernt commented 1 month ago

@feerlessleadr thanks for offering to help.

I can compile a debug version of the app (it just outputs more debug info than the normal version) for you, if that's ok?

It can be installed alongside your existing Aerial Views apps all. You'll then connect to your device with ADB, run the debug app, then capture and save the logs.

feerlessleadr commented 1 month ago

Yeah, sure thing. Let me know where to get the apk and I'll test tonight when my kids/wife are asleep.

theothernt commented 1 month ago

Yeah, sure thing. Let me know where to get the apk and I'll test tonight when my kids/wife are asleep.

Thanks, you can download the debug version from this link... (link removed)

Instructions on how to enable Developer Mode, ADB, etc are here... https://github.com/theothernt/AerialViews#how-to-set-aerial-views-as-the-default-screensaver

And the commands to save the logs should be above in a previous message - but let me know if anything isn't clear?

feerlessleadr commented 1 month ago

@theothernt Hey friend, sorry for the delay, had a family issue and have been out of pocket for the last week. I was able to try to start testing this, but am running into a similar issue as another user. I downloaded the tiny ADB package from the link you provided, and have debugging enabled on my shield, and am able to connect to my shield w/ adb, but when I run your command, it only produces a blank file.

Here is the order of things I did. I first installed the debug app and setup my smb share and also set it as the default screensaver on my Shield pro. I then force closed the app. I then connected to my shield from my windows laptop with the following:

adb connect 192.168.1.XX

I then opened the debug app on my shield, and did the 'test settings' and tried to skip a few videos (only a black screen showed up). After about 30 seconds of that, I ran the following command:

adb logcat -d | findstr 'EventLogger' > aerialviews.txt

The txt file was created, but it was blank.

I disconnected from adb on my shield and then repeated the above steps, but the logcat command I changed to the following, based on another user in this thread:

adb logcat -d | findstr EventLogger > aerialviews.txt

Same situation, the txt file was created in my folder, but it was blank.

I'm sure that I'm doing something wrong, but based on the steps you laid out above for the other user having this issue, I'm not sure what it is.

theothernt commented 1 month ago

@theothernt Hey friend, sorry for the delay, had a family issue and have been out of pocket for the last week.

No problem at all, take your time.

I'm sure that I'm doing something wrong, but based on the steps you laid out above for the other user having this issue, I'm not sure what it is.

It was my fault, sorry. I forgot to mention one crucial bit of info - you have to enable the following setting...

Settings > Advanced > Enable playback logging

Then the following command should create a text file with the logging messages from Aerial Views...

adb logcat -d | findstr EventLogger > aerialviews.txt

feerlessleadr commented 1 month ago

Thanks - that did it. I will test it out tonight on my nvidia shield pro that is having the issues. My onn 4k box (only connected to a 1080p TV) works fine with smb files, but I was able to generate the log off that box.

feerlessleadr commented 1 month ago

@theothernt Got a chance to test on my shield and get a log. See below:

https://paste.ubuntu.com/p/pJt2g9y9pJ/

theothernt commented 1 month ago

@theothernt Got a chance to test on my shield and get a log. See below:

https://paste.ubuntu.com/p/pJt2g9y9pJ/

Thanks for that. After looking at the logs and doing some research, my guess is that the issue is network related - at least that's what the error suggests. If it's ok, can I get a few more details on your network setup...

  1. Is the connection to the Shield + NAS wired or wireless?
  2. What NAS are you using?
  3. Would it be possible to get the SMB config of the server? (SMB v2 vs v3)

If you don't want to share the info in this issue, you can always email me directly.

Also, as the videos work with your Onn device, it is likely to be a SMB config issue with Aerial Views that only appears on the Shield. With details of the NAS/SMB config, I can hopefully rule out other issues or try to replicate the issue on my end.

feerlessleadr commented 1 month ago

Ok - so apparently I'm stupid, the local playback doesn't work on my onn device either (I forgot to disable the community videos by Jason Creative & Robin Fourcade, so that's what was playing and not the local files).

Here is a log from the onn device as well, which was trying to play to a 1080p TV:

https://paste.ubuntu.com/p/MvspxHyNWr/

In regards to the other info, here is the setup for the shield & onn: Is the connection to the Shield + NAS wired or wireless? Shield: wired ethernet connection; onn: wireless; NAS: wired connection What NAS are you using? I'm using a custom built Windows 10 server sharing my files over my network (including all of my TV/Movies media. Would it be possible to get the SMB config of the server? (SMB v2 vs v3) I'm not 1005 sure where to find this, but I do know that Windows 10 supports smb v3 and that it utilizes this for my other devices connected over SMB on my network.

theothernt commented 1 month ago

I'm using a custom built Windows 10 server sharing my files over my network (including all of my TV/Movies media. Would it be possible to get the SMB config of the server? (SMB v2 vs v3) I'm not 1005 sure where to find this, but I do know that Windows 10 supports smb v3 and that it utilizes this for my other devices connected over SMB on my network.

Thanks for all that info - it helps to rule out a number of other issues.

So it looks like an issue between Aerial Views, how it uses SMB and Windows 10 - as SMB shares are used by other users on macOS, Synology, and other Linux devices.

We can try a number of things. First, in Aerial Views > Media Sources > SMB/Samba share > Select SMB dialects - can you try disabling all the version, then enable one, try the screensaver and repeat?

Also, have you tried photos - or just videos?