pachli-android
pachli-android copied to clipboard
Unsupported Video Codec?
Describe the bug Repeatedly stumbled across toots with a video that won't play In the last few days. Instead a very technical error message appears:
Wiedergabe fehlgeschlagen: Decoder init failed: c2.qti.avc.decoder, Format(1, null, null, video/ avc, avc1.4D0033, -1, null, [2232, 1340, 56.39198, ColorInfo(BT709, Limited range, SDR SMPTE 170M, false, 8bit Luma, 8bit Chroma)], [-1, -1])
”Wiedergabe fehlgeschlagen“ is ”Playback failed in German.
I cannot tell if users have started posting videos in a new and unsupported format, if it is a bug in my version of Pachli, or if it is the fault of my new device (Moto g84 5G, Android 14).
To Reproduce Steps to reproduce the behavior:
- Open https://front-end.social/@chriscoyier/113439004295620843 in Pachli
- Click on the video
- See an error message instead of a video
Expected behavior The video plays (or, if that's beyond possible, I can find a helpful explanation. That is, for non-developers: File is corrupted; Codec is missing. See here to install; Android 1138 required; Device with special hardware required; ...)
Versions Pachli Current 2.8.3+adc7060b
Device: motorola moto g84 5G Android-Version: 14 SDK-Level: 34
Account: @[email protected] Version: 4.3.1
Affirmation I have checked other issues for this project (open and closed) and I cannot find one that matches the problem I am reporting.
Thanks for the report.
Note to self: ViewVideoFragment has this:
override fun onPlayerError(error: PlaybackException) {
val message = getString(
R.string.error_media_playback,
error.cause?.message ?: error.message,
)
Snackbar.make(binding.root, message, Snackbar.LENGTH_INDEFINITE)
.setAction(app.pachli.core.ui.R.string.action_retry) { player?.prepare() }
.show()
}
which preferentially shows the inner error message from cause. Changing that to just use error.message might provide a better error, which is worth trying.
Today's Pachli Current is going to include a change that prefers the "higher level" error message from the video player (if it exists). I'd be grateful if you could let me know if that provides better / more actionable information.
Thank you for the effort. The message is different now:
Wiedergabe fehlgeschlagen: MediaCodec VideoRenderer error, index=0, format-Format(1, null, null, video/ avc, avc1.4D0033, -1, null, [2232, 1340, 56.39198, ColorInfo(BT709, Limited range, SDR SMPTE 170M, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_su...
Well, that is still very technical. And now the message is cropped. The last word might be something readable but right now it is not useful yet.
Idea: What about a simple message like "Playback failed" (localized), followed by a "details" button/link/collapse_toggle that reveals the full details. I suppose the exceptions themselves are too unpredictable or complex so it would be out of scope to translate them into anything understandable. We're talking about a mastodon client, not a video authoring tool.
I've faced with some posts with videos that can't be played. Pachli gives the following error:
Link to post:
https://fosstodon.org/@stovis/114211103706705602
See attached adb log:
However, other posts aren't affected. For example:
https://stefanbohacek.online/@trains/114218243698043458
I've tried from different servers within Pachli but the error persists. If I download video from Pachli, I can play it on the device. I can also play it by opening the post in the android web browser.
I've noticed there are a few differences between both example videos, but don't know if that causes the issue. I wonder if it could be related to the resolution of video vs device, as high resolution videos can't be played so far. I could not find any high resolution video that works. I'll keep an eye on this problem and bookmark posts that fail. Just in case it helps, here are the media info I get from both videos:
fosstodon-info.txt stefanbohacek-info.txt
Open https://front-end.social/@chriscoyier/113439004295620843 in Pachli
By the way, I get the same error by trying that post.
Other non-working examples
1
https://social.hardlimit.com/@pos_yo/114041468280235743
2
https://mastodon.social/@atareao/112530916701915838
Device and software information Motorola Moto E2 Pachli 2.10.1 Android 10
@jumase : I think these might be device / Android version issues, as those play OK in Pachli on my Pixel 4a 5G (Android 14).
Because of that it's tricky for me to turn this in to a bug report for the androidx.media3 group, but you should be able to. To do that you need to:
-
Clone and import the project at https://github.com/androidx/media
-
Edit
demo/assets/media.exolist.json. The format is self-explanatory. For example, to add the first video that failed I added:{ "name": "Mastodon samples", "samples": [ { "name": "@stovis example", "uri": "https://cdn.fosstodon.org/media_attachments/files/114/211/099/336/417/018/original/1a6da5c3bbddf138.mp4" } ] },as the first entry.
-
From Run Configurations select demo, then build and launch it on your device.
-
Select the videos that should fail, and try and play them.
-
File a bug report using https://github.com/androidx/media/issues/new?template=bug.yml.
https://github.com/androidx/media/issues/524 is an example of a report I've filed previously.
If you get to step 4 and the videos play OK in the demo app let me know, as that would point back to a Pachli issue.
I think these might be device / Android version issues, as those play OK in Pachli on my Pixel 4a 5G (Android 14).
Good to know then. 🙂 I can still download videos to watch them locally (great feature). Besides, it's a great feature to avoid playback loop and so re-downloading of big videos.
Thanks for all the information. I could manage to build the demo but could not play any of the videos. I've just filed a bug report at https://github.com/androidx/media/issues/2290
Apparently, the issue is that my device doesn't have hardware decoding support, although there is software decoding. However, ExoPlayer (or my device) fails to select the software decoding, I could not fully understand why. An ExoPlayer developer suggested implementing a workaround to remove the hardware decoder from the options, and provided some guidance on this. I'm not sure if that should/could be implemented on Pachli.
As I mentioned on the other issue, I can usually play those videos with VLC after downloading. So having the download button is great for my usage. One thing that could be done in this regard is providing an option to download videos directly on long-pressing, though I'm not sure how difficult or reliable this could be. It would save only one click but the main advantage is that it would avoid the pre-downloading that happens between I first tap on the video until I click download — I have disabled "Download media previews" in settings. Or even better, extract/export media from cache; is that possible (to avoid double downloading)?