ACodec call to OMX_GetExtensionIndex fails, during playback of an m3u8 file - android

This is somewhat a follow-up to question:
m3u8 file not playing in Android Emulator
I have a very similar issue to the one asked over there, but with a real device where JB has been ported to (project details at: http://groups.google.com/group/renesas-emev-osp/topics):
V/MediaPlayerJNI( 1064): setDataSource: path http://rai-i.akamaihd.net/i/20140610/tg1notte-100620141.00.00_REPLAY_,400,600,800,.mp4.csmil/master.m3u8
V/MediaPlayer( 1064): setDataSource(http://rai-i.akamaihd.net/i/20140610/tg1notte-100620141.00.00_REPLAY_,400,600,800,.mp4.csmil/master.m3u8)
V/MediaPlayer( 1064): setVideoSurfaceTexture
V/MediaPlayerJNI( 1064): setAudioStreamType: 3
...
D/MediaPlayer( 1064): getMetadata
E/MediaPlayerService( 74): getMetadata failed -38
V/MediaPlayerJNI( 1064): start
V/MediaPlayer( 1064): start
...
V/MediaPlayer( 1064): start
I/avc_utils( 74): found AVC codec config (700 x 394, Main-profile level 3.1)
V/ACodec ( 74): Now uninitialized
V/ACodec ( 74): onAllocateComponent
I/ESQueue ( 74): found AAC codec config (44100 Hz, 2 channels)
I/EV2OMXPlugin( 74): ***run OMFPlugin ------- makeComponentInstance !!!!!!!!
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] Now Loaded
V/ACodec ( 74): onConfigureComponent - msg: AMessage(what = 'setu', target = 14) = {
V/ACodec ( 74): string mime = "video/avc"
V/ACodec ( 74): int32_t width = 700
V/ACodec ( 74): int32_t height = 394
V/ACodec ( 74): ABuffer *csd-0 = 0x2a06af40
V/ACodec ( 74): ABuffer *csd-1 = 0x2a0722b0
V/ACodec ( 74): RefBase *native-window = 0x2a026e88
V/ACodec ( 74): }
V/ACodec ( 74): initNativeWindow
E/OMXNodeInstance( 74): OMX_GetExtensionIndex (index:'7fffffff') failed
F/ACodec ( 74): frameworks/av/media/libstagefright/ACodec.cpp:3107 CHECK_EQ( (status_t)OK,mCodec->initNativeWindow()) failed: 0 vs. -2147483648
F/libc ( 74): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 1490 (NuPlayerDecoder)
...
As for the emulator case above, the OMX_GetExtensionIndex call fails, as the vendor OMX implementation doesn't include the NativeBuffer-related functions:
https://github.com/Renesas-EMEV2/Renesas-device_emev/blob/emev-4.1/omf/OMF_Extension.h
In the OMXCodec (used by the AwesomePlayer to succesfully play mp4 files) initNativeWindow() isn't invoked at all (as per debug logs I've captured).
Also, our JB porting included this additional check for componentName, in the OMXCodec creation:
OMXCodec::OMXCodec(
const sp<IOMX> &omx, IOMX::node_id node,
uint32_t quirks, uint32_t flags,
bool isEncoder,
const char *mime,
const char *componentName,
const sp<MediaSource> &source,
const sp<ANativeWindow> &nativeWindow)
: mOMX(omx),
...
mNativeWindow(
(!strncmp(componentName, "OMX.google.", 11)
|| !strncmp(componentName, "OMX.RENESAS.", 12)
|| !strcmp(componentName, "OMX.Nvidia.mpeg2v.decode"))
? NULL : nativeWindow) {
...
So, looks like mNativeWindow is nullified in our case (OMX.RENESAS.) and that makes a bunch of logic being skipped, including initNativeWindow of course.
Adding this same check, not to call the InitNativeWindow logic, in ACodec::onConfgureComponent:
if (msg->findObject("native-window", &obj)
&& strncmp("OMX.google.", mCodec->mComponentName.c_str(), 11)
&& strncmp("OMX.RENESAS.", mCodec->mComponentName.c_str(), 12)) {
...
CHECK_EQ((status_t)OK, mCodec->initNativeWindow());
}
NuPlayer isn't crashing anymore on the m3u8 playback, but screen remains black on m3u8 playback, while audio goes on!
Comparing logs from the OMXCodec (mp4 - OK) vs ACodec (m3u8 - black outout) I can see similar calls repeating:
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] allocating 2 buffers of size 1048576 on input port
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] allocated buffer 0x2a04b020 on input port
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] allocated buffer 0x2a065ca8 on input port
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] allocating 5 buffers of size 3133440 on output port
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] allocated buffer 0x2a065dd0 on output port
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] allocated buffer 0x2a061de0 on output port
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] allocated buffer 0x2a061ec0 on output port
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] allocated buffer 0x2a061fc0 on output port
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] allocated buffer 0x2a0620a0 on output port
...
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] EMPTY_BUFFER_DONE(buffer: 0x2a04b020)
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] Calling emptyBuffer on buffer 0x2a04b020 (length 18339), timestamp 40000 us (0.04
...
V/OMXCodec( 74): [OMX.RENESAS.VIDEO.DECODER.H264] FILL_BUFFER_DONE(buffer: 0x2a065dd0, size: 449280, flags: 0x00000010, timestamp: 40000 us (0.04 secs))
...
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] Now Loaded->Idle
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] Allocating 2 buffers of size 1048576 on input port
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] Allocating 5 buffers of size 3133440 on output port
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] Now Idle->Executing
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling fillBuffer 0x2a068970
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling fillBuffer 0x2a056fd0
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling fillBuffer 0x2a0570e8
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling fillBuffer 0x2a057228
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling fillBuffer 0x2a0572f8
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] Now Executing
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling emptyBuffer 0x2a054898 w/ codec specific data
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] onOMXEmptyBufferDone 0x2a054898
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling emptyBuffer 0x2a03cb88 w/ codec specific data
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling emptyBuffer 0x2a054898 w/ time 0 us
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] onOMXEmptyBufferDone 0x2a03cb88
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] onOMXEmptyBufferDone 0x2a054898
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling emptyBuffer 0x2a03cb88 w/ time 40000 us
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] onOMXEmptyBufferDone 0x2a03cb88
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling emptyBuffer 0x2a054898 w/ time 80000 us
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] calling emptyBuffer 0x2a03cb88 w/ time 120000 us
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] onOMXFillBufferDone 0x2a068970 time 0 us, flags = 0x00000010
...
but looks like something else is still missing...
Any suggestion?

Related

Flutter, video_player I/ACodec codec does not support config priority (err -2147483648)

The videos are mp4. All other videos work fine, but weirdly, only certain videos come out this way.
I/ACodec (27533): codec does not support config priority (err -2147483648)
I was offered to change the audio codec while searching.
I tried encoding it with AAC, AC3, and MPEG but couldn't solve it. (I tried with each file)
It's really weird. The audio is a bit stuttering. It doesn't sound very annoying, but it certainly seems to be a bit cut off.
Does anyone know how to do this? Any advice would be appreciated. thank you.
I/ExoPlayerImpl( 8291): Init 6c53ea1 [ExoPlayerLib/2.12.1] [generic_x86_64, Android SDK built for x86_64, unknown, 24]
D/MetadataUtil( 8291): Skipped unknown metadata entry: ������
I/art ( 8291): Do partial code cache collection, code=25KB, data=24KB
I/art ( 8291): After code cache collection, code=23KB, data=23KB
I/art ( 8291): Increasing code cache capacity to 128KB
I/VideoCapabilities( 8291): Unsupported profile 4 for video/mp4v-es
I/OMXClient( 8291): MuxOMX ctor
I/MediaCodec( 8291): [OMX.google.h264.decoder] setting surface generation to 8489985
E/ACodec ( 8291): [OMX.google.h264.decoder] storeMetaDataInBuffers failed w/ err -1010
I/ACodec ( 8291): codec does not support config priority (err -2147483648)
I/ACodec ( 8291): codec does not support config operating rate (err -2147483648)
I/OMXClient( 8291): MuxOMX ctor
I/ACodec ( 8291): codec does not support config priority (err -2147483648)
D/AudioTrack( 8291): Client defaulted notificationFrames to 3675 for frameCount 11025
D/MediaCodec( 8291): [OMX.google.h264.decoder] setting dataspace on output surface to #104
D/ ( 8291): HostConnection::get() New Host Connection established 0x77a6caeb31c0, tid 8420
D/SoftwareRenderer( 8291): setting dataspace on output surface to #104
I/art ( 8291): Do partial code cache collection, code=61KB, data=59KB
I/art ( 8291): After code cache collection, code=58KB, data=57KB
I/art ( 8291): Increasing code cache capacity to 256KB

OMXCodec die when start decoding

I'd like to retrieve frames from video file.
My code followed the article Use Android Hardware Decoder with OMXCodec in NDK, and also referred the code of AwesomePlayer.cpp(AOSP) and libstagefright.cpp(ffmpeg). But it still hangs whenever OMXCodec start decoding. I have no idea what the problem is.
I'd grateful for any help.
the code:
int main(int argc, char *argv[])
{
OMXClient mClient;
status_t ret = mClient.connect();
LOGD("connect status is %d\n", ret);
sp<DataSource> mDs = DataSource::CreateFromURI("file:///sdcard/display/lwtwjod.mp4");
off64_t size = 0;
ret = mDs->getSize(&size);
LOGD("getSize[ret=%d]: %lld\n", ret, size);
sp<MediaExtractor> mMe = MediaExtractor::Create(mDs);
size_t tracksNum = mMe->countTracks();
LOGD("%u tracks\n", tracksNum);
sp<MediaSource> mMs;
bool hasVideo = false;
for(size_t i = 0; i != mMe->countTracks(); i++){
sp<MetaData> mMd_track = mMe->getTrackMetaData(i);
const char *_mime;
mMd_track->findCString(kKeyMIMEType, &_mime);
LOGD("the mime is %s\n", _mime);
String8 mime = String8(_mime);
if (!strncasecmp(mime.string(), "video/", 6)) {
LOGD("find video track!\n");
hasVideo = true;
mMs = mMe->getTrack(i);
int wid, hei;
mMd_track->findInt32(kKeyWidth, &wid);
mMd_track->findInt32(kKeyHeight, &hei);
LOGD("width: %d, height: %d\n", wid, hei);
break;
}
}
if(hasVideo){
sp<MediaSource> decoder =
OMXCodec::Create(mClient.interface(), mMs->getFormat(),
false, mMs,
NULL, OMXCodec::kClientNeedsFramebuffer);
LOGD("start decoding..\n");
ret = decoder->start(); // hangs here
LOGD("decoding return: %d\n", ret);
for(;;){
MediaBuffer *buffer;
buffer = NULL;
ret = decoder->read(&buffer);
LOGD("read decoded buffer result: %d\n", ret);
break;
}
}
}
The logcat output:
I/OMXClient( 5470): Using client-side OMX mux.
D/NativeCodec( 5470): connect status is 0
D/NativeCodec( 5470): getSize[ret=0]: 165748860
D/NativeCodec( 5470): 2 tracks
D/NativeCodec( 5470): the mime is video/avc
D/NativeCodec( 5470): find video track!
D/OMXCodec( 5470): Successfully allocated OMX node 'OMX.qcom.video.decoder.avc'
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] AVC profile = 100 (High), level = 31
E/OMX-VDEC-1080P( 197):
E/OMX-VDEC-1080P( 197): No color conversion required
E/OMX-VDEC-1080P( 197):
E/OMX-VDEC-1080P( 197): No color conversion required
E/OMX-VDEC-1080P( 197):
E/OMX-VDEC-1080P( 197): No color conversion required
E/OMX-VDEC-1080P( 197):
E/OMX-VDEC-1080P( 197): No color conversion required
E/OMX-VDEC-1080P( 197):
E/OMX-VDEC-1080P( 197): No color conversion required
E/OMX-VDEC-1080P( 197):
E/OMX-VDEC-1080P( 197): No color conversion required
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] video dimensions are 1280 x 720
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] Crop rect is 1280 x 720 # (0, 0)
D/NativeCodec( 5470): start decoding..
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocating 2 buffers of size 2097152 on input port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8e39390 on input port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8e393e0 on input port
E/OMX-VDEC-1080P( 197):
E/OMX-VDEC-1080P( 197): No color conversion required
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocating 15 buffers of size 1433600 on output port
E/OMX-VDEC-1080P( 197): GET_MV_BUFFER_SIZE returned: Size: 245760 and alignment: 8192
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9b08 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9b58 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9ba8 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9bf8 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9c48 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9c98 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9ce8 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9d38 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9d88 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9dd8 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9e28 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9e78 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9ec8 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9f18 on output port
I/OMXCodec( 5470): [OMX.qcom.video.decoder.avc] allocated buffer 0xb8eb9f68 on output port
E/OMXNodeInstance( 197): !!! Observer died. Quickly, do something, ... anything...
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9f68 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9f18 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9ec8 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9e78 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9e28 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9dd8 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9d88 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9d38 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9ce8 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9c98 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9c48 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9bf8 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9ba8 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9b58 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8eb9b08 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8e393e0 successful
I/OMXNodeInstance( 197): OMX_FreeBuffer for buffer header 0xb8e39390 successful
E/OMX-VDEC-1080P( 197):
E/OMX-VDEC-1080P( 197): Error in ioctl read next msg
E/ ( 197):
E/ ( 197): Destroy C2D instance
E/ ( 197):
E/ ( 197): Destroy C2D instance

m3u8 file not playing in Android Emulator

I am trying to playback a m3u8 file in Android Emulator.
http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
It's not able to playback the video but audio is heard.
I get the following error E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed.
I traced the calls and I see that the video decoder is not instantiated properly,
I find that OMXNodeInstance::enableGraphicBuffers is getting called and that calls,
OMX_ERRORTYPE err = OMX_GetExtensionIndex(...,const_cast<OMX_STRING>("OMX.google.android.index.enableAndroidNativeBuffers"),...);
which is then calling OMX_ERRORTYPE SoftOMXComponent::getExtensionIndex,
but there is no implementation for this function.
It just returns UndefinedError (code below)
OMX_ERRORTYPE SoftOMXComponent::getExtensionIndex(const char *name, OMX_INDEXTYPE *index)
{
return OMX_ErrorUndefined;
}
Can somebody please help me to overcome this GetExtentionIndex failure.
Log Below
/ChromiumHTTPDataSource( 39): connect to http://devimages.apple.com/iphone/samples/bipbop/gear4/prog_index.m3u8 #0
V/NuPlayer( 39): scanning sources haveAudio=0, haveVideo=0
V/NuPlayer( 39): in instantiateDecoder at 693 audio = 0
V/NuPlayer( 39): in instantiateDecoder at 693 audio = 1
I/ESQueue ( 39): found AAC codec config (22050 Hz, 1 channels)
I/avc_utils( 39): found AVC codec config (192 x 144, Baseline-profile level 1.1)
V/MediaPlayer( 583): in getCurrentPosition at : 425
V/MediaPlayerService( 39): getCurrentPosition
V/MediaPlayerService( 39): [1] getCurrentPosition = 0
V/NuPlayer( 39): scanning sources haveAudio=0, haveVideo=0
V/NuPlayer( 39): in instantiateDecoder at 701 mime = video/avc
V/ACodec ( 39): Now uninitialized
V/ACodec ( 39): Now uninitialized
V/ACodec ( 39): onAllocateComponent
I/MediaPlayerService( 39): MediaPlayerService::getOMX()
V/SoftOMXPlugin( 39): makeComponentInstance 'OMX.google.h264.decoder'
V/SoftOMXPlugin( 39): makeComponentInstance at 106
V/ACodec ( 39): onAllocateComponent
I/MediaPlayerService( 39): MediaPlayerService::getOMX()
V/SoftOMXPlugin( 39): makeComponentInstance at 128
V/SoftOMXPlugin( 39): makeComponentInstance 'OMX.google.aac.decoder'
V/SoftOMXPlugin( 39): makeComponentInstance at 106
V/SoftOMXPlugin( 39): makeComponentInstance at 128
V/ACodec ( 39): [OMX.google.h264.decoder] Now Loaded
V/ACodec ( 39): onConfigureComponent
V/ACodec ( 39): configureCodec at 870
V/ACodec ( 39): setupVideoDecoder at 1400
V/ACodec ( 39): setupVideoDecoder at 1402 mime = video/avc
V/ACodec ( 39): setupVideoDecoder at 1406
V/ACodec ( 39): setupVideoDecoder at 1414
V/ACodec ( 39): setupVideoDecoder at 1421
V/ACodec ( 39): setupVideoDecoder at 1429
V/ACodec ( 39): setupVideoDecoder at 1437
V/ACodec ( 39): initNativeWindow at 1962
V/ACodec ( 39): initNativeWindow at 1967
E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed
V/OMXNodeInstance( 39): enableGraphicBuffers at 301 OMX_GetExtensionIndex returned 2147487745
V/ACodec ( 39): onStart
V/ACodec ( 39): [OMX.google.h264.decoder] Now Loaded->Idle
Try to run it in real device, as I know emulators with some specific sdk's(like 3.1) crash playing m3u8 file. And if didn't resolve the issue maybe you can use some 3rd paty plugins like Vitamio http://vitamio.org/
This is a very interesting question. From your logs, I would like to quote this portion
E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed
V/OMXNodeInstance( 39): enableGraphicBuffers at 301 OMX_GetExtensionIndex returned 2147487745
These 2 error messages are received during initNativeWindow call of the ACodec as part of it's transition from LOADED to IDLE state. From an OMX perspective, as part of the LOADED to IDLE transition, ACodec::LoadedState::onConfigureComponent is invoked. As part of this function, initNativeWindow is invoked.
In initNativeWindow, there are two distinct conditions. The first case is when the user has provided a nativeWindow or rather a Surface or SurfaceTexture to the codec to write it's output into. The other case is when the user hasn't provided a Surface to the MediaPlayer engine.
V/ACodec ( 39): onStart
V/ACodec ( 39): [OMX.google.h264.decoder] Now Loaded->Idle
From these logs, it can be observed that the return code of initNativeWindow is ok which is only possible if the control branched to the case where mNativeNativeWindow is NULL as observed here. The return code for the false case is not caught by the ACodec which means that the component transitioned to IDLE state successfully.
In a nutshell, the issue is mainly arising due to a Surface not being provided to the MediaPlayer.
Some Suggestions:
Since you are employing NuPlayer, I would recommend you to check if NuPlayer::setVideoSurfaceTexture is called and whether a non-NULL object is passed from NuPlayer to downstream components.
From a MediaPlayer perspective, you should set a surface as part of the setSurface call.
In general, you need to provide a sink for the video decoder chain.
E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed
V/OMXNodeInstance( 39): enableGraphicBuffers at 301 OMX_GetExtensionIndex returned 2147487745
the call to OMX_GetExtensionIndex lands into SoftOMXComponent(here) which is just a stubbed function and always returns OMX_ErrorUndefined which leads to failing of enableGraphicBuffers

native_window_set_buffers_geometry failed

I am trying to develop a surveillance application in OMAP 4460(Blaze Tablet-in ICS) acting as client device rendering the surveillance feed from a remote source. To begin with, surveillance feed is streamed remotely from the camera and port forwarded as RTP packets which are received and rendered in OMAP 4460 through a customized RTP stack. While rendering, I am getting the following error from the decoder, saying that "Surface Texture has been abandoned and native_window _set_buffers_geometry failed", more frequently.
Following is the log captured:
E/AwesomePlayer( 131): AwesomePlayer::onPrepareAsyncEvent-------- err = 0
E/AwesomePlayer( 131): AwesomePlayer::onPrepareAsyncEvent-------- OK = -430191887
I/OMXCodec( 131): [OMX.TI.DUCATI1.VIDEO.DECODER] AVC profile = 66 (Baseline), level = 31
E/OMXCodec( 131): set buffer size variable to : 307200
I/OMXCodec( 131): [OMX.TI.DUCATI1.VIDEO.DECODER] video dimensions are 640 x 480
I/OMXCodec( 131): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 640 x 480 # (0, 0)
E/SurfaceTexture( 128): [SurfaceView] setCrop: SurfaceTexture has been abandoned!
E/SurfaceTextureClient( 131): ISurfaceTexture::setCrop(...) returned No such device
E/SurfaceTexture( 128): [SurfaceView] setLayout: SurfaceTexture has been abandoned!
E/SurfaceTexture( 128): [SurfaceView] setCrop: SurfaceTexture has been abandoned!
E/SurfaceTextureClient( 131): ISurfaceTexture::setCrop(...) returned No such device
E/OMXCodec( 131): native_window_set_buffers_geometry failed: No such device (19)
E/ion ( 131): ioctl -1073460991 failed with code -1: Bad file number
E/ion ( 131): ioctl -1073460991 failed with code -1: Bad file number
D/DOMX ( 131): hardware/ti/domx/domx/omx_proxy_common/src/omx_proxy_common.c:2208 PROXY_ComponentDeInit()
D/DOMX ( 131): ERROR: failed check:(eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore) - returning error: 0x80001011 - Error returned from OMX API in ducati
D/DOMX ( 131): hardware/ti/domx/omx_core/src/OMX_Core.c:396 OMX_FreeHandle()
D/DOMX ( 131): ERROR: Error From ComponentDeInit..
D/StackInterface( 131): AwesomePlayer::reset_l called ++
SDP of the camera:
v=0
o=StreamingServer 3331435948 1116907222000 IN IP4 192.168.1.102
s=h264.mp4
c=IN IP4 239.0.0.00;/1
t=0 0
a=control:*
m=video 0 RTP/AVP 96
a=control:trackID=0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0KAH9oCgPSbgIEAmBAAfQAAEZQve+Eg,aM48gA==
m=application 0 RTP/AVP 107
a=control:trackID=2
a=rtpmap:107 vnd.onvif.metadata/90000
I have been trying to fix this issue for sometime now, and could not able to find out the problem yet.
Kindly, reveal how to proceed further on the issue.
Regards,
Manoj
My English is not good.
Check SurfaceTexture pointer.
If you define sp<.....> in function, sp<.....> is abandoned with end of function.

Can't play mp4 video in my Android app

I very want to play mp4 video in my android app. I even wrote a bit of code for it:
String sourceUrl = "http://tvstream.cn.ru/storage/1kanal/20120530/"
+ "1kanal-20120530-01-14-00-20120530-03-16-00.mp4";
final VideoView videoView = (VideoView) findViewById(R.id.videoView);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
final MediaController mediaController = new MediaController(this);
mediaController.setMediaPlayer(videoView);
videoView.setMediaController(mediaController);
videoView.setVideoURI(Uri.parse(sourceUrl));
videoView.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
videoView.requestFocus();
videoView.start();
mediaController.show();
}
});
But nothing works :( When I launch my app in emulator (Android 2.3.3) I've got weird stacktrace with some common error codes:
After few hours off googling and experiments I decided to try to launch my app on real device and watch logcat:
D/test.tv.activity.PlayerActivity( 3428): Player source: http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 320x430
I/Launcher( 260): onWindowFocusChanged(false)
D/Launcher( 260): setWallpaperDimension() called
D/Launcher( 260): USE_NON_SCROLLABLE_IMAGE_WALLPAPER is true
I/ActivityManager( 163): Start proc org.reactivephone for broadcast org.reactivephone/ru.yandex.common.clid.ClidBroadcastReceiver: pid=3448 uid=10073 gids={1015, 3003}
I/ActivityManager( 163): No longer want com.sec.android.provider.badge (pid 2310): hidden #16
I/MediaPlayer( 3428): uri is:http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
I/MediaPlayer( 3428): path is null
D/MediaPlayer( 3428): Couldn't open file on client side, trying server side
D/Launcher( 260): It's image wallpaper. suggestDesiredDimensions(-1,-1)
I/ActivityManager( 163): Displayed test.tv/.activity.PlayerActivity: +943ms
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 320x430
W/dalvikvm( 3406): threadid=5: spin on suspend #1 threadid=22 (pcf=0)
W/dalvikvm( 3406): threadid=5: spin on suspend resolved in 1154 msec
W/SearchableInfo( 163): Invalid searchable metadata for org.reactivephone/.ui.RegionForm: Search label must be a resource reference.
I/ActivityManager( 163): Start proc com.google.android.googlequicksearchbox for broadcast com.google.android.googlequicksearchbox/.SourceUpdateReceiver: pid=3457 uid=10027 gids={3003}
I/WindowOrientationListener( 163): orientation 295.6932 gives new rotation = 2
I/OrientationDebug( 163): [pwm] in MyOrientationListener.onOrientationChanged() rotation=3 mFancyRotationAnimation=0 now call mWindowManager.setRotation()
I/OrientationDebug( 163): [wms] in setRotation() rotation=3 alwaysSendConfiguration=false animFlags=0
I/OrientationDebug( 163): [wms] in setRotation() now call setRotationUnchecked()
I/WindowManager( 163): Setting rotation to 3, animFlags=0
I/ActivityManager( 163): Config changed: { scale=1.0 imsi=250/1 loc=ru_RU touch=3 keys=1/1/2 nav=1/1 orien=2 layout=18 uiMode=17 seq=7}
D/PhoneApp( 241): updateProximitySensorMode: lock already released.
I/ActivityThread( 3457): Pub com.google.android.googlequicksearchbox.shortcuts: com.google.android.googlequicksearchbox.WebHistoryProvider
I/ActivityThread( 3457): Pub com.google.android.googlequicksearchbox.google: com.google.android.googlequicksearchbox.google.GoogleSuggestionProvider
I/ActivityManager( 163): No longer want com.sec.android.widgetapp.clockweather.clockwidget (pid 1214): hidden #16
D/Finsky ( 3406): [1] 2.run: Loaded library for account: [Y091GklnFtI4Ab1gmLOw-nJkJXQ]
D/Finsky ( 3406): [1] 2.run: Finished loading 1 libraries.
W/dalvikvm( 3406): VFY: unable to resolve instance field 78
D/DfeApi ( 3406): [1] DfeApiContext.getSmallestScreenWidthDp: smallestScreenWidthDp does not exist, using pre-ics hack.
E/QCvdec ( 95): Setparameter: unknown param 2130706451
W/TimedEventQueue( 95): Event 3 was not found in the queue, already cancelled?
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
W/QCvdec ( 95): ======================================================================
W/QCvdec ( 95): Open Max Statistics
W/QCvdec ( 95): ======================================================================
W/QCvdec ( 95): empty this buffer rate = NaN
W/QCvdec ( 95): empty this buffer total time = 0
W/QCvdec ( 95): empty this buffer count = 0
W/QCvdec ( 95): ======================================================================
D/test.tv.activity.PlayerActivity( 3428): Player source: http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 480x270
I/MediaPlayer( 3428): uri is:http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
I/MediaPlayer( 3428): path is null
D/MediaPlayer( 3428): Couldn't open file on client side, trying server side
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 480x270
D/WifiService( 163): [mPersistState] : On
D/BatteryService( 163): update start
D/BatteryService( 163): update start
D/BatteryService( 163): update start
E/QCvdec ( 95): Setparameter: unknown param 2130706451
I/VideoView( 3428): start()
D/WifiService( 163): [mPersistState] : On
D/WifiService( 163): [mPersistState] : On
D/WifiWatchdogService( 163): (android.server.ServerThread) wntk (1c:af:f7:2e:7f:c8) does not require the watchdog
E/QCvdec ( 95): Unsupported profile, level, or widht, height
E/QCvdec ( 95): Unsupported clip
E/QCvdec ( 95): Unsupported profile, level, or widht, height
E/QCvdec ( 95): Unsupported clip
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
E/QCvdec ( 95): Empty this buffer in Invalid State
E/OMXCodec( 95): [OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)
E/OMXCodec( 95): [OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)
E/OMXCodec( 95): read : mState[9] is wrong...
E/MediaPlayer( 3428): error (1, -2147483648)
E/OMXCodec( 95): [OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 335x270
I/VideoView( 3428): start()
E/MediaPlayer( 3428): start called in state 0
E/MediaPlayer( 3428): error (-38, 0)
E/MediaPlayer( 3428): Error (1,-2147483648)
D/VideoView( 3428): Error: 1,-2147483648
E/MediaPlayer( 3428): Error (-38,0)
D/VideoView( 3428): Error: -38,0
D/PowerManagerService( 163): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false
I/PowerManagerService( 163): Ulight 1->3|0
W/InputManagerService( 163): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#40873ab8
I/PowerManagerService( 163): Light Animator Finished curIntValue=141
D/Finsky ( 3406): [1] 5.onFinished: Installation state replication succeeded.
D/BatteryService( 163): update start
D/BatteryService( 163): update start
D/BatteryService( 163): update start
I try to find something about "OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)", but didn't find nothing interesting. About "Couldn't open file on client side, trying server side" problem stackoverflow has many answers, but no one helped.
When I launch this app on ICS (in emulator) I've got similar errors:
06-01 10:22:14.674: I/NuCachedSource2(37): ERROR_END_OF_STREAM
06-01 10:22:15.375: I/OMXCodec(37): [OMX.google.h264.decoder] AVC profile = 100 (High), level = 30
06-01 10:22:15.384: I/OMXCodec(37): [OMX.google.h264.decoder] video dimensions are 320 x 240
06-01 10:22:15.384: I/OMXCodec(37): [OMX.google.h264.decoder] Crop rect is 320 x 240 # (0, 0)
06-01 10:22:16.253: W/NetworkManagementSocketTagger(89): setKernelCountSet(10013, 0) failed with errno -2
06-01 10:22:16.374: I/Launcher(553): setLoadOnResume
06-01 10:22:16.584: D/MediaPlayer(602): getMetadata
06-01 10:22:16.614: I/NuCachedSource2(37): new range: offset= 0
06-01 10:22:16.694: I/ChromiumHTTPDataSource(37): connect to http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4 #0
06-01 10:22:16.834: E/SoftAVC(37): Decoder failed: -2
06-01 10:22:16.844: E/OMXCodec(37): [OMX.google.h264.decoder] ERROR(0x80001001, -1007)
06-01 10:22:16.884: D/AudioSink(37): bufferCount (4) is too small and increased to 12
As I know, Android supports playback of video decoded with h264 (http://developer.android.com/guide/appendix/media-formats.html). So, can anyone tell me what I do wrong.
Probably your file is using an unsupported profile, notice that official media formats page only lists Baseline Profile as supported for H.264 AVC.
Try transcoding the video specifying Baseline Profile as suggested in this stackoverflow question, i.e. if your container is MP4 run:
ffmpeg -i yourfile.mp4 -c:v libx264 -profile:v baseline -level 1 yourfile_BaselineProfile.mp4
If this works it's not a issue in your code, you just have to use supported formats.
Try this
File clip=new File(Environment.getExternalStorageDirectory(),
"test.mp4");
if (clip.exists()) {
video=(VideoView)findViewById(R.id.video);
video.setVideoPath(clip.getAbsolutePath());
ctlr=new MediaController(this);
ctlr.setMediaPlayer(video);
video.setMediaController(ctlr);
video.requestFocus();
video.start();
VideoView classes does not allow playing MP4 file format videos. Please go through this link for Android Media Formats. Try checking your video with Daroon Player

Categories

Resources