Video playback on RPI 4 not working

Dear Emteria Team,

we are running our App on a RPI4 with your latest Emteria OS. Everything is working fine except that most of the video files which we want to play with the Exoplayer are not playing or just the first frame is shown before it stops. We get the following error [1].

The video files are normal mp4 files. Here are some details from ffmpeg:

Video: h264 (High) (avc1 / 0x31637661), yuv420p, 3840x1080 [SAR 1:1 DAR 32:9], 7775 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)

Any hints on that? Are some additional codecs required? Any experiences with that?

Thanks a lot and best regards

[1]
[42c82298118ecee8] com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.640034, -1, null, [3840, 2160, 29.970032], [-1, -1]), format_supported=YES at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:555) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:223) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: c2.android.avc.decoder at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1410) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:864) at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:945) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478) ... 3 more Caused by: java.lang.IllegalStateException at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method) at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3452) at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:100) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1842) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:843) ... 5 more [42c82298118ecee8] com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.640034, -1, null, [3840, 2160, 29.970032], [-1, -1]), format_supported=YES at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:555) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:223) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: c2.android.avc.decoder at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1410) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:864) at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:945) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478) ... 3 more Caused by: java.lang.IllegalStateException at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method) at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3452) at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:100) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1842) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:843) ... 5 more

Tagged:

Comments

  • Hi Flo,
    That can have several reasons. As you say a codec might be missing. Have you tried VLC player? Might also be because of the high resolution. We currently don't have hardware acceleration for most codecs. Does playback of smaller resolutions work?
    Can you share the video you are trying to play?

  • Hi,
    thanks for your quick reply. Interesting that you mention that. For smaller resolutions (1920 × 540) one video was working. But we need 4K resolution for an ultra stretch display (3840 × 1080).
    Here is a link to a video that did not work: https://1drv.ms/v/s!AtMSQllpSLyqmkqdGmHOB5czZJXP?e=0eriRL

    Would be great if you could help here. This is important for our project with a partner.

    Thanks

  • Hi smieschek,
    do you have any updates? It would be great to understand the problem and see if there is a solution with this setup.

    Thanks

  • Hi Flo,
    I could reproduce your described behaviour. We are running a few tests and will come back to you next week.

  • Hello smieschek, thanks for the update. Let me know if we can support somehow. It would be really important to get the 4K support on RPI4. I think this might also be relevant for other projects ;)
    Thanks

  • Maybe you already got one step further. I had a few more observations:

    • The complete operating system is very slow on a 4K display and is hanging over and over
    • I read that on RPI4 we should use h265 encoding for 4K. If I use this, it was giving me the following exception:

    [c31b0e8fde6f4707] com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/hevc, hvc1.1.6.L150.90, -1, null, [3840, 2160, 29.96793], [-1, -1]), format_supported=NO_EXCEEDS_CAPABILITIES at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:555) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:223) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: c2.android.hevc.decoder at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1410) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:864) at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:945) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478) ... 3 more Caused by: java.lang.IllegalStateException at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method) at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3452) at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:100) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1842) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:843) ... 5 more

    Let me know if I can do any more?
    Thanks

  • Any updates on this? We would really appreciate 4K support :)

  • Just to give an update. We tried all quick approaches and they hardly showed any improvement for 4k playback. The general consensus of our technical team is that only proper hardware acceleration will help, which comes with great effort for the RPi4.
    We will be looking into it in the upcoming weeks to have a better understanding what a realistic timeframe is.

  • Thanks for your feedback. Looking forward to the 4K Version ;)

  • Hi, I am using the latest nightly on rpi4 and I can't even get it to play 720p videos, I get similar logs like above and a system dialog saying "Can't play this video" any ideas what could be wrong? The same code works on other devices so it isn't the code.

  • Hi @smieschek,

    you wrote: "We currently don't have hardware acceleration for most codecs."

    Could you seznam a list of codecs that are HW accelerated?

    We are solving issue with our client regarding slow video playback performance using tag in Chromium (webview) on 1920x1080 resolution (RPi 4). Partially helps reducing bit rate (approx. 3 Mbit/s and lower), but then the quality of video is insufficient.

  • edited August 2021

    -

  • @kiwi My wording was misleading. We don't have hardware acceleration for the most common codecs: HEVC (H.265), AVC (H.264) and VP8/VP9. I don't have a positive list. Best playback experience was in browser/webview.

    @agambatra 720p should generally be possible. I would like to try it on my device. Can you share the video with me?

  • edited September 2021

    @smieschek - that's very bad news because Raspberry Pi 4 is now unusable for typical digital signage purposes. Our partner had to replace about 20 Rpi4 devices for Windows Player because of poor video playback last week.

    Are you planning to add at least H.264 HW decoding into emteriaOS for RPi4 in near future?

  • @smieschek Have you read our last question?

  • @kiwi There are very few requests for HW decoding and 4k on RPi4. We plan to estimate the effort beginning of 2022. There is the possibility to add support for a board that would bring HW decoding and 4k with emteria.OS out of the box. Would that be of interest to you?
  • @smieschek said:
    @kiwi There are very few requests for HW decoding and 4k on RPi4. We plan to estimate the effort beginning of 2022. There is the possibility to add support for a board that would bring HW decoding and 4k with emteria.OS out of the box. Would that be of interest to you?

    I know we would love to use RP4 with HDMI out at 1080p or above. We are in exploration phase right now. I really wanted dual screen capability so screen could play video while touch screen below for menu.

  • hi @zachtos
    Noted, thanks for reaching out.
    We are always curious about new use cases and projects. Can you share more information? You can write to sales@emteria.com

  • Add us to the list of people requesting proper HD and UHD video playback in a webview. Our testing shows really only SD can play without skipping right now. H.264 would likely be enough.

    Our Splash-tiles.com digital signage tool works GREAT on Emteria, with the exception of the lack of working HW video playback.

  • edited July 2022

    hey @Flo , @agambatra , @kiwi , @zachtos and @storm
    We have a first nightly for the Rock Pi 4B ( https://rockpi.org/rockpi4 ), see https://emteria.com/supported-hardware
    It's a first version, which doesn't come with all features yet. E.g. no DSI or OTA for now. But it can play mp4s in HD/UHD and is generally running really smooth. Please give it a try! - Looking forward to your feedback

Sign In or Register to comment.