Video Playback Difficulties

I'm having a lot of issues with playing back 4k video on Firefox and the Android App. It works fine in Chrome. I thought setting up transcoding would help, but after transcoding all my videos to 1080p h264 I'm not sure it's even using the transcoded videos for playback (I still get hung on a load loop on the app without any logs populated and No video with supported format and MIME type found.) Am I missing something? Seems strange it would work in Chrome but not really anywhere else. I am running on 1.63.2 server and 1.63.0 build.86 on Android.
22 Replies
Alex Tran
Alex Tran2y ago
It might be licensing issue of playing a specific format
linxawakening
linxawakeningOP2y ago
How would I be able to look into that? And shouldn't the transcode kind of fix that though? Doesn't it create a new video at the specified format?
Alex Tran
Alex Tran2y ago
it should, so this is a little weird
brighteyed
brighteyed2y ago
We have this bug https://github.com/immich-app/immich/issues/2732 Is audio stream present in your videos?
GitHub
[BUG] Videos without audio are not transcoded · Issue #2732 · immic...
The bug I want to upload videos from my drone, which have no audio track. However, these videos are never transcoded by the server. The relevant check is in server/src/domain/media/media.service.ts...
linxawakening
linxawakeningOP2y ago
It is, again it seems to only be happening for my 4k videos. It's only happens to 4k videos that come from my Pixel 7 Pro. Any other videos from the Pixel work Is there a way to check to see if there's a transcoded file associated? The names for the transcodes are pretty cryptic
sogan
sogan2y ago
since the video loads in chrome, you can try right clicking and downloading it. that way you can check if it’s serving a transcode or the original. and if you haven’t restarted the immich_microservices container, the logs should show if there any videos that failed to transcode
linxawakening
linxawakeningOP2y ago
It is not, it's serving the original. And I have restarted the complete container to update it to 1.64, and I'm running the all-in-one container on Uraid (plus postgresql14 and redis). I don't know if I have or how to
sogan
sogan2y ago
my guess is that the transcoding is failing for some reason. have you tried transcoding missing videos? if not, try running that and looking at the logs when jobs fail, the dashboard can be a bit misleading since you just see the number of queued jobs go down as though they're being processed very quickly. so it helps to double check that they actually run successfully with a "missing" run afterwards
linxawakening
linxawakeningOP2y ago
Ok so when I try to run just missing now I get this error
sogan
sogan2y ago
it sounds like there's an issue with the video files themselves from searching this can happen if videos are either streamed or encrypted. we only process videos once they're fully copied so it's not the former, so could it be that the videos are encrypted?
linxawakening
linxawakeningOP2y ago
That seems strange, it's a part of the auto upload from the app from my phone and that it would only be the 4k videos (and not any of the other videos it uploads from the same phone) Would it matter if it's in 10-bit HDR?
sogan
sogan2y ago
it shouldn't is there any video you'd be able to share here?
linxawakening
linxawakeningOP2y ago
I'll just take one now Just for more strange, this popped up when uploading and checking it out
[Nest] 926 - 06/28/2023, 1:37:26 PM ERROR [AssetService] Error serving VIDEO asset=65e6b1ee-cd7f-4c2f-b118-c94244a4fd21
[Nest] 1670 - 06/28/2023, 1:37:18 PM LOG [MediaService] Start encoding video 65e6b1ee-cd7f-4c2f-b118-c94244a4fd21 -vcodec h264,-acodec aac,-movflags faststart,-vf scale=1080:-2,-preset superfast,-crf 23
[Nest] 1670 - 06/28/2023, 1:37:26 PM LOG [MediaService] Encoding success 65e6b1ee-cd7f-4c2f-b118-c94244a4fd21
[Nest] 926 - 06/28/2023, 1:37:26 PM ERROR [AssetService] Error serving VIDEO asset=65e6b1ee-cd7f-4c2f-b118-c94244a4fd21
[Nest] 1670 - 06/28/2023, 1:37:18 PM LOG [MediaService] Start encoding video 65e6b1ee-cd7f-4c2f-b118-c94244a4fd21 -vcodec h264,-acodec aac,-movflags faststart,-vf scale=1080:-2,-preset superfast,-crf 23
[Nest] 1670 - 06/28/2023, 1:37:26 PM LOG [MediaService] Encoding success 65e6b1ee-cd7f-4c2f-b118-c94244a4fd21
linxawakening
linxawakeningOP2y ago
sogan
sogan2y ago
after looking into this, there's a few things going on here. 1. this video is valid, but it's not h264 but instead hevc. starting in android 12, pixel phones default to this format for videos (not sure if any other oems have switched). 2. besides being hevc, it also has an extra MetaHandle stream that ffprobe can't interpret correctly. 3. on this video at least, ffprobe does not say moov atom not found but instead says Unsupported codec with id 0 for input stream 0 (referring to MetaHandle) 3. possibly because of (3), if passed to ffmpeg it is converted correctly without any errors. as for why this video transcoded successfully while others did not, my guess is that android does some kind of optimization on videos that makes ffprobe even more confused. but since you uploaded it right after taking the video it didn't have a chance to do this yet. probably the easiest solution for now is to disable the "store videos efficiently" setting on your phone so they're stored as h264 however, this only affects new videos, not any already recorded videos. moving forward, android has a "compatible media transcoding" api to solve this problem by transcoding on the phone itself, so your videos can stay as hevc. but the app has to request this.
sogan
sogan2y ago
this will convert videos to h264 when they're copied from your phone to pc, so you could then import them through the cli.
sogan
sogan2y ago
lastly, if you're fine with enabling this api for all video uploads, you can instead enable it globally with this setting https://source.android.com/docs/core/media/media-transcoding#global-transcoding
sogan
sogan2y ago
this should "just work" for any videos you upload from now on without needing to copy them to pc or store them as h264 etc. however, the videos already in the server will still be the incompatible versions so you'd want to import on a fresh instance of immich.
linxawakening
linxawakeningOP2y ago
this is super helpful I'll see what I can do, already checked off the efficiency storage option. I'll see how it goes. And again at least I have one spot where I can get it (chrome)
sogan
sogan2y ago
np! lmk if you have any issues with videos recorded with that setting turned off. i'll also make an issue on gh so all of this is at least documented

Did you find this page helpful?