google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.75k stars 6.03k forks source link

Video freezes on AMLogic device #926

Closed goffioul closed 9 years ago

goffioul commented 9 years ago

I'm testing the ExoPlayer demo app using the stream http://content.jwplatform.com/manifests/vM7nH0Kl.m3u8. I start the demo app using

adb shell am start -n com.google.android.exoplayer.demo/.PlayerActivity -d http://content.jwplatform.com/manifests/vM7nH0Kl.m3u8

The audio runs fine, but the video freezes. Every now and then (maybe every 5 secs or more) the picture is updated, but that's about it. The device uses an AMLogic SoC (S805). Logcat output for the exoplayer app is as follows:

I/ActivityManager(  501): Start proc com.google.android.exoplayer.demo for activity com.google.android.exoplayer.demo/.PlayerActivity: pid=2459 uid=10059 gids={50059, 3003, 1028, 1015}
I/ALooperRoster( 2459): ALooperRoster unregisterHandler handlerID=2c
I/omx_core( 2459): OMX_Deinit 96 gInitCount=0
D/EventLogger( 2459): end [41.64]
I/ExoPlayerImpl( 2459): Init 1.5.2
D/EventLogger( 2459): start [0]
D/EventLogger( 2459): state [0.00, false, P]
D/EventLogger( 2459): state [0.00, true, P]
V/EventLogger( 2459): loadStart [0.26, 0, 4, 0, 0]
V/EventLogger( 2459): loadEnd [0.45, 0, 192]
V/EventLogger( 2459): loadStart [0.45, 0, 1, 0, 4000]
D/EventLogger( 2459): state [0.57, true, B]
W/ALooperRoster( 2459): ALooper::handler_id ALooperRoster::registerHandler 45
D/EventLogger( 2459): videoFormat [0.57, 1, 0]
W/ALooperRoster( 2459): ALooper::handler_id ALooperRoster::registerHandler 46
I/OMXClient( 2459): Using client-side OMX mux.
E/ACodec  ( 2459): [OMX.amlogic.avc.decoder.awesome] storeMetaDataInBuffers failed w/ err -2147483648
I/ACodec  ( 2459): onConfigureComponent native-window finished OMX.amlogic.avc.decoder.awesome 
D/EventLogger( 2459): decoderInitialized [0.61, OMX.amlogic.avc.decoder.awesome]
W/ALooperRoster( 2459): ALooper::handler_id ALooperRoster::registerHandler 47
W/ALooperRoster( 2459): ALooper::handler_id ALooperRoster::registerHandler 48
I/OMXClient( 2459): Using client-side OMX mux.
I/omx_core( 2459): OMX_Init 66 gInitCount=1
V/AML_all_components( 2459): 
V/AML_all_components( 2459): --------------------------------
V/AML_all_components( 2459): author:aml.sh multi-media team
V/AML_all_components( 2459): branch name:   
V/AML_all_components( 2459): git version:    
V/AML_all_components( 2459): last changed:  
V/AML_all_components( 2459): build-time:     Mon Dec  1 18:16:48 CST 2014
V/AML_all_components( 2459): build-name:     brian.zhu
V/AML_all_components( 2459): uncommitted-file-num:0
V/AML_all_components( 2459): cd /mnt/fileroot/brian.zhu/m8baby
V/AML_all_components( 2459): hostname droid05
V/AML_all_components( 2459): --------------------------------
V/OmxComponentManagerImpl( 2459): loadLibrary:223 Loading OMX library libOmxVideo.so.
E/omx_video( 2459): amvenc_avc open failed!set default instance number as 1,ret=-1,Permission denied(13)
I/omx_core( 2459): Core library has 20 components
E/OMXMaster( 2459): A component of name 'OMX.google.alac.decoder' already exists, ignoring this one.
W/ALooperRoster( 2459): ALooper::handler_id ALooperRoster::registerHandler 49
I/ACodec  ( 2459): onConfigureComponent native-window finished OMX.google.aac.decoder 
D/EventLogger( 2459): decoderInitialized [0.64, OMX.google.aac.decoder]
V/EventLogger( 2459): loadEnd [0.64, 0, 192]
V/EventLogger( 2459): loadStart [0.64, 0, 1, 4000, 8000]
I/SoftAAC2( 2459): Reconfiguring decoder: 0->44100 Hz, 0->2 channels
V/EventLogger( 2459): loadEnd [0.76, 0, 117]
V/EventLogger( 2459): loadStart [0.76, 0, 1, 8000, 12000]
D/dalvikvm( 2459): GC_CONCURRENT freed 14484K, 84% free 3476K/21260K, paused 3ms+6ms, total 48ms
D/dalvikvm( 2459): WAIT_FOR_CONCURRENT_GC blocked 21ms
V/EventLogger( 2459): loadEnd [1.08, 0, 317]
V/EventLogger( 2459): loadStart [1.08, 0, 1, 12000, 16000]
D/dalvikvm( 2459): GC_CONCURRENT freed 598K, 83% free 3753K/21260K, paused 2ms+1ms, total 16ms
D/dalvikvm( 2459): GC_CONCURRENT freed 13K, 78% free 4713K/21260K, paused 1ms+3ms, total 17ms

I'm only testing with HLS stream, but this happens for all HLS streams I've tried (e.g. http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8).

bsysop commented 9 years ago

Hi @goffioul please find another posts about AmLogic in here, this is not Exoplayer problem.

Do you have rooted device? What Android version?

ojw28 commented 9 years ago

Let's use #678 to track this, assuming it's the same/similar.

goffioul commented 9 years ago

@bsysop, this is a rooted device. It's running Android 4.4.2. I don't think it's an ExoPlayer problem either, but I'm looking for a workaround to make ExoPlayer usable.

@ojw28, not sure this is the same as #678. In my case, the video is constantly frozen. Sometimes, the picture changes, so the framerate is about 0.1 to 0.2 fps. I'll review the other issue and try the suggested workarounds.

bsysop commented 9 years ago

@goffioul please put here your /system/etc/media_codecs.xml and also media_profiles.xml

goffioul commented 9 years ago

@bsysop Here there are.

/system/etc/media_codecs.xml

<MediaCodecs>
    <Decoders>
        <MediaCodec name="OMX.amlogic.avc.decoder.awesome" type="video/hevc" />
        <MediaCodec name="OMX.amlogic.avc.decoder.awesome" type="video/avc" />
        <MediaCodec name="OMX.amlogic.mpeg4.decoder.awesome" type="video/mp4v-es" />
        <MediaCodec name="OMX.amlogic.h263.decoder.awesome" type="video/3gpp" />
        <MediaCodec name="OMX.amlogic.mpeg2.decoder.awesome" type="video/mpeg2" />
        <MediaCodec name="OMX.amlogic.vc1.decoder.awesome" type="video/vc1" />
        <MediaCodec name="OMX.amlogic.wmv3.decoder.awesome" type="video/wmv3" />
        <MediaCodec name="OMX.amlogic.mjpeg.decoder.awesome" type="video/mjpeg" />
        <MediaCodec name="OMX.google.amrnb.decoder" type="audio/3gpp" />
        <MediaCodec name="OMX.google.amrwb.decoder" type="audio/amr-wb" />
        <MediaCodec name="OMX.google.aac.decoder" type="audio/mp4a-latm" />
        <MediaCodec name="OMX.google.adif.decoder" type="audio/aac-adif" />
        <MediaCodec name="OMX.google.latm.decoder" type="audio/aac-latm" />
        <MediaCodec name="OMX.google.adts.decoder" type="audio/adts" />
        <MediaCodec name="OMX.google.g711.alaw.decoder" type="audio/g711-alaw" />
        <MediaCodec name="OMX.google.g711.mlaw.decoder" type="audio/g711-mlaw" />
        <MediaCodec name="OMX.google.adpcm.ima.decoder" type="audio/adpcm-ima" />
        <MediaCodec name="OMX.google.adpcm.ms.decoder" type="audio/adpcm-ms" />
        <MediaCodec name="OMX.google.vorbis.decoder" type="audio/vorbis" />
        <MediaCodec name="OMX.google.alac.decoder" type="audio/alac" />
        <MediaCodec name="OMX.google.wma.decoder" type="audio/wma" />
        <MediaCodec name="OMX.google.wmapro.decoder" type="audio/wmapro" />
        <MediaCodec name="OMX.google.ape.decoder" type="audio/ape" />
        <MediaCodec name="OMX.google.truehd.decoder" type="audio/truehd" />
        <MediaCodec name="OMX.google.cook.decoder" type="audio/cook" />
        <MediaCodec name="OMX.google.flac.decoder" type="audio/flac" />

        <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" />
        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" />
        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" />
        <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" />
        <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" />
        <MediaCodec name="OMX.google.rm.decoder" type="video/rm" />
        <MediaCodec name="OMX.google.wmv2.decoder" type="video/wmv2" />
         <MediaCodec name="OMX.google.wmv1.decoder" type="video/wmv1" />
        <!-- DOLBY_UDC -->
        <MediaCodec name="AML.google.ac3.decoder" >
            <Type name="audio/ac3" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>
        <MediaCodec name="AML.google.ec3.decoder" >
            <Type  name="audio/eac3" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>
        <!-- DOLBY_UDC END -->

        <MediaCodec name="OMX.google.mp2.decoder" >                              
            <Type  name="audio/mpeg-L2" />                                               
            <Quirk name="needs-flush-before-disable" />                               
            <Quirk name="requires-flush-complete-emulation" />                        
        </MediaCodec>               

        <MediaCodec name="OMX.google.mp3.decoder" >
            <Type  name="audio/mpeg" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>

        <MediaCodec name="AML.google.dtshd.decoder" >
            <Type  name="audio/dtshd" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>
    </Decoders>

    <Encoders>
        <MediaCodec name="OMX.google.amrnb.encoder" type="audio/3gpp" />
        <MediaCodec name="OMX.google.amrwb.encoder" type="audio/amr-wb" />
        <MediaCodec name="OMX.google.aac.encoder" type="audio/mp4a-latm" />
        <MediaCodec name="OMX.google.flac.encoder" type="audio/flac" />

        <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" />
        <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" />
        <MediaCodec name="OMX.amlogic.video.encoder.avc" type="video/avc" />
        <MediaCodec name="OMX.google.h264.encoder" type="video/avc" />
        <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" />
    </Encoders>
</MediaCodecs>

/system/etc/media_profiles.xml

<MediaSettings>
<CamcorderProfiles cameraId="0" startOffsetMs="50">

<VideoDecoderCap name="wmv" enabled="true" />
<AudioDecoderCap name="wma" enabled="true" />

<AudioEncoderCap name="amrwb"
enabled="true"
minBitRate="6600"
maxBitRate="23050"
minSampleRate="16000"
maxSampleRate="16000"
minChannels="1"
maxChannels="1" />

<VideoEncoderCap name="h263"
enabled="true"
minBitRate="192000"
maxBitRate="420000"
minFrameWidth="176"
maxFrameWidth="352"
minFrameHeight="144"
maxFrameHeight="288"
minFrameRate="1"
maxFrameRate="20" />

<VideoEncoderCap name="h264"
enabled="true"
minBitRate="192000"
maxBitRate="6000000"
minFrameWidth="176"
maxFrameWidth="1280"
minFrameHeight="144"
maxFrameHeight="720"
minFrameRate="5"
maxFrameRate="30" />

<VideoEncoderCap name="m4v"
enabled="true"
minBitRate="192000"
maxBitRate="1440000"
minFrameWidth="176"
maxFrameWidth="640"
minFrameHeight="144"
maxFrameHeight="480"
minFrameRate="1"
maxFrameRate="15" />

<EncoderProfile quality="720p" fileFormat="3gp" duration="60">
<Video codec="h264"
bitRate="6000000"
width="1280"
height="720"
frameRate="30" />

<Audio codec="amrwb"
bitRate="23050"
sampleRate="16000"
channels="1" />
</EncoderProfile>

<EncoderProfile quality="timelapse720p" fileFormat="3gp" duration="60">
<Video codec="h264"
bitRate="6000000"
width="1280"
height="720"
frameRate="30" />

<Audio codec="amrwb"
bitRate="23050"
sampleRate="16000"
channels="1" />
</EncoderProfile>

<EncoderProfile quality="480p" fileFormat="3gp" duration="60">
<Video codec="m4v"
bitRate="1440000"
width="640"
height="480"
frameRate="15" />

<Audio codec="amrwb"
bitRate="23050"
sampleRate="16000"
channels="1" />
</EncoderProfile>

<EncoderProfile quality="timelapse480p" fileFormat="3gp" duration="60">
<Video codec="h264"
bitRate="6000000"
width="640"
height="480"
frameRate="15" />

<Audio codec="amrwb"
bitRate="23050"
sampleRate="16000"
channels="1" />
</EncoderProfile>

<EncoderProfile quality="cif" fileFormat="3gp" duration="30">
<Video codec="m4v"
bitRate="1440000"
width="352"
height="288"
frameRate="15" />

<Audio codec="amrwb"
bitRate="23050"
sampleRate="16000"
channels="1" />
</EncoderProfile>

<EncoderProfile quality="timelapsecif" fileFormat="3gp" duration="30">
<Video codec="m4v"
bitRate="1440000"
width="352"
height="288"
frameRate="15" />

<Audio codec="amrwb"
bitRate="23050"
sampleRate="16000"
channels="1" />
</EncoderProfile>

<EncoderOutputFileFormat name="3gp" />
<EncoderOutputFileFormat name="mp4" />

<ImageEncoding quality="70" />
<ImageEncoding quality="80" />
<ImageEncoding quality="90" />

</CamcorderProfiles>

  <AudioEncoderCap name="aac" enabled="true"
      minBitRate="758" maxBitRate="288000"
      minSampleRate="8000" maxSampleRate="48000"
      minChannels="1" maxChannels="1" />

  <AudioEncoderCap name="heaac" enabled="true"
      minBitRate="8000" maxBitRate="64000"
      minSampleRate="16000" maxSampleRate="48000"
      minChannels="1" maxChannels="1" />

  <AudioEncoderCap name="aaceld" enabled="true"
      minBitRate="16000" maxBitRate="192000"
      minSampleRate="16000" maxSampleRate="48000"
      minChannels="1" maxChannels="1" />

  <AudioEncoderCap name="amrwb" enabled="true"
      minBitRate="6600" maxBitRate="23050"
      minSampleRate="16000" maxSampleRate="16000"
      minChannels="1" maxChannels="1" />

  <AudioEncoderCap name="amrnb" enabled="true"
      minBitRate="4750" maxBitRate="12200"
      minSampleRate="8000" maxSampleRate="8000"
      minChannels="1" maxChannels="1" />
</MediaSettings>
bsysop commented 9 years ago

Right,

Remount this partition, change your media_codecs.xml, reboot, check again with adb if this still changed and then try Exoplayer again.

<MediaCodecs>
    <Decoders>
<MediaCodec name="OMX.amlogic.avc.decoder.awesome" type="video/avc" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
        <MediaCodec name="OMX.amlogic.hevc.decoder.awesome" type="video/hevc" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
        <MediaCodec name="OMX.amlogic.mpeg4.decoder.awesome" type="video/mp4v-es" />
        <MediaCodec name="OMX.amlogic.h263.decoder.awesome" type="video/3gpp" />
        <MediaCodec name="OMX.amlogic.mpeg2.decoder.awesome" type="video/mpeg2" />
        <MediaCodec name="OMX.amlogic.vc1.decoder.awesome" type="video/vc1" />
        <MediaCodec name="OMX.amlogic.wmv3.decoder.awesome" type="video/wmv3" />
        <MediaCodec name="OMX.amlogic.mjpeg.decoder.awesome" type="video/mjpeg" />
        <MediaCodec name="OMX.google.amrnb.decoder" type="audio/3gpp" />
        <MediaCodec name="OMX.google.amrwb.decoder" type="audio/amr-wb" />
        <MediaCodec name="OMX.google.aac.decoder" type="audio/mp4a-latm" />
        <MediaCodec name="OMX.google.adif.decoder" type="audio/aac-adif" />
        <MediaCodec name="OMX.google.latm.decoder" type="audio/aac-latm" />
        <MediaCodec name="OMX.google.adts.decoder" type="audio/adts" />
        <MediaCodec name="OMX.google.g711.alaw.decoder" type="audio/g711-alaw" />
        <MediaCodec name="OMX.google.g711.mlaw.decoder" type="audio/g711-mlaw" />
    <MediaCodec name="OMX.google.adpcm.ima.decoder" type="audio/adpcm-ima" />
        <MediaCodec name="OMX.google.adpcm.ms.decoder" type="audio/adpcm-ms" />
        <MediaCodec name="OMX.google.vorbis.decoder" type="audio/vorbis" />
        <MediaCodec name="OMX.google.alac.decoder" type="audio/alac" />
        <MediaCodec name="OMX.google.wma.decoder" type="audio/wma" />
        <MediaCodec name="OMX.google.wmapro.decoder" type="audio/wmapro" />
        <MediaCodec name="OMX.google.ape.decoder" type="audio/ape" />
        <MediaCodec name="OMX.google.truehd.decoder" type="audio/truehd" />
        <MediaCodec name="OMX.google.ffmpeg.decoder" type="audio/ffmpeg" />

        <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" />
        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" />
        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" />
        <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" />
        <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" />
        <MediaCodec name="OMX.google.rm.decoder" type="video/rm" />
        <MediaCodec name="OMX.google.wmv2.decoder" type="video/wmv2" />
         <MediaCodec name="OMX.google.wmv1.decoder" type="video/wmv1" />
        <!-- DOLBY_UDC -->
        <MediaCodec name="AML.google.ac3.decoder" >
            <Type name="audio/ac3" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>
        <MediaCodec name="AML.google.ec3.decoder" >
            <Type  name="audio/eac3" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>
        <!-- DOLBY_UDC END -->

        <MediaCodec name="OMX.google.mp2.decoder" >                              
            <Type  name="audio/mpeg-L2" />                                               
            <Quirk name="needs-flush-before-disable" />                               
            <Quirk name="requires-flush-complete-emulation" />                        
        </MediaCodec>               

        <MediaCodec name="OMX.google.mp3.decoder" >
            <Type  name="audio/mpeg" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>

        <MediaCodec name="AML.google.dtshd.decoder" >
            <Type  name="audio/dtshd" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>
    </Decoders>

    <Encoders>
        <MediaCodec name="OMX.google.amrnb.encoder" type="audio/3gpp" />
        <MediaCodec name="OMX.google.amrwb.encoder" type="audio/amr-wb" />
        <MediaCodec name="OMX.google.aac.encoder" type="audio/mp4a-latm" />
        <MediaCodec name="OMX.google.flac.encoder" type="audio/flac" />

        <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" />
        <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" />
        <MediaCodec name="OMX.amlogic.video.encoder.avc" type="video/avc" />
        <MediaCodec name="OMX.google.h264.encoder" type="video/avc" />
        <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" />
    </Encoders>
</MediaCodecs>
goffioul commented 9 years ago

I'll give it a try, but are the changes to OMX.google.cook.decoder and OMX.google.flac.decoder required, or is it because you're providing me your version?

bsysop commented 9 years ago

Yes, sorry for that.

Just change theses lines, AVC and HEVC

<MediaCodec name="OMX.amlogic.avc.decoder.awesome" type="video/avc" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
        <MediaCodec name="OMX.amlogic.hevc.decoder.awesome" type="video/hevc" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
goffioul commented 9 years ago

I didn't see any difference. The picture is still frozen, while the audio runs fine. The frozen picture updates every 5 to 10 seconds.

bsysop commented 9 years ago

This is absolutely bad!

Only i can say you is try to upgrade the AmLogic media decoders in another way you should use Software Decoder and this is a really ugly ideia, but i think will be 300% better than this Frozen every 5/10 seconds.

Like you can see in #678 you can select the codec.

goffioul commented 9 years ago

It appears the video freeze problem only affects HLS. The test DASH streams in the demo app plays fine. If the problem is the AMLogic decoder, I'd expect to also affect DASH streams, isn't it?

bsysop commented 9 years ago

Well, the problems i got are in all h264 contents, more heavy in Dash, but also happens in HLS with some drops.

You should try to upgrade all your system with last Amlogic firmware and try again!.

goffioul commented 9 years ago

Unfortunately, I don't have any firmware update. I'm using the most recent SDK I can get. Reaching out to AMLogic seems to be a dead end, as they keep insisting that they can play the streams fine with the app com.android.gallery3d, so they won't acknowledge there's any problem.

bsysop commented 9 years ago

I see, do you have another AmLogic device for test?

goffioul commented 9 years ago

No, this is the only AMLogic platform we currently use. We use another platform from Rockchip, running 4.2.2, and that one is working fine.

bsysop commented 9 years ago

I see, sorry for that buddy, maybe another one can help you.

TheNetStriker commented 8 years ago

I got a similar problem on my Wetek Play 2 device. (Amlogic S905H) The device only renders the first image of any video. Here is my logcat output:

10-31 21:51:27.801 25239-27688/ch.masshardt.idbrowser I/OMXClient: Using client-side OMX mux.
10-31 21:51:27.827 25239-27688/ch.masshardt.idbrowser I/omx_core: OMX_Init 66 gInitCount=1
10-31 21:51:27.827 25239-27688/ch.masshardt.idbrowser V/AML_all_components: --------------------------------
                                                                            ARCH = arm
                                                                            author:aml.sh multi-media team
                                                                            branch name:   * jb-mr1-amlogic
                                                                            git version:   011dae5a4bcb3e3676f392664ac0bf74db6cca1b 
                                                                            last changed:  Date: Sun Dec 27 20:57:19 2015 +0800
                                                                            build-time:     Thu Jan 7 14:47:14 CST 2016
                                                                            build-name:     jintao.xu
                                                                            uncommitted-file-num:0
                                                                            cd /mnt/fileroot/jintao.xu/5.1.p201
                                                                            hostname droid07
                                                                            --------------------------------
10-31 21:51:27.827 25239-27688/ch.masshardt.idbrowser V/OmxComponentManagerImpl: loadLibrary:228 Loading OMX library libOmxVideo.so.
10-31 21:51:27.827 25239-27688/ch.masshardt.idbrowser E/omx_video: amvenc_avc open failed!set default instance number as 1,ret=-1,Permission denied(13)
10-31 21:51:27.827 25239-27688/ch.masshardt.idbrowser I/omx_core: Core library has 11 components
10-31 21:51:27.828 25239-27688/ch.masshardt.idbrowser E/OMXMaster: A component of name 'OMX.google.h264.decoder' already exists, ignoring this one.
10-31 21:51:27.828 25239-27688/ch.masshardt.idbrowser E/OMXMaster: A component of name 'OMX.google.alac.decoder' already exists, ignoring this one.
10-31 21:51:27.832 25239-27688/ch.masshardt.idbrowser W/OMXNodeInstance: [1:google.h264.decoder] component does not support metadata mode; using fallback
10-31 21:51:27.832 25239-27688/ch.masshardt.idbrowser E/ACodec: [OMX.google.h264.decoder] storeMetaDataInBuffers failed w/ err -1010
10-31 21:51:27.841 25239-27691/ch.masshardt.idbrowser I/OMXClient: Using client-side OMX mux.
10-31 21:51:27.846 25239-27691/ch.masshardt.idbrowser I/omx_core: OMX_Init 66 gInitCount=2
10-31 21:51:27.846 25239-27691/ch.masshardt.idbrowser E/OMXMaster: A component of name 'OMX.google.h264.decoder' already exists, ignoring this one.
10-31 21:51:27.847 25239-27691/ch.masshardt.idbrowser E/OMXMaster: A component of name 'OMX.google.alac.decoder' already exists, ignoring this one.
10-31 21:51:27.856 25239-27692/ch.masshardt.idbrowser I/SoftAAC2: limiting to stereo output
10-31 21:51:28.132 25239-27692/ch.masshardt.idbrowser I/SoftAAC2: Reconfiguring decoder: 0->48000 Hz, 0->2 channels
10-31 21:51:28.151 25239-27632/ch.masshardt.idbrowser I/AudioTrack: set(): 0xab971060 streamType -1, sampleRate 48000, format 0x1, channelMask 0x3, frameCount 16384, flags #0, 

And here is my media_codecs.xml. (not modified)

<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (C) 2012 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!--
<!DOCTYPE MediaCodecs [
<!ELEMENT MediaCodecs (Decoders,Encoders)>
<!ELEMENT Decoders (MediaCodec*)>
<!ELEMENT Encoders (MediaCodec*)>
<!ELEMENT MediaCodec (Type*,Quirk*)>
<!ATTLIST MediaCodec name CDATA #REQUIRED>
<!ATTLIST MediaCodec type CDATA>
<!ELEMENT Type EMPTY>
<!ATTLIST Type name CDATA #REQUIRED>
<!ELEMENT Quirk EMPTY>
<!ATTLIST Quirk name CDATA #REQUIRED>
]>

There's a simple and a complex syntax to declare the availability of a
media codec:

A codec that properly follows the OpenMax spec and therefore doesn't have any
quirks and that only supports a single content type can be declared like so:

    <MediaCodec name="OMX.foo.bar" type="something/interesting" />

If a codec has quirks OR supports multiple content types, the following syntax
can be used:

    <MediaCodec name="OMX.foo.bar" >
        <Type name="something/interesting" />
        <Type name="something/else" />
        ...
        <Quirk name="requires-allocate-on-input-ports" />
        <Quirk name="requires-allocate-on-output-ports" />
        <Quirk name="output-buffers-are-unreadable" />
    </MediaCodec>

Only the three quirks included above are recognized at this point:

"requires-allocate-on-input-ports"
    must be advertised if the component does not properly support specification
    of input buffers using the OMX_UseBuffer(...) API but instead requires
    OMX_AllocateBuffer to be used.

"requires-allocate-on-output-ports"
    must be advertised if the component does not properly support specification
    of output buffers using the OMX_UseBuffer(...) API but instead requires
    OMX_AllocateBuffer to be used.

"output-buffers-are-unreadable"
    must be advertised if the emitted output buffers of a decoder component
    are not readable, i.e. use a custom format even though abusing one of
    the official OMX colorspace constants.
    Clients of such decoders will not be able to access the decoded data,
    naturally making the component much less useful. The only use for
    a component with this quirk is to render the output to the screen.
    Audio decoders MUST NOT advertise this quirk.
    Video decoders that advertise this quirk must be accompanied by a
    corresponding color space converter for thumbnail extraction,
    matching surfaceflinger support that can render the custom format to
    a texture and possibly other code, so just DON'T USE THIS QUIRK.

-->

<MediaCodecs>
    <Decoders>
        <MediaCodec name="OMX.amlogic.hevc.decoder.awesome" type="video/hevc" >
            <Limit name="size" min="64x64" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
    <MediaCodec name="OMX.amlogic.hevc.decoder.awesome.secure" type="video/hevc" >
        <Limit name="size" min="64x64" max="3840x2160" />
        <Limit name="alignment" value="2x2" />
        <Limit name="block-size" value="16x16" />
        <Limit name="blocks-per-second" min="1" max="972000" />
        <Limit name="bitrate" range="1-300000000" />
        <Feature name="adaptive-playback" />
        <Feature name="secure-playback" required="true" />
    </MediaCodec>
        <MediaCodec name="OMX.amlogic.avc.decoder.awesome" type="video/avc" >
            <Limit name="size" min="64x64" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
    <MediaCodec name="OMX.amlogic.avc.decoder.awesome.secure" type="video/avc" >
        <Limit name="size" min="64x64" max="3840x2160" />
        <Limit name="alignment" value="2x2" />
        <Limit name="block-size" value="16x16" />
        <Limit name="blocks-per-second" min="1" max="972000" />
        <Limit name="bitrate" range="1-300000000" />
        <Feature name="adaptive-playback" />
        <Feature name="secure-playback" required="true" />
    </MediaCodec>
        <MediaCodec name="OMX.amlogic.mpeg4.decoder.awesome" type="video/mp4v-es" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
        <MediaCodec name="OMX.amlogic.h263.decoder.awesome" type="video/3gpp" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
        <MediaCodec name="OMX.amlogic.mpeg2.decoder.awesome" type="video/mpeg2" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
        <MediaCodec name="OMX.amlogic.vc1.decoder.awesome" type="video/vc1" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
        <MediaCodec name="OMX.amlogic.vc1.decoder.awesome" type="video/wvc1" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
        <MediaCodec name="OMX.amlogic.wmv3.decoder.awesome" type="video/wmv3" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
        <MediaCodec name="OMX.amlogic.mjpeg.decoder.awesome" type="video/mjpeg" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-300000000" />
            <Feature name="adaptive-playback" />
        </MediaCodec>
        <MediaCodec name="OMX.google.amrnb.decoder" type="audio/3gpp" />
        <MediaCodec name="OMX.google.amrwb.decoder" type="audio/amr-wb" />
        <MediaCodec name="OMX.google.aac.decoder" type="audio/mp4a-latm" />
        <MediaCodec name="OMX.google.adif.decoder" type="audio/aac-adif" />
        <MediaCodec name="OMX.google.latm.decoder" type="audio/aac-latm" />
        <MediaCodec name="OMX.google.adts.decoder" type="audio/adts" />
        <MediaCodec name="OMX.google.g711.alaw.decoder" type="audio/g711-alaw" />
        <MediaCodec name="OMX.google.g711.mlaw.decoder" type="audio/g711-mlaw" />
        <MediaCodec name="OMX.google.adpcm.ima.decoder" type="audio/adpcm-ima" />
        <MediaCodec name="OMX.google.adpcm.ms.decoder" type="audio/adpcm-ms" />
        <MediaCodec name="OMX.google.vorbis.decoder" type="audio/vorbis" />
        <MediaCodec name="OMX.google.alac.decoder" type="audio/alac" />
        <MediaCodec name="OMX.google.wma.decoder" type="audio/wma" />
        <MediaCodec name="OMX.google.wmapro.decoder" type="audio/wmapro" />
        <MediaCodec name="OMX.google.ape.decoder" type="audio/ape" />
        <MediaCodec name="OMX.google.truehd.decoder" type="audio/truehd" />
        <MediaCodec name="OMX.google.ffmpeg.decoder" type="audio/ffmpeg" />
        <MediaCodec name="OMX.google.raw.decoder" type="audio/raw" />

        <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" />
        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" />
        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" />
        <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" />
        <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" />
        <MediaCodec name="OMX.google.vp6.decoder" type="video/x-vnd.on2.vp6" />
        <MediaCodec name="OMX.google.vp6a.decoder" type="video/x-vnd.on2.vp6a" />
        <MediaCodec name="OMX.google.vp6f.decoder" type="video/x-vnd.on2.vp6f" />
        <MediaCodec name="OMX.google.rm.decoder" type="video/rm" />
        <MediaCodec name="OMX.google.wmv2.decoder" type="video/wmv2" />
        <MediaCodec name="OMX.google.wmv1.decoder" type="video/wmv1" />
        <!-- DOLBY_UDC -->
        <MediaCodec name="AML.google.ac3.decoder" >
            <Type name="audio/ac3" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>
        <MediaCodec name="AML.google.ec3.decoder" >
            <Type  name="audio/eac3" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>
        <!-- DOLBY_UDC END -->

        <MediaCodec name="OMX.google.mp2.decoder" >
            <Type  name="audio/mpeg-L2" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>

        <MediaCodec name="OMX.google.mp3.decoder" >
            <Type  name="audio/mpeg" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>

        <MediaCodec name="AML.google.dtshd.decoder" >
            <Type  name="audio/dtshd" />
            <Quirk name="needs-flush-before-disable" />
            <Quirk name="requires-flush-complete-emulation" />
        </MediaCodec>
    </Decoders>

    <Encoders>
        <MediaCodec name="OMX.google.amrnb.encoder" type="audio/3gpp" />
        <MediaCodec name="OMX.google.amrwb.encoder" type="audio/amr-wb" />
        <MediaCodec name="OMX.google.aac.encoder" type="audio/mp4a-latm" />
        <MediaCodec name="OMX.google.flac.encoder" type="audio/flac" />

        <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" />
        <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" />
        <MediaCodec name="OMX.amlogic.video.encoder.avc" type="video/avc" >
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="16x16" />
        </MediaCodec>
        <MediaCodec name="OMX.google.h264.encoder" type="video/avc" />
        <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" />
    </Encoders>
</MediaCodecs>

And here my media_profiles.xml. (Also not modified)

<MediaSettings>

    <!-- Each camcorder profile defines a set of predefined configuration parameters -->
    <CamcorderProfiles cameraId="0" startOffsetMs="50">

        <EncoderProfile quality="720p" fileFormat="3gp" duration="60">
            <Video codec="h264"
            bitRate="6000000"
            width="1280"
            height="720"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse720p" fileFormat="3gp" duration="60">
            <Video codec="h264"
            bitRate="6000000"
            width="1280"
            height="720"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="480p" fileFormat="3gp" duration="60">
            <Video codec="h264"
            bitRate="6000000"
            width="640"
            height="480"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse480p" fileFormat="3gp" duration="60">
            <Video codec="h264"
            bitRate="6000000"
            width="640"
            height="480"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="cif" fileFormat="3gp" duration="30">
            <Video codec="h264"
            bitRate="1440000"
            width="352"
            height="288"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapsecif" fileFormat="3gp" duration="30">
            <Video codec="h264"
            bitRate="1440000"
            width="352"
            height="288"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <ImageEncoding quality="70" />
        <ImageEncoding quality="80" />
        <ImageEncoding quality="90" />

    </CamcorderProfiles>

    <CamcorderProfiles cameraId="1" startOffsetMs="50">

        <EncoderProfile quality="720p" fileFormat="3gp" duration="60">
            <Video codec="h264"
            bitRate="6000000"
            width="1280"
            height="720"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse720p" fileFormat="3gp" duration="60">
            <Video codec="h264"
            bitRate="6000000"
            width="1280"
            height="720"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="480p" fileFormat="3gp" duration="60">
            <Video codec="h264"
            bitRate="6000000"
            width="640"
            height="480"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse480p" fileFormat="3gp" duration="60">
            <Video codec="h264"
            bitRate="6000000"
            width="640"
            height="480"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="cif" fileFormat="3gp" duration="30">
            <Video codec="h264"
            bitRate="1440000"
            width="352"
            height="288"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapsecif" fileFormat="3gp" duration="30">
            <Video codec="h264"
            bitRate="1440000"
            width="352"
            height="288"
            frameRate="30" />

            <Audio codec="amrwb"
            bitRate="23050"
            sampleRate="16000"
            channels="1" />
        </EncoderProfile>

        <ImageEncoding quality="70" />
        <ImageEncoding quality="80" />
        <ImageEncoding quality="90" />

    </CamcorderProfiles>

    <EncoderOutputFileFormat name="3gp" />
    <EncoderOutputFileFormat name="mp4" />

    <VideoDecoderCap name="wmv" enabled="true" />
    <AudioDecoderCap name="wma" enabled="true" />

    <VideoEncoderCap name="h263" enabled="true"
        minBitRate="192000" maxBitRate="420000"
        minFrameWidth="176" maxFrameWidth="352"
        minFrameHeight="144" maxFrameHeight="288"
        minFrameRate="1" maxFrameRate="20" />

    <VideoEncoderCap name="h264" enabled="true"
        minBitRate="192000" maxBitRate="6000000"
        minFrameWidth="176" maxFrameWidth="1280"
        minFrameHeight="144" maxFrameHeight="720"
        minFrameRate="5" maxFrameRate="30" />

    <VideoEncoderCap name="m4v" enabled="true"
        minBitRate="192000" maxBitRate="1440000"
        minFrameWidth="176" maxFrameWidth="640"
        minFrameHeight="144" maxFrameHeight="480"
        minFrameRate="1" maxFrameRate="15" />

    <AudioEncoderCap name="amrwb" enabled="true"
        minBitRate="6600" maxBitRate="23050"
        minSampleRate="16000" maxSampleRate="16000"
        minChannels="1" maxChannels="1" />

    <AudioEncoderCap name="aac" enabled="true"
        minBitRate="758" maxBitRate="288000"
        minSampleRate="8000" maxSampleRate="48000"
        minChannels="1" maxChannels="1" />

    <AudioEncoderCap name="heaac" enabled="true"
        minBitRate="8000" maxBitRate="64000"
        minSampleRate="16000" maxSampleRate="48000"
        minChannels="1" maxChannels="1" />

    <AudioEncoderCap name="aaceld" enabled="true"
        minBitRate="16000" maxBitRate="192000"
        minSampleRate="16000" maxSampleRate="48000"
        minChannels="1" maxChannels="1" />

    <AudioEncoderCap name="amrwb" enabled="true"
        minBitRate="6600" maxBitRate="23050"
        minSampleRate="16000" maxSampleRate="16000"
        minChannels="1" maxChannels="1" />

    <AudioEncoderCap name="amrnb" enabled="true"
        minBitRate="4750" maxBitRate="12200"
        minSampleRate="8000" maxSampleRate="8000"
        minChannels="1" maxChannels="1" />
</MediaSettings>

Is there any solution to this problem? By the way, with ExoPlayer playback of these videos worked fine.

andrewlewis commented 8 years ago

@TheNetStriker "By the way, with ExoPlayer playback of these videos worked fine." suggests that the video plays okay but you also say "The device only renders the first image of any video". Please could you clarify under what circumstances playback worked?

To investigate issues like this, it would be useful to have the information requested in the issue template, especially the output of adb bugreport and a link to the problematic stream. You can also try playing it with the platform MediaPlayer (assuming the stream type is supported): adb shell am start -a android.intent.action.VIEW -d "<url>" -t "video/*" and, as a last resort, forcing using another codec by disabling the apparently broken one (see MediaCodecUtil.isCodecUsableDecoder).

TheNetStriker commented 8 years ago

Sorry, I actually wanted to write "By the way, with ExoPlayer V1 playback of these videos worked fine." With V1 I was able to play my stream. Since I updated to V2 I get this error.

I can't give you the stream because it's an internal streaming server, but It's just a simple http stream. The video container is mp4, the video codec isH.264 MPEG-4 AVC and the audio codec is AAC.

The Wetek device only supports plain text bugreport. The file is very big (6MB) so I uploaded it to my Dropbox: Link

What could be the problem here?