I am using the cordova media plugin to play an audio only HLS stream. The HLS stream will play in the chrome browser, as a video element, but not in the MediaPlayer class. Here is the output from my logcat:
07-14 21:19:04.905 780 1346 I MediaFocusControl: AudioFocus requestAudioFocus() from android.media.AudioManager#4bf937corg.apache.cordova.media.AudioHandler$1#269c405 req=1flags=0x0
07-14 21:19:04.905 197 5274 I LiveSession: onConnect http://<suppressed>
07-14 21:19:05.193 197 5274 I LiveSession: #### Starting Bandwidth Switch: -1 => 0
07-14 21:19:05.473 197 5275 I ESQueue : found AAC codec config (48000 Hz, 2 channels)
07-14 21:19:05.643 197 5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:05.789 197 5273 D NuPlayerDriver: notifyListener_l(0xb363dba0), (200, 802, 0)
07-14 21:19:05.789 2057 2076 W MediaPlayer: info/warning (802, 0)
07-14 21:19:05.789 2057 2171 D MediaPlayer: setSubtitleAnchor in MediaPlayer
07-14 21:19:05.924 197 5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:06.141 197 5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:06.194 197 5273 W NuPlayer: Unknown video size, reporting 0x0!
07-14 21:19:06.194 197 5273 D NuPlayerDriver: notifyListener_l(0xb363dba0), (5, 0, 0)
07-14 21:19:06.194 197 5273 D NuPlayerDriver: notifyListener_l(0xb363dba0), (200, 801, 0)
07-14 21:19:06.194 197 5273 D NuPlayerDriver: notifyListener_l(0xb363dba0), (1, 0, 0)
07-14 21:19:06.194 2057 2075 W MediaPlayer: info/warning (801, 0)
07-14 21:19:06.195 197 197 E MediaPlayerService: getDuration returned -2147483648
07-14 21:19:06.195 2057 2171 W MediaPlayer: Stream has no duration and is therefore not seekable.
07-14 21:19:06.195 2057 2171 E MediaPlayer: error (-2147483648, 0)
07-14 21:19:06.195 2057 2171 D AudioPlayer: Send a onStatus update for the new seek
07-14 21:19:06.196 2057 2171 E MediaPlayer: start called in state 0
07-14 21:19:06.196 2057 2171 E MediaPlayer: error (-38, 0)
07-14 21:19:06.196 2057 2171 E MediaPlayer: Attempt to call getDuration without a valid mediaplayer
07-14 21:19:06.196 2057 2171 E MediaPlayer: error (-38, 0)
07-14 21:19:06.197 2057 2171 E MediaPlayer: Error (-2147483648,0)
07-14 21:19:06.197 2057 2171 D AudioPlayer: on completion is calling stopped
07-14 21:19:06.197 2057 2171 E MediaPlayer: Error (-38,0)
07-14 21:19:06.197 2057 2171 D AudioPlayer: on completion is calling stopped
07-14 21:19:06.197 2057 2171 E MediaPlayer: Error (-38,0)
07-14 21:19:06.200 2057 2171 D AudioPlayer: on completion is calling stopped
07-14 21:19:06.495 197 5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:13.306 197 5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:13.651 197 5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:17.576 197 5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:24.198 197 5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
Playing an mp3 through the cordova media plugin will work. The specific stream endpoint I am trying to play can be found at http://api.badkitty.co/api/audio-stream/monstercat. That is not the stream itself, the location of the stream is got from there. I cannot change the m3u8 files coming out of the stream.
Related
I'm trying to play video from the URL. Everything seems fine in the first few minutes, but then it crashes and the message "Can't Play Video" occurs. My code:
videoView.setVisibility(View.VISIBLE);
videoView.setVideoPath(url);
videoView.setMediaController(mediaController);
videoView.seekTo(time);
videoView.start();
Logcat:
2020-04-03 22:02:29.572 25409-25409/com.modyf.anime_app W/InputTransport: Slow Input: 152ms so far, channel 'ClientState{7a1b727 uid 10348 pid 25409} (server)' publisher ~ publishKeyEvent: seq=1, deviceId=4, source=0x101, action=0x0, flags=0x8, keyCode=25, scanCode=114, metaState=0x0, repeatCount=0,downTime=101580658000000, eventTime=101580658000000
2020-04-03 22:03:54.751 25409-25421/com.modyf.anime_app W/MediaHTTPConnection: readAt 25214561 / 16799 => java.net.ProtocolException: unexpected end of stream
2020-04-03 22:05:11.419 25409-25421/com.modyf.anime_app W/MediaPlayerNative: info/warning (804, -1004)
2020-04-03 22:05:11.475 25409-25422/com.modyf.anime_app E/MediaPlayerNative: error (1, -1004)
2020-04-03 22:05:11.476 25409-25409/com.modyf.anime_app E/MediaPlayer: Error (1,-1004)
2020-04-03 22:05:11.476 25409-25409/com.modyf.anime_app D/VideoView: Error: 1,-1004
2020-04-03 22:05:11.604 25409-25439/com.modyf.anime_app W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:612>: EGL_BAD_ATTRIBUTE
2020-04-03 22:05:11.606 25409-25439/com.modyf.anime_app D/vndksupport: Loading /vendor/lib64/hw/gralloc.msm8937.so from current namespace instead of sphal namespace.
I am creating an app that access google map api to give location based services. I have nothing to do with the microphone still I am getting the following error in the logcat. As suggested by some websites I have already disabled my microphone and google app.I am a new user to android please,help.
ServiceManager: Permission failure: android.permission.RECORD_AUDIO from uid=10030 pid=-1
[ 03-23 05:42:02.309 1574: 6149 E/ ]
Request requires android.permission.RECORD_AUDIO
03-23 05:42:02.309 1574-6149/? E/AudioFlinger: openRecord() permission denied: recording not allowed
03-23 05:42:02.309 6661-7408/com.google.android.googlequicksearchbox:search E/AudioRecord: AudioFlinger could not create record track, status: -1
03-23 05:42:02.313 6661-7408/com.google.android.googlequicksearchbox:search E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -1.
03-23 05:42:02.313 6661-7408/com.google.android.googlequicksearchbox:search E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
03-23 05:42:02.313 6661-7408/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_started com.google.android.apps.gsa.staticplugins.aa.c#844b56e
03-23 05:42:02.316 6661-6661/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: onReady
03-23 05:42:02.320 6661-7408/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_close com.google.android.apps.gsa.staticplugins.aa.c#844b56e
03-23 05:42:02.322 6661-6733/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Detection finished
03-23 05:42:02.322 6661-6733/com.google.android.googlequicksearchbox:search W/ErrorReporter: reportError [type: 211, code: 524300]: Error reading from input stream
03-23 05:42:02.323 6661-6732/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Stopping hotword detection.
03-23 05:42:02.323 6661-6733/com.google.android.googlequicksearchbox:search W/ErrorProcessor: onFatalError, processing error from engine(4)
com.google.android.apps.gsa.shared.speech.b.g: Error reading from input stream
at com.google.android.apps.gsa.staticplugins.recognizer.j.a.a(SourceFile:28)
at com.google.android.apps.gsa.staticplugins.recognizer.j.b.run(SourceFile:15)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:14)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
at com.google.android.apps.gsa.shared.util.concurrent.a.ai.run(SourceFile:6)
Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
at com.google.android.apps.gsa.speech.audio.Tee.f(SourceFile:103)
at com.google.android.apps.gsa.speech.audio.au.read(SourceFile:2)
at java.io.InputStream.read(InputStream.java:101)
at com.google.android.apps.gsa.speech.audio.ao.run(SourceFile:18)
at com.google.android.apps.gsa.speech.audio.an.run(SourceFile:2)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:14)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
at com.google.android.apps.gsa.shared.util.concurrent.a.ai.run(SourceFile:6)
03-23 05:42:02.324 6661-6733/com.google.android.googlequicksearchbox:search I/AudioController: internalShutdown
03-23 05:42:02.337 6661-6661/com.google.android.googlequicksearchbox:search I/MicroDetector: Keeping mic open: false
03-23 05:42:02.337 6661-6661/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: #onError(false)
03-23 05:42:02.337 6661-6735/com.google.android.googlequicksearchbox:search I/DeviceStateChecker: DeviceStateChecker cancelled
03-23 05:42:02.337 6661-6661/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: #onError(false)
03-23 05:42:07.345 6661-6661/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: #updateMicroDetector [detectionMode: [mDetectionMode: [1]]]
03-23 05:42:07.345 6661-6661/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: #startMicroDetector [speakerMode: 0]
03-23 05:42:07.346 6661-6661/com.google.android.googlequicksearchbox:search I/AudioController: Using mInputStreamFactoryBuilder
03-23 05:42:07.349 6661-6661/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: onReady
03-23 05:42:07.353 6661-6733/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Starting detection.
03-23 05:42:07.355 6661-7408/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_starting com.google.android.apps.gsa.staticplugins.aa.c#be90ea0
03-23 05:42:07.358 1574-7906/? I/AudioFlinger: AudioFlinger's thread 0xb0797180 tid=7906 ready to run
When i play video with resolution 704x576 (using MediaCodec) . I'm seeing this error and app is crashing
Logs:
12-04 04:35:55.507 E/OMX-VDEC-1080P( 9621): Insufficient sized buffer given for playback, expected 2514944, got 2506752
12-04 04:35:55.507 E/OMXNodeInstance( 9621): OMX_UseBuffer failed with error -2147479547 (0x80001005)
12-04 04:35:55.507 E/ACodec (22699): registering GraphicBuffer 0 with OMX IL component failed: -2147483648
12-04 04:35:55.507 E/ACodec (22699): Failed to allocate output port buffers after port reconfiguration (error 0x80000000)
12-04 04:35:55.507 E/MediaCodec(22699): Codec reported an error. (omx error 0x80001001, internalError -2147483648)
I am trying to use MediaCodec,MediaExtractor and MediaMuxer to generate mp4 file. EveryThing seems to work properly but when i call MediaMuxer.stop i'm having an error . The MP4 file is created but i can't play it with a Player.
Here is my logcat:
02-13 10:41:22.420: D/OpenGLRenderer(11768): Enabling debug mode 0
02-13 10:41:22.600: I/OMXClient(11768): Using client-side OMX mux.
02-13 10:41:22.717: E/ACodec(11768): [OMX.TI.DUCATI1.VIDEO.DECODER] storeMetaDataInBuffers failed w/ err -2147483648
02-13 10:41:22.717: I/ACodec(11768): DRC Mode: Port Reconfig Mode
02-13 10:41:22.725: I/MPEG4Writer(11768): limits: 2147483647/0 bytes/us, bit rate: -1 bps and the estimated moov size 3072 bytes
02-13 10:41:22.803: I/MPEG4Writer(11768): setStartTimestampUs: 0
02-13 10:41:22.803: I/MPEG4Writer(11768): Earliest track starting time: 0
02-13 10:41:22.896: W/AHierarchicalStateMachine(11768): Warning message AMessage(what = 'omx ', target = 1) = {
02-13 10:41:22.896: W/AHierarchicalStateMachine(11768): int32_t type = 0
02-13 10:41:22.896: W/AHierarchicalStateMachine(11768): void *node = 0x4d
02-13 10:41:22.896: W/AHierarchicalStateMachine(11768): int32_t event = 3
02-13 10:41:22.896: W/AHierarchicalStateMachine(11768): int32_t data1 = 1
02-13 10:41:22.896: W/AHierarchicalStateMachine(11768): int32_t data2 = 117440527
02-13 10:41:22.896: W/AHierarchicalStateMachine(11768): } unhandled in root state.
02-13 10:41:22.912: I/MPEG4Writer(11768): setStartTimestampUs: 0
02-13 10:41:22.912: D/DecodeActivity(11768): INFO_OUTPUT_BUFFERS_CHANGED
02-13 10:41:22.935: D/DecodeActivity(11768): New format {height=832, what=1869968451, color-format=256, slice-height=832, crop-left=32, width=1408, crop-bottom=743, crop-top=24, mime=video/raw, stride=4096, crop-right=1311}
02-13 10:41:22.959: W/MPEG4Writer(11768): 0-duration samples found: 1
02-13 10:41:22.975: W/MPEG4Writer(11768): 0-duration samples found: 1
02-13 10:41:22.990: I/ActivityManager(11768): Timeline: Activity_idle id: android.os.BinderProxy#41ab6858 time:26420441
02-13 10:41:33.701: D/DecodeActivity(11768): InputBuffer BUFFER_FLAG_END_OF_STREAM
02-13 10:41:33.709: D/DecodeActivity(11768): OutputBuffer BUFFER_FLAG_END_OF_STREAM
02-13 10:41:33.709: E/MPEG4Writer(11768): There are no sync frames for video track
02-13 10:41:33.717: W/MPEG4Writer(11768): 0-duration samples found: 283
02-13 10:41:33.717: I/MPEG4Writer(11768): Received total/0-length (284/0) buffers and encoded 284 frames. - video
02-13 10:41:33.717: D/MPEG4Writer(11768): Stopping Video track
02-13 10:41:33.717: D/MPEG4Writer(11768): Stopping Video track source
02-13 10:41:33.717: D/MPEG4Writer(11768): Video track stopped
02-13 10:41:33.717: D/MPEG4Writer(11768): Stopping Audio track
02-13 10:41:36.076: W/MPEG4Writer(11768): 0-duration samples found: 453
02-13 10:41:36.076: I/MPEG4Writer(11768): Received total/0-length (454/0) buffers and encoded 454 frames. - audio
02-13 10:41:36.271: I/MPEG4Writer(11768): Audio track drift time: 0 us
02-13 10:41:36.271: D/MPEG4Writer(11768): Stopping Audio track source
02-13 10:41:36.271: D/MPEG4Writer(11768): Audio track stopped
02-13 10:41:36.271: D/MPEG4Writer(11768): Duration from tracks range is [0, 0] us
02-13 10:41:36.271: D/MPEG4Writer(11768): Stopping writer thread
02-13 10:41:36.271: D/MPEG4Writer(11768): 0 chunks are written in the last batch
02-13 10:41:36.271: D/MPEG4Writer(11768): Writer thread stopped
02-13 12:28:47.507: E/MediaMuxer(14233): stop() is called in invalid state 3
02-13 10:41:36.271: W/dalvikvm(11768): threadid=11: thread exiting with uncaught exception (group=0x417fbc80)
02-13 10:41:36.271: E/AndroidRuntime(11768): FATAL EXCEPTION: Thread-2394
02-13 10:41:36.271: E/AndroidRuntime(11768): Process: com.test.applyexporter, PID: 11768
02-13 10:41:36.271: E/AndroidRuntime(11768): java.lang.IllegalStateException: Failed to stop the muxer
02-13 10:41:36.271: E/AndroidRuntime(11768): at android.media.MediaMuxer.nativeStop(Native Method)
02-13 10:41:36.271: E/AndroidRuntime(11768): at android.media.MediaMuxer.stop(MediaMuxer.java:226)
02-13 10:41:36.271: E/AndroidRuntime(11768): at com.test.applyexporter.MainActivity$DecoderThread.releaseDecoder(MainActivity.java:266)
02-13 10:41:36.271: E/AndroidRuntime(11768): at com.test.applyexporter.MainActivity$DecoderThread.run(MainActivity.java:113)
02-13 10:41:36.310: I/Process(11768): Sending signal. PID: 11768 SIG: 9
Any clues why the stop fail ?
Note the error:
E/MPEG4Writer(11768): There are no sync frames for video track
The muxed video output must begin with a sync frame (a/k/a key frame, a/k/a I-frame). If you start with a prediction frame, but nothing to predict from, the decoder won't have any idea what to do.
Make sure you are passing all of the MediaCodec.BufferInfo values through to the MediaMuxer -- that's where the flags are. The sync frames will have the BUFFER_FLAG_SYNC_FRAME flag set.
(Update: as of API 21, BUFFER_FLAG_SYNC_FRAME is deprecated in favor of BUFFER_FLAG_KEY_FRAME. Both symbols have the same integer value and same meaning; the change is just part of an effort to adopt consistent terminology in the API.)
I am trying to play a file i have recorded. The file plays well in vlc(linux pc) and in Moboplayer(android tablet). While using the default player in the android tablet it shows this in logcat.
I/ActivityManager( 201): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.mymediaplayer/.MyVideoView bnds=[656,246][752,342]} from pid 417
I/System.out(20286): MyVideoView.onCreate()
I/System.out(20286): MyVideoView.onResume()
V/TabletStatusBar( 281): setLightsOn(true)
I/AwesomePlayer( 141): setDataSource_l('/sdcard/video/TunerOut.ts')
I/avc_utils( 141): found AVC codec config (720 x 480, Baseline-profile level 3.1)
I/MPEG2TSExtractor( 141): haveAudio=1, haveVideo=1
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.TI.DUCATI1.VIDEO.DECODER'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.Nvidia.h264.decode'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.qcom.7x30.video.decoder.avc'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.qcom.video.decoder.avc'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.TI.Video.Decoder'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.SEC.AVC.Decoder'
E/OMXCodec( 141): Successfully allocated OMX node 'OMX.SEC.AVC.Decoder'
I/OMXCodec( 141): [OMX.SEC.AVC.Decoder] AVC profile = 66 (Baseline), level = 31
E/OMXCodec( 141): [OMX.SEC.AVC.Decoder] Video O/P format.eColorFormat 0x40b452b1
I/OMXCodec( 141): [OMX.SEC.AVC.Decoder] video dimensions are 720 x 480
D/OpenGLRenderer( 417): Flushing caches (mode 1)
I/ActivityManager( 201): Displayed com.example.mymediaplayer/.MyVideoView: +323ms
W/InputManagerService( 201): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy#4106dc38 (uid=10036 pid=20503)
W/IInputConnectionWrapper(20503): showStatusIcon on inactive InputConnection
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.Nvidia.mp2.decoder'
**E/MediaPlayer(20286): error (1, -2147483648)
E/MediaPlayer(20286): Error (1,-2147483648)
D/VideoView(20286): Error: 1,-2147483648**
D/OpenGLRenderer( 417): Flushing caches (mode 0)
W/InputManagerService( 201): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#41033300
D/AudioHardware( 141): AudioHardware pcm playback is going to standby.
what is error 1,-2147483648
I just had that error too. The reason (in my case) was that the mp3 has the wrong format, i.e.
MPEG ADTS, layer II, v1, 192 kbps, 44.1 kHz, Stereo
while a "good" mp3 has this format:
MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo