Closed kenle closed 3 years ago
This could be for multiple reason. Are you using android 11+? In that version file system changed and maybe you need change path. Also remember add this to manifest: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/app/src/main/AndroidManifest.xml#L23
Hi @pedroSG94, thank you for your reply.
Yes I have the android:requestLegacyExternalStorage="true"
flag set, in addition to following the note below at https://developer.android.com/about/versions/11/privacy/storage
Alternatively, if I run the following code it works.
String storePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath()
+ File.separator;
...
this.mMediaRecorder = new MediaRecorder();
...
this.mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE);
...
this.mMediaRecorder.setOutputFile(storePath + fileName + "." + fileFormat);
this.mMediaRecorder.prepare();
this.mMediaRecorder.start();
Interestingly enough though, if I use the same storePath
for my call to displayBase.startRecord(storePath+fileName+".mp4");
I still get the same error.
Update: after digging around maybe the error is related to "new byte" call in this file? https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/d8d2d1e615b75bca897a7cdd46ce8185075360ec/encoder/src/main/java/com/pedro/encoder/utils/yuv/YV12Utils.java#L23 Similar issue elsewhere on the net, but no resolve: https://github.com/twilio/video-quickstart-android/issues/600
Thanks, -Ken
This is weird.
Similar issue elsewhere on the net, but no resolve: twilio/video-quickstart-android#600
I have an Oneplus 7T and Google pixel 4a but I can't reproduce that issue shared.
Hi @pedroSG94 I'll get you over my logcat soon, thanks. I'm using an Samsung Galaxy M21, Android version 11.
Here's another issue on the net that I found that maybe related: https://www.796t.com/article.php?id=207432
Hi @pedroSG94, this is my full logcat from the time I start recording. An exception is not thrown when running displayBase.startRecord
. I'll try some of your other suggestions and get back later with my results. Thank you very much -Ken
I/ViewRootImpl@7c80994[MainActivity]( 7865): ViewPostIme pointer 0
I/ViewRootImpl@7c80994[MainActivity]( 7865): ViewPostIme pointer 1
I/ViewRootImpl@7c80994[MainActivity]( 7865): ViewPostIme pointer 0
I/ViewRootImpl@7c80994[MainActivity]( 7865): ViewPostIme pointer 1
D/permissions_handler( 7865): No android specific permissions needed for: 9
D/FlutterForegroundService( 7865): onStartCommand: com.changjoopark.flutter_foreground_plugin.action.startforeground
I/ViewRootImpl@7c80994[MainActivity]( 7865): MSG_WINDOW_FOCUS_CHANGED 0 1
I/SurfaceControl( 7865): release : mNativeObject = 491522846496 - Surface(name=Surface(name=166ac31 InputMethod)/@0x3903097 - animation-leash)/@0x86c143e
I/SurfaceControl( 7865): nativeRelease nativeObject s[491522846496]
I/SurfaceControl( 7865): nativeRelease nativeObject e[491522846496]
I/SurfaceControl( 7865): release : mNativeObject = 491522857472 - Surface(name=Surface(name=ba63b45 NavigationBar0)/@0x4a9eab3 - animation-leash)/@0xd67ded8
I/SurfaceControl( 7865): nativeRelease nativeObject s[491522857472]
I/SurfaceControl( 7865): nativeRelease nativeObject e[491522857472]
I/SurfaceControl( 7865): release : mNativeObject = 491522858032 - Surface(name=Surface(name=9766c7f StatusBar)/@0xa059004 - animation-leash)/@0xe2fe231
I/SurfaceControl( 7865): nativeRelease nativeObject s[491522858032]
I/SurfaceControl( 7865): nativeRelease nativeObject e[491522858032]
E/SurfaceManager( 7865): GL already released
E/SurfaceManager( 7865): GL already released
I/SurfaceManager( 7865): GL initialized
I/SurfaceManager( 7865): GL released
E/SurfaceManager( 7865): GL already released
E/SurfaceManager( 7865): GL already released
I/VideoEncoder( 7865): stopped
I/AudioEncoder( 7865): stopped
D/audioBitRate( 7865): 256000
D/audioChannels( 7865): 2
D/audioCodec( 7865): 3
D/audioSampleRate( 7865): 48000
D/duration( 7865): 30
D/fileFormat( 7865): 2
D/quality ( 7865): 1
D/videoBitRate( 7865): 48000000
D/videoCodec( 7865): 2
D/videoFrameHeight( 7865): 2340
D/videoFrameRate( 7865): 30
D/videoFrameWidth( 7865): 1080
W/AudioCapabilities( 7865): Unsupported mime audio/x-ima
W/VideoCapabilities( 7865): Unsupported mime video/mp43
W/VideoCapabilities( 7865): Unsupported mime video/wvc1
W/VideoCapabilities( 7865): Unsupported mime video/x-ms-wmv
W/AudioCapabilities( 7865): Unsupported mime audio/x-ms-wma
W/VideoCapabilities( 7865): Unsupported mime video/x-ms-wmv7
W/VideoCapabilities( 7865): Unsupported mime video/x-ms-wmv8
W/AudioCapabilities( 7865): Unsupported mime audio/x-ima
W/AudioCapabilities( 7865): Unsupported mime audio/mpeg-L1
W/AudioCapabilities( 7865): Unsupported mime audio/mpeg-L2
W/AudioCapabilities( 7865): Unsupported mime audio/x-ms-wma
W/VideoCapabilities( 7865): Unsupported mime video/mp43
W/VideoCapabilities( 7865): Unsupported mime video/wvc1
W/VideoCapabilities( 7865): Unsupported mime video/x-ms-wmv7
W/VideoCapabilities( 7865): Unsupported mime video/x-ms-wmv8
W/VideoCapabilities( 7865): Unsupported mime video/wvc1
W/VideoCapabilities( 7865): Unsupported mime video/avc-wfd
W/VideoCapabilities( 7865): Unrecognized profile/level 1/32 for video/mp4v-es
W/VideoCapabilities( 7865): Unrecognized profile/level 32768/2 for video/mp4v-es
W/VideoCapabilities( 7865): Unrecognized profile/level 32768/64 for video/mp4v-es
I/VideoEncoder( 7865): 3 encoders found
I/VideoEncoder( 7865): Encoder OMX.Exynos.AVC.Encoder
I/VideoEncoder( 7865): Color supported: 2135033992
I/VideoEncoder( 7865): Color supported: 19
I/VideoEncoder( 7865): Color supported: 21
I/VideoEncoder( 7865): Color supported: 2130706449
I/VideoEncoder( 7865): Color supported: 16
I/VideoEncoder( 7865): Color supported: 2130747392
I/VideoEncoder( 7865): Color supported: 2130708361
I/VideoEncoder( 7865): Encoder selected OMX.Exynos.AVC.Encoder
I/ACodec ( 7865): [] Now uninitialized
I/ACodec ( 7865): [] onAllocateComponent
I/OMXClient( 7865): IOmx service obtained
I/ACodec ( 7865): [OMX.Exynos.AVC.Encoder] Now Loaded
I/VideoEncoder( 7865): Prepare video info: SURFACE, 1080x2340
I/VideoEncoder( 7865): bitrate mode CBR not supported using default mode
I/ACodec ( 7865): app-pid(7865)
W/OMXUtils( 7865): do not know color format 0x7f000011 = 2130706449
W/OMXUtils( 7865): do not know color format 0x10 = 16
W/OMXUtils( 7865): do not know color format 0x7f00a000 = 2130747392
W/OMXUtils( 7865): do not know color format 0x7f000789 = 2130708361
I/ACodec ( 7865): app-name : com.example.app
I/ACodec ( 7865): Enable drop control
I/ACodec ( 7865): setupAVCEncoderParameters with [profile: Baseline] [level: Level5]
I/ACodec ( 7865): Enable Perceptual Video Coding
I/ACodec ( 7865): Success set VideoMinQP(5/5/5) VideoMaxQP(50/50/50)
I/ACodec ( 7865): reconfigEncoder4OtherApps
I/ACodec ( 7865): [OMX.Exynos.AVC.Encoder] cannot encode HDR static metadata. Ignoring.
I/ACodec ( 7865): setupVideoEncoder succeeded
I/ACodec ( 7865): [OMX.Exynos.AVC.Encoder] configure, AMessage : AMessage(what = 'conf', target = 1) = {
I/ACodec ( 7865): int32_t color-format = 2130708361
I/ACodec ( 7865): int32_t i-frame-interval = 2
I/ACodec ( 7865): string mime = "video/avc"
I/ACodec ( 7865): int32_t width = 1080
I/ACodec ( 7865): int32_t bitrate = 48000000
I/ACodec ( 7865): int32_t max-input-size = 0
I/ACodec ( 7865): int32_t frame-rate = 30
I/ACodec ( 7865): int32_t height = 2340
I/ACodec ( 7865): int32_t flags = 1
I/ACodec ( 7865): int32_t encoder = 1
I/ACodec ( 7865): }
W/OMXUtils( 7865): do not know color format 0x7f000789 = 2130708361
I/VideoEncoder( 7865): prepared
I/AudioPostProcessEffect( 7865): EchoCanceler enabled
I/MicrophoneManager( 7865): Microphone created, 48000hz, Stereo
I/AudioEncoder( 7865): 3 encoders found
I/AudioEncoder( 7865): Encoder c2.android.aac.encoder
I/AudioEncoder( 7865): Encoder selected c2.android.aac.encoder
D/CCodec ( 7865): allocate(c2.android.aac.encoder)
I/Codec2Client( 7865): Available Codec2 services: "default" "software"
I/CCodec ( 7865): setting up 'default' as default (vendor) store
I/CCodec ( 7865): Created component [c2.android.aac.encoder]
D/CCodecConfig( 7865): read media type: audio/mp4a-latm
D/ReflectedParamUpdater( 7865): extent() != 1 for single value type: algo.buffers.max-count.values
D/ReflectedParamUpdater( 7865): extent() != 1 for single value type: output.subscribed-indices.values
D/ReflectedParamUpdater( 7865): extent() != 1 for single value type: input.buffers.allocator-ids.values
D/ReflectedParamUpdater( 7865): extent() != 1 for single value type: output.buffers.allocator-ids.values
D/ReflectedParamUpdater( 7865): extent() != 1 for single value type: algo.buffers.allocator-ids.values
D/ReflectedParamUpdater( 7865): extent() != 1 for single value type: output.buffers.pool-ids.values
D/ReflectedParamUpdater( 7865): extent() != 1 for single value type: algo.buffers.pool-ids.values
I/CCodecConfig( 7865): query failed after returning 9 values (BAD_INDEX)
D/CCodecConfig( 7865): c2 config diff is Dict {
D/CCodecConfig( 7865): c2::u32 coded.bitrate.value = 64000
D/CCodecConfig( 7865): c2::u32 coded.pl.level = 0
D/CCodecConfig( 7865): c2::u32 coded.pl.profile = 8192
D/CCodecConfig( 7865): c2::u32 coding.aac-sbr-mode.value = 3
D/CCodecConfig( 7865): c2::u32 input.buffers.max-size.value = 2048
D/CCodecConfig( 7865): c2::u32 input.delay.value = 0
D/CCodecConfig( 7865): string input.media-type.value = "audio/raw"
D/CCodecConfig( 7865): string output.media-type.value = "audio/mp4a-latm"
D/CCodecConfig( 7865): c2::u32 raw.channel-count.value = 1
D/CCodecConfig( 7865): c2::u32 raw.sample-rate.value = 44100
D/CCodecConfig( 7865): }
D/CCodec ( 7865): [c2.android.aac.encoder] buffers are bound to CCodec for this session
D/CCodec ( 7865): can't get width
D/CCodec ( 7865): can't get height
I/CCodec ( 7865): appPid(7865) width(0) height(0)
D/CCodecConfig( 7865): no c2 equivalents for aac-profile
D/CCodecConfig( 7865): no c2 equivalents for flags
D/CCodecConfig( 7865): no c2 equivalents for encoder
D/CCodecConfig( 7865): c2 config diff is c2::u32 coded.bitrate.value = 256000
D/CCodecConfig( 7865): c2::u32 input.buffers.max-size.value = 4096
D/CCodecConfig( 7865): c2::u32 raw.channel-count.value = 2
D/CCodecConfig( 7865): c2::u32 raw.sample-rate.value = 48000
W/Codec2Client( 7865): query -- param skipped: index = 1107298332.
D/CCodec ( 7865): setup formats input: AMessage(what = 0x00000000) = {
D/CCodec ( 7865): int32_t aac-sbr-mode = 3
D/CCodec ( 7865): int32_t channel-count = 2
D/CCodec ( 7865): int32_t max-input-size = 7680
D/CCodec ( 7865): string mime = "audio/raw"
D/CCodec ( 7865): int32_t sample-rate = 48000
D/CCodec ( 7865): } and output: AMessage(what = 0x00000000) = {
D/CCodec ( 7865): int32_t aac-sbr-mode = 3
D/CCodec ( 7865): int32_t bitrate = 256000
D/CCodec ( 7865): int32_t channel-count = 2
D/CCodec ( 7865): int32_t level = 0
D/CCodec ( 7865): int32_t max-bitrate = 256000
D/CCodec ( 7865): string mime = "audio/mp4a-latm"
D/CCodec ( 7865): int32_t profile = 2
D/CCodec ( 7865): int32_t sample-rate = 48000
D/CCodec ( 7865): }
I/AudioEncoder( 7865): prepared
I/VideoEncoder( 7865): started
I/MediaCodec( 7865): MediaCodec will operate in async mode
I/ACodec ( 7865): [OMX.Exynos.AVC.Encoder] Now Loaded->Idle
I/ACodec ( 7865): [OMX.Exynos.AVC.Encoder] Now Idle->Executing
I/MediaCodec( 7865): setCodecState state : 0
I/AudioEncoder( 7865): started
I/MediaCodec( 7865): MediaCodec will operate in async mode
W/Codec2Client( 7865): query -- param skipped: index = 1342179345.
W/Codec2Client( 7865): query -- param skipped: index = 2415921170.
I/ACodec ( 7865): [OMX.Exynos.AVC.Encoder] Now Executing
E/FMQ ( 7865): grantorIdx must be less than 3
E/FMQ ( 7865): grantorIdx must be less than 3
D/CCodecBufferChannel( 7865): [c2.android.aac.encoder#92] Created input block pool with allocatorID 16 => poolID 17 - OK (0)
I/CCodecBufferChannel( 7865): [c2.android.aac.encoder#92] Created output block pool with allocatorID 16 => poolID 25 - OK
D/CCodecBufferChannel( 7865): [c2.android.aac.encoder#92] Configured output block pool ids 25 => OK
E/ion ( 7865): ioctl c0044901 failed with code -1: Inappropriate ioctl for device
E/SurfaceManager( 7865): GL already released
I/SurfaceManager( 7865): GL initialized
E/SurfaceManager( 7865): GL already released
I/SurfaceManager( 7865): GL initialized
I/SurfaceManager( 7865): GL released
E/SurfaceManager( 7865): GL already released
I/SurfaceManager( 7865): GL initialized
I/SurfaceManager( 7865): GL initialized
I/MicMM ( 7865): Microphone started
D/MPEG4Writer( 7865): PreAllocation disabled. fallocate : Operation not supported on transport endpoint, 95
I/ViewRootImpl@7c80994[MainActivity]( 7865): stopped(false) old=false
I/SurfaceControl( 7865): release : mNativeObject = 491522853328 - Surface(name=Surface(name=166ac31 InputMethod)/@0x3903097 - animation-leash)/@0x8e408ee
I/SurfaceControl( 7865): nativeRelease nativeObject s[491522853328]
I/SurfaceControl( 7865): nativeRelease nativeObject e[491522853328]
I/SurfaceControl( 7865): release : mNativeObject = 491522851088 - Surface(name=com.example.app/com.example.app.MainActivity$_7865)/@0xf02f72c
I/SurfaceControl( 7865): nativeRelease nativeObject s[491522851088]
I/SurfaceControl( 7865): nativeRelease nativeObject e[491522851088]
I/SurfaceControl( 7865): release : mNativeObject = 491522873712 - Surface(name=Surface(name=166ac31 InputMethod)/@0x3903097 - animation-leash)/@0x95eec1c
I/SurfaceControl( 7865): nativeRelease nativeObject s[491522873712]
I/SurfaceControl( 7865): nativeRelease nativeObject e[491522873712]
I/SurfaceControl( 7865): release : mNativeObject = 491522864528 - Surface(name=Surface(name=ba63b45 NavigationBar0)/@0x4a9eab3 - animation-leash)/@0x3034025
I/SurfaceControl( 7865): nativeRelease nativeObject s[491522864528]
I/SurfaceControl( 7865): nativeRelease nativeObject e[491522864528]
I/SurfaceControl( 7865): release : mNativeObject = 491522873152 - Surface(name=Surface(name=9766c7f StatusBar)/@0xa059004 - animation-leash)/@0x78bc5fa
I/SurfaceControl( 7865): nativeRelease nativeObject s[491522873152]
I/SurfaceControl( 7865): nativeRelease nativeObject e[491522873152]
I/ViewRootImpl@7c80994[MainActivity]( 7865): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=8 res=0x1 s={true 496355576096} ch=false fn=2
I/ViewRootImpl@7c80994[MainActivity]( 7865): MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager( 7865): prepareNavigationBarInfo() DecorView@10e9e27[MainActivity]
D/InputMethodManager( 7865): getNavigationBarColor() -855310
D/InputMethodManager( 7865): prepareNavigationBarInfo() DecorView@10e9e27[MainActivity]
D/InputMethodManager( 7865): getNavigationBarColor() -855310
V/InputMethodManager( 7865): Starting input: tba=com.example.app ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager( 7865): startInputInner - Id : 0
I/InputMethodManager( 7865): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport( 7865): Input channel constructed: 'ClientS', fd=255
D/InputTransport( 7865): Input channel destroyed: 'ClientS', fd=158
E/FMQ ( 7865): grantorIdx must be less than 3
I/Handshake( 7865): writing C0
I/Handshake( 7865): C0 write successful
I/Handshake( 7865): writing C1
I/Handshake( 7865): writing time 1637951223 to c1
I/Handshake( 7865): writing zero to c1
I/Handshake( 7865): writing random to c1
E/FMQ ( 7865): grantorIdx must be less than 3
I/Handshake( 7865): C1 write successful
I/Handshake( 7865): reading S0
I/Handshake( 7865): read S0 successful
I/Handshake( 7865): reading S1
I/Handshake( 7865): read S1 successful
I/Handshake( 7865): writing C2
I/Handshake( 7865): C2 write successful
I/Handshake( 7865): reading S2
I/Handshake( 7865): read S2 successful
I/CommandsManager( 7865): using default write chunk size 128
D/ACodec ( 7865): dataspace changed to 0x10c10000 (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) (R:2(Limited), S:1(BT709), T:3(SMPTE_170M))
I/CommandsManager( 7865): send Command(name='connect', transactionId=1, timeStamp=0, streamId=0, data=[AmfString value: connect, AmfNumber value: 1.0, AmfObject properties: {AmfString value: app=AmfString value: live2, AmfString value: flashVer=AmfString value: FMLE/3.0 (compatible; Lavf57.56.101), AmfString value: swfUrl=AmfString value: , AmfString value: tcUrl=AmfString value: rtmp://a.rtmp.youtube.com/live2, AmfString value: fpad=AmfBoolean value: false, AmfString value: capabilities=AmfNumber value: 239.0, AmfString value: pageUrl=AmfString value: , AmfString value: objectEncoding=AmfNumber value: 0.0}], bodySize=205)
I/RtmpClient( 7865): send sps and pps
I/RtmpClient( 7865): send sps and pps
I/MediaCodec( 7865): setCodecState state : 1
I/CommandsManager( 7865): read WindowAcknowledgementSize(acknowledgementWindowSize=2500000)
I/CommandsManager( 7865): read SetPeerBandwidth(acknowledgementWindowSize=10000000, type=DYNAMIC)
I/CommandsManager( 7865): read SetChunkSize(chunkSize=256)
I/RtmpClient( 7865): chunk size configured to 256
I/CommandsManager( 7865): read Command(name='_result', transactionId=1, timeStamp=0, streamId=0, data=[AmfString value: _result, AmfNumber value: 1.0, AmfObject properties: {AmfString value: fmsVer=AmfString value: FMS/3,5,3,824, AmfString value: capabilities=AmfNumber value: 127.0, AmfString value: mode=AmfNumber value: 1.0}, AmfObject properties: {AmfString value: level=AmfString value: status, AmfString value: code=AmfString value: NetConnection.Connect.Success, AmfString value: description=AmfString value: Connection succeeded., AmfString value: objectEncoding=AmfNumber value: 0.0, AmfString value: data=AmfEcmaArray length: 1, properties: {AmfString value: version=AmfString value: 3,5,3,824}}], bodySize=240)
D/MPEG4Writer( 7865): fpathconf _PC_FILESIZEBITS:64
D/MPEG4Writer( 7865): File size limit set to 4503599627370495 bytes implicitly
I/CommandsManager( 7865): send Command(name='releaseStream', transactionId=2, timeStamp=0, streamId=0, data=[AmfString value: releaseStream, AmfNumber value: 2.0, AmfNull, AmfString value: xxxx], bodySize=53)
I/CommandsManager( 7865): send Command(name='FCPublish', transactionId=3, timeStamp=0, streamId=0, data=[AmfString value: FCPublish, AmfNumber value: 3.0, AmfNull, AmfString value: xxxx], bodySize=49)
D/MPEG4Writer( 7865): MP4WtrCtrlHlpLooper Started
I/CommandsManager( 7865): send Command(name='createStream', transactionId=4, timeStamp=0, streamId=0, data=[AmfString value: createStream, AmfNumber value: 4.0, AmfNull], bodySize=25)
I/RtmpClient( 7865): success response received from connect
I/CommandsManager( 7865): read Command(name='onBWDone', transactionId=0, timeStamp=0, streamId=0, data=[AmfString value: onBWDone, AmfNumber value: 0.0, AmfNull], bodySize=21)
I/RtmpClient( 7865): unknown onBWDone response received from unknown command
I/MPEG4Writer( 7865): setStartTimestampUs: 553830 from Video track
I/MPEG4Writer( 7865): Earliest track starting time: 553830
I/MPEG4Writer( 7865): setStartTimestampUs: 408056 from Audio track
I/MPEG4Writer( 7865): Earliest track starting time: 408056
I/CommandsManager( 7865): read Command(name='_result', transactionId=4, timeStamp=0, streamId=0, data=[AmfString value: _result, AmfNumber value: 4.0, AmfNull, AmfNumber value: 1.0], bodySize=29)
I/CommandsManager( 7865): send Command(name='publish', transactionId=5, timeStamp=0, streamId=1, data=[AmfString value: publish, AmfNumber value: 5.0, AmfNull, AmfString value: xxxx, AmfString value: live], bodySize=54)
I/RtmpClient( 7865): success response received from createStream
I/CommandsManager( 7865): read Command(name='onStatus', transactionId=0, timeStamp=0, streamId=0, data=[AmfString value: onStatus, AmfNumber value: 0.0, AmfNull, AmfObject properties: {AmfString value: level=AmfString value: status, AmfString value: code=AmfString value: NetStream.Publish.Start}], bodySize=73)
I/CommandsManager( 7865): send Data(name='@setDataFrame', data=[AmfString value: onMetaData, AmfEcmaArray length: 3, properties: {AmfString value: duration=AmfNumber value: 0.0, AmfString value: stereo=AmfBoolean value: true, AmfString value: filesize=AmfNumber value: 0.0}], bodySize=85)
D/RTMP Checker( 7865): onConnectionSuccessRtmp
I/RtmpSender( 7865): wrote Video packet, size 51
D/RTMP Checker( 7865): onNewBitrateRtmp
I/RtmpSender( 7865): wrote Video packet, size 215191
I/RtmpSender( 7865): wrote Video packet, size 198711
I/RtmpSender( 7865): wrote Audio packet, size 23
I/RtmpSender( 7865): wrote Audio packet, size 697
I/RtmpSender( 7865): wrote Audio packet, size 671
I/RtmpSender( 7865): wrote Audio packet, size 679
I/RtmpSender( 7865): wrote Audio packet, size 715
I/RtmpSender( 7865): wrote Audio packet, size 685
I/RtmpSender( 7865): wrote Audio packet, size 697
I/RtmpSender( 7865): wrote Audio packet, size 693
I/RtmpSender( 7865): wrote Audio packet, size 680
I/RtmpSender( 7865): wrote Audio packet, size 656
I/RtmpSender( 7865): wrote Audio packet, size 666
I/RtmpSender( 7865): wrote Audio packet, size 677
I/RtmpSender( 7865): wrote Audio packet, size 673
I/CommandsManager( 7865): read Acknowledgement(sequenceNumber=132671)
I/RtmpSender( 7865): wrote Video packet, size 241970
I/RtmpSender( 7865): wrote Video packet, size 221310
I/RtmpSender( 7865): wrote Video packet, size 104746
I/CommandsManager( 7865): read Acknowledgement(sequenceNumber=264545)
I/RtmpSender( 7865): wrote Video packet, size 162609
I/RtmpSender( 7865): wrote Video packet, size 167316
I/RtmpSender( 7865): wrote Video packet, size 203862
I/CommandsManager( 7865): read Acknowledgement(sequenceNumber=399255)
I/RtmpSender( 7865): wrote Video packet, size 164742
I/RtmpSender( 7865): wrote Audio packet, size 652
I/RtmpSender( 7865): wrote Audio packet, size 729
I/RtmpSender( 7865): wrote Video packet, size 187205
I/RtmpSender( 7865): wrote Audio packet, size 673
I/CommandsManager( 7865): read Acknowledgement(sequenceNumber=540253)
Application finished.
Hi @pedroSG94 , here is my logcat running the default app example. There is the same MPEG4 PreAllocation disabled
message and the file does not save. I'll try to dig around more, this seems to be device specific since it is not happening on yours.
2021-11-26 13:15:40.173 19508-19508/com.pedro.rtpstreamer I/ViewRootImpl@a44a6e1[ExampleRtmpActivity]: ViewPostIme pointer 0
2021-11-26 13:15:40.303 19508-19508/com.pedro.rtpstreamer I/ViewRootImpl@a44a6e1[ExampleRtmpActivity]: ViewPostIme pointer 1
2021-11-26 13:15:40.346 19508-19508/com.pedro.rtpstreamer I/MicrophoneManager: Microphone created, 32000hz, Stereo
2021-11-26 13:15:40.358 19508-19508/com.pedro.rtpstreamer W/AudioCapabilities: Unsupported mime audio/x-ima
2021-11-26 13:15:40.360 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/mp43
2021-11-26 13:15:40.361 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/wvc1
2021-11-26 13:15:40.362 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/x-ms-wmv
2021-11-26 13:15:40.363 19508-19508/com.pedro.rtpstreamer W/AudioCapabilities: Unsupported mime audio/x-ms-wma
2021-11-26 13:15:40.364 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/x-ms-wmv7
2021-11-26 13:15:40.365 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/x-ms-wmv8
2021-11-26 13:15:40.367 19508-19508/com.pedro.rtpstreamer W/AudioCapabilities: Unsupported mime audio/x-ima
2021-11-26 13:15:40.370 19508-19508/com.pedro.rtpstreamer W/AudioCapabilities: Unsupported mime audio/mpeg-L1
2021-11-26 13:15:40.371 19508-19508/com.pedro.rtpstreamer W/AudioCapabilities: Unsupported mime audio/mpeg-L2
2021-11-26 13:15:40.371 19508-19508/com.pedro.rtpstreamer W/AudioCapabilities: Unsupported mime audio/x-ms-wma
2021-11-26 13:15:40.372 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/mp43
2021-11-26 13:15:40.373 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/wvc1
2021-11-26 13:15:40.373 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/x-ms-wmv7
2021-11-26 13:15:40.374 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/x-ms-wmv8
2021-11-26 13:15:40.402 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/wvc1
2021-11-26 13:15:40.408 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/avc-wfd
2021-11-26 13:15:40.443 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile/level 1/32 for video/mp4v-es
2021-11-26 13:15:40.443 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
2021-11-26 13:15:40.443 19508-19508/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile/level 32768/64 for video/mp4v-es
2021-11-26 13:15:40.445 19508-19508/com.pedro.rtpstreamer I/AudioEncoder: 3 encoders found
2021-11-26 13:15:40.445 19508-19508/com.pedro.rtpstreamer I/AudioEncoder: Encoder c2.android.aac.encoder
2021-11-26 13:15:40.445 19508-19508/com.pedro.rtpstreamer I/AudioEncoder: Encoder selected c2.android.aac.encoder
2021-11-26 13:15:40.449 19508-21162/com.pedro.rtpstreamer D/CCodec: allocate(c2.android.aac.encoder)
2021-11-26 13:15:40.452 19508-21162/com.pedro.rtpstreamer I/Codec2Client: Available Codec2 services: "default" "software"
2021-11-26 13:15:40.455 19508-21162/com.pedro.rtpstreamer I/CCodec: setting up 'default' as default (vendor) store
2021-11-26 13:15:40.471 19508-21162/com.pedro.rtpstreamer I/CCodec: Created component [c2.android.aac.encoder]
2021-11-26 13:15:40.471 19508-21162/com.pedro.rtpstreamer D/CCodecConfig: read media type: audio/mp4a-latm
2021-11-26 13:15:40.474 19508-21162/com.pedro.rtpstreamer D/ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.max-count.values
2021-11-26 13:15:40.474 19508-21162/com.pedro.rtpstreamer D/ReflectedParamUpdater: extent() != 1 for single value type: output.subscribed-indices.values
2021-11-26 13:15:40.474 19508-21162/com.pedro.rtpstreamer D/ReflectedParamUpdater: extent() != 1 for single value type: input.buffers.allocator-ids.values
2021-11-26 13:15:40.474 19508-21162/com.pedro.rtpstreamer D/ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.allocator-ids.values
2021-11-26 13:15:40.474 19508-21162/com.pedro.rtpstreamer D/ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.allocator-ids.values
2021-11-26 13:15:40.475 19508-21162/com.pedro.rtpstreamer D/ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.pool-ids.values
2021-11-26 13:15:40.475 19508-21162/com.pedro.rtpstreamer D/ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.pool-ids.values
2021-11-26 13:15:40.477 19508-21162/com.pedro.rtpstreamer I/CCodecConfig: query failed after returning 9 values (BAD_INDEX)
2021-11-26 13:15:40.477 19508-21162/com.pedro.rtpstreamer D/CCodecConfig: c2 config diff is Dict {
c2::u32 coded.bitrate.value = 64000
c2::u32 coded.pl.level = 0
c2::u32 coded.pl.profile = 8192
c2::u32 coding.aac-sbr-mode.value = 3
c2::u32 input.buffers.max-size.value = 2048
c2::u32 input.delay.value = 0
string input.media-type.value = "audio/raw"
string output.media-type.value = "audio/mp4a-latm"
c2::u32 raw.channel-count.value = 1
c2::u32 raw.sample-rate.value = 44100
}
2021-11-26 13:15:40.479 19508-21162/com.pedro.rtpstreamer D/CCodec: [c2.android.aac.encoder] buffers are bound to CCodec for this session
2021-11-26 13:15:40.479 19508-21162/com.pedro.rtpstreamer D/CCodec: can't get width
2021-11-26 13:15:40.479 19508-21162/com.pedro.rtpstreamer D/CCodec: can't get height
2021-11-26 13:15:40.479 19508-21162/com.pedro.rtpstreamer I/CCodec: appPid(19508) width(0) height(0)
2021-11-26 13:15:40.479 19508-21162/com.pedro.rtpstreamer D/CCodecConfig: no c2 equivalents for aac-profile
2021-11-26 13:15:40.479 19508-21162/com.pedro.rtpstreamer D/CCodecConfig: no c2 equivalents for flags
2021-11-26 13:15:40.479 19508-21162/com.pedro.rtpstreamer D/CCodecConfig: no c2 equivalents for encoder
2021-11-26 13:15:40.480 19508-21162/com.pedro.rtpstreamer D/CCodecConfig: c2 config diff is c2::u32 coded.bitrate.value = 65536
c2::u32 input.buffers.max-size.value = 4096
c2::u32 raw.channel-count.value = 2
c2::u32 raw.sample-rate.value = 32000
2021-11-26 13:15:40.480 19508-21162/com.pedro.rtpstreamer W/Codec2Client: query -- param skipped: index = 1107298332.
2021-11-26 13:15:40.480 19508-21162/com.pedro.rtpstreamer D/CCodec: setup formats input: AMessage(what = 0x00000000) = {
int32_t aac-sbr-mode = 3
int32_t channel-count = 2
int32_t max-input-size = 5120
string mime = "audio/raw"
int32_t sample-rate = 32000
} and output: AMessage(what = 0x00000000) = {
int32_t aac-sbr-mode = 3
int32_t bitrate = 65536
int32_t channel-count = 2
int32_t level = 0
int32_t max-bitrate = 65536
string mime = "audio/mp4a-latm"
int32_t profile = 2
int32_t sample-rate = 32000
}
2021-11-26 13:15:40.481 19508-19508/com.pedro.rtpstreamer I/AudioEncoder: prepared
2021-11-26 13:15:40.482 19508-19508/com.pedro.rtpstreamer I/VideoEncoder: 3 encoders found
2021-11-26 13:15:40.482 19508-19508/com.pedro.rtpstreamer I/VideoEncoder: Encoder OMX.Exynos.AVC.Encoder
2021-11-26 13:15:40.482 19508-19508/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2135033992
2021-11-26 13:15:40.483 19508-19508/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 19
2021-11-26 13:15:40.483 19508-19508/com.pedro.rtpstreamer I/VideoEncoder: Encoder selected OMX.Exynos.AVC.Encoder
2021-11-26 13:15:40.484 19508-19508/com.pedro.rtpstreamer I/ACodec: [] Now uninitialized
2021-11-26 13:15:40.485 19508-21169/com.pedro.rtpstreamer I/ACodec: [] onAllocateComponent
2021-11-26 13:15:40.486 19508-21169/com.pedro.rtpstreamer I/OMXClient: IOmx service obtained
2021-11-26 13:15:40.506 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now Loaded
2021-11-26 13:15:40.507 19508-19508/com.pedro.rtpstreamer I/VideoEncoder: Prepare video info: YUV420PLANAR, 480x640
2021-11-26 13:15:40.508 19508-19508/com.pedro.rtpstreamer I/VideoEncoder: bitrate mode CBR not supported using default mode
2021-11-26 13:15:40.509 19508-21169/com.pedro.rtpstreamer I/ACodec: app-pid(19508)
2021-11-26 13:15:40.511 19508-21169/com.pedro.rtpstreamer I/ACodec: app-name : com.pedro.rtpstreamer
2021-11-26 13:15:40.511 19508-21169/com.pedro.rtpstreamer I/ACodec: Enable drop control
2021-11-26 13:15:40.515 19508-21169/com.pedro.rtpstreamer I/ACodec: setupAVCEncoderParameters with [profile: Baseline] [level: Level3]
2021-11-26 13:15:40.516 19508-21169/com.pedro.rtpstreamer I/ACodec: Enable Perceptual Video Coding
2021-11-26 13:15:40.516 19508-21169/com.pedro.rtpstreamer I/ACodec: Success set VideoMinQP(5/5/5) VideoMaxQP(50/50/50)
2021-11-26 13:15:40.516 19508-21169/com.pedro.rtpstreamer I/ACodec: reconfigEncoder4OtherApps
2021-11-26 13:15:40.517 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] cannot encode HDR static metadata. Ignoring.
2021-11-26 13:15:40.517 19508-21169/com.pedro.rtpstreamer I/ACodec: setupVideoEncoder succeeded
2021-11-26 13:15:40.517 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] configure, AMessage : AMessage(what = 'conf', target = 5) = {
int32_t color-format = 19
int32_t i-frame-interval = 2
string mime = "video/avc"
int32_t width = 480
int32_t bitrate = 1228800
int32_t max-input-size = 0
int32_t frame-rate = 30
int32_t height = 640
int32_t flags = 1
int32_t encoder = 1
}
2021-11-26 13:15:40.533 19508-19508/com.pedro.rtpstreamer I/VideoEncoder: prepared
2021-11-26 13:15:40.536 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: PreAllocation disabled. fallocate : Operation not supported on transport endpoint, 95
2021-11-26 13:15:40.537 19508-19508/com.pedro.rtpstreamer I/VideoEncoder: started
2021-11-26 13:15:40.539 19508-21168/com.pedro.rtpstreamer I/MediaCodec: MediaCodec will operate in async mode
2021-11-26 13:15:40.540 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now Loaded->Idle
2021-11-26 13:15:40.562 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now Idle->Executing
2021-11-26 13:15:40.563 19508-21168/com.pedro.rtpstreamer I/MediaCodec: setCodecState state : 0
2021-11-26 13:15:40.564 19508-19508/com.pedro.rtpstreamer I/AudioEncoder: started
2021-11-26 13:15:40.565 19508-21162/com.pedro.rtpstreamer I/MediaCodec: MediaCodec will operate in async mode
2021-11-26 13:15:40.567 19508-21162/com.pedro.rtpstreamer W/Codec2Client: query -- param skipped: index = 1342179345.
2021-11-26 13:15:40.567 19508-21162/com.pedro.rtpstreamer W/Codec2Client: query -- param skipped: index = 2415921170.
2021-11-26 13:15:40.568 19508-21162/com.pedro.rtpstreamer E/FMQ: grantorIdx must be less than 3
2021-11-26 13:15:40.569 19508-21162/com.pedro.rtpstreamer E/FMQ: grantorIdx must be less than 3
2021-11-26 13:15:40.569 19508-21162/com.pedro.rtpstreamer D/CCodecBufferChannel: [c2.android.aac.encoder#645] Created input block pool with allocatorID 16 => poolID 17 - OK (0)
2021-11-26 13:15:40.569 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now Executing
2021-11-26 13:15:40.571 19508-21162/com.pedro.rtpstreamer I/CCodecBufferChannel: [c2.android.aac.encoder#645] Created output block pool with allocatorID 16 => poolID 21 - OK
2021-11-26 13:15:40.571 19508-21162/com.pedro.rtpstreamer D/CCodecBufferChannel: [c2.android.aac.encoder#645] Configured output block pool ids 21 => OK
2021-11-26 13:15:40.572 19508-21162/com.pedro.rtpstreamer E/ion: ioctl c0044901 failed with code -1: Inappropriate ioctl for device
2021-11-26 13:15:40.583 19508-19508/com.pedro.rtpstreamer I/MicrophoneManager: Microphone started
2021-11-26 13:15:40.588 19508-19508/com.pedro.rtpstreamer D/CompatibilityChangeReporter: Compat change id reported: 147798919; UID 10118; state: ENABLED
2021-11-26 13:15:40.595 19508-19508/com.pedro.rtpstreamer D/Toast: show: caller = com.pedro.rtpstreamer.defaultexample.ExampleRtmpActivity.onClick:183
2021-11-26 13:15:40.595 19508-19508/com.pedro.rtpstreamer I/Toast: show: focusDisplayId = 0, isFocusInDesktop = false mCustomDisplayId=-1 isDexDualMode=false
2021-11-26 13:15:40.595 19508-19508/com.pedro.rtpstreamer I/Toast: show: isActivityContext = true
2021-11-26 13:15:40.693 19508-21162/com.pedro.rtpstreamer E/FMQ: grantorIdx must be less than 3
2021-11-26 13:15:40.699 19508-21166/com.pedro.rtpstreamer E/FMQ: grantorIdx must be less than 3
2021-11-26 13:15:41.050 19508-21173/com.pedro.rtpstreamer I/RtmpClient: send sps and pps
2021-11-26 13:15:41.052 19508-21168/com.pedro.rtpstreamer I/MediaCodec: setCodecState state : 1
2021-11-26 13:15:41.056 19508-21173/com.pedro.rtpstreamer D/MPEG4Writer: fpathconf _PC_FILESIZEBITS:64
2021-11-26 13:15:41.056 19508-21173/com.pedro.rtpstreamer D/MPEG4Writer: File size limit set to 4503599627370495 bytes implicitly
2021-11-26 13:15:41.058 19508-21173/com.pedro.rtpstreamer D/MPEG4Writer: MP4WtrCtrlHlpLooper Started
2021-11-26 13:15:41.062 19508-21185/com.pedro.rtpstreamer I/MPEG4Writer: setStartTimestampUs: 109071 from Video track
2021-11-26 13:15:41.062 19508-21185/com.pedro.rtpstreamer I/MPEG4Writer: Earliest track starting time: 109071
2021-11-26 13:15:41.180 19508-21186/com.pedro.rtpstreamer I/MPEG4Writer: setStartTimestampUs: 444205 from Audio track
2021-11-26 13:15:42.407 19508-19508/com.pedro.rtpstreamer I/ViewRootImpl@a44a6e1[ExampleRtmpActivity]: ViewPostIme pointer 0
2021-11-26 13:15:42.545 19508-19508/com.pedro.rtpstreamer I/ViewRootImpl@a44a6e1[ExampleRtmpActivity]: ViewPostIme pointer 1
2021-11-26 13:15:42.547 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: reset()
2021-11-26 13:15:42.547 19508-19508/com.pedro.rtpstreamer I/MPEG4Writer: Normal stop process
2021-11-26 13:15:42.548 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Video track stopping. Stop source
2021-11-26 13:15:42.548 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Video track source stopping
2021-11-26 13:15:42.548 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Video track source stopped
2021-11-26 13:15:42.548 19508-21185/com.pedro.rtpstreamer V/MediaWriter: Track event err/info msg:101, trackId:1, type:1000,val:-1011
2021-11-26 13:15:42.548 19508-21186/com.pedro.rtpstreamer V/MediaWriter: Track event err/info msg:101, trackId:2, type:1000,val:-1011
2021-11-26 13:15:42.548 19508-21185/com.pedro.rtpstreamer I/MPEG4Writer: Received total/0-length (39/0) buffers and encoded 39 frames. - Video
2021-11-26 13:15:42.548 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Video track stopped. Status:0. Stop source
2021-11-26 13:15:42.549 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Audio track stopping. Stop source
2021-11-26 13:15:42.549 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Audio track source stopping
2021-11-26 13:15:42.549 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Audio track source stopped
2021-11-26 13:15:42.551 19508-21186/com.pedro.rtpstreamer I/MPEG4Writer: Received total/0-length (44/0) buffers and encoded 44 frames. - Audio
2021-11-26 13:15:42.551 19508-21186/com.pedro.rtpstreamer I/MPEG4Writer: Audio track drift time: 0 us
2021-11-26 13:15:42.551 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Audio track stopped. Status:0. Stop source
2021-11-26 13:15:42.551 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Duration from tracks range is [1601665, 1749132] us
2021-11-26 13:15:42.551 19508-21183/com.pedro.rtpstreamer D/MPEG4Writer: 0 chunks are written in the last batch
2021-11-26 13:15:42.551 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: WriterThread stopped. Status:0
2021-11-26 13:15:42.553 19508-19508/com.pedro.rtpstreamer I/MPEG4Writer: Adjust the moov start time from 109071 us -> 109071 us
2021-11-26 13:15:42.560 19508-19508/com.pedro.rtpstreamer I/MPEG4Writer: The mp4 file will not be streamable.
2021-11-26 13:15:42.560 19508-19508/com.pedro.rtpstreamer I/MPEG4Writer: MOOV atom was written to the file
2021-11-26 13:15:42.560 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: release()
2021-11-26 13:15:42.560 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: MP4WtrCtrlHlpLooper stopped
2021-11-26 13:15:42.560 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Top 5 write durations(microseconds): #1:90 #2:111 #3:118 #4:154 #5:175
2021-11-26 13:15:42.560 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: reset()
2021-11-26 13:15:42.560 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Video track stopping. Stop source
2021-11-26 13:15:42.560 19508-19508/com.pedro.rtpstreamer E/MPEG4Writer: Stop() called but track is not started or stopped
2021-11-26 13:15:42.560 19508-19508/com.pedro.rtpstreamer D/MPEG4Writer: Audio track stopping. Stop source
2021-11-26 13:15:42.560 19508-19508/com.pedro.rtpstreamer E/MPEG4Writer: Stop() called but track is not started or stopped
2021-11-26 13:15:42.600 19508-19508/com.pedro.rtpstreamer I/MicrophoneManager: Microphone stopped
2021-11-26 13:15:42.600 19508-19508/com.pedro.rtpstreamer I/VideoEncoder: stopped
2021-11-26 13:15:42.600 19508-21168/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] signalFlush
2021-11-26 13:15:42.600 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] ExecutingState flushing now (codec owns 0/5 input, 0/4 output).
2021-11-26 13:15:42.604 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now Flushing
2021-11-26 13:15:42.607 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] FlushingState onOMXEvent(0,1,0)
2021-11-26 13:15:42.607 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] FlushingState onOMXEvent(0,1,1)
2021-11-26 13:15:42.608 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now Executing
2021-11-26 13:15:42.609 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now Executing->Idle
2021-11-26 13:15:42.626 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now Idle->Loaded
2021-11-26 13:15:42.627 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now Loaded
2021-11-26 13:15:42.627 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now kWhatShutdownCompleted event : 8323
2021-11-26 13:15:42.628 19508-19508/com.pedro.rtpstreamer I/AudioEncoder: stopped
2021-11-26 13:15:42.631 19508-21162/com.pedro.rtpstreamer D/CCodecBuffers: [c2.android.aac.encoder#645:1D-Output.Impl[N]] Client returned a buffer it does not own according to our record: 0
2021-11-26 13:15:42.637 19508-21169/com.pedro.rtpstreamer I/ACodec: [OMX.Exynos.AVC.Encoder] Now uninitialized
2021-11-26 13:15:42.637 19508-21169/com.pedro.rtpstreamer I/ACodec: [] Now kWhatShutdownCompleted event : 8323
2021-11-26 13:15:42.637 19508-21168/com.pedro.rtpstreamer I/MediaCodec: Codec shutdown complete
2021-11-26 13:15:42.638 19508-21162/com.pedro.rtpstreamer I/hw-BpHwBinder: onLastStrongRef automatically unlinking death recipients
2021-11-26 13:15:42.640 19508-21162/com.pedro.rtpstreamer I/MediaCodec: Codec shutdown complete
2021-11-26 13:15:42.642 19508-19508/com.pedro.rtpstreamer D/Toast: show: caller = com.pedro.rtpstreamer.defaultexample.ExampleRtmpActivity.onClick:204
2021-11-26 13:15:42.642 19508-19508/com.pedro.rtpstreamer I/Toast: show: focusDisplayId = 0, isFocusInDesktop = false mCustomDisplayId=-1 isDexDualMode=false
2021-11-26 13:15:42.643 19508-19508/com.pedro.rtpstreamer I/Toast: show: isActivityContext = true
2021-11-26 13:15:48.570 19508-21165/com.pedro.rtpstreamer D/BufferPoolAccessor2.0: bufferpool2 0x7d312bc7c8 : 0(0 size) total buffers - 0(0 size) used buffers - 45/50 (recycle/alloc) - 5/96 (fetch/transfer)
2021-11-26 13:15:48.570 19508-21165/com.pedro.rtpstreamer D/BufferPoolAccessor2.0: evictor expired: 1, evicted: 1
I think we are not in the correct way to solve it because I was looking into my logs and I can see exactly the same log as you mentioned in title so I think it is not related with your case. Also, I noticed that it is a debug logcat so it isn't an error and after read all your logs I can't find any suspicius error.
To detect the error I will need add a few logs to the code. The porpuse is know if it is called or not: Add a log to this method: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/Camera1Base.java#L915 Add a log here: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/Camera1Base.java#L920 Add a log here like this to know the variable value: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/Camera1Base.java#L899
Log.e("Pedro", "record video: " + h264Buffer.remaining() + ", f: " + info.flags);
Use OpenGl example and Let the app record around 20s. Also, check if you have a file in the destination route, no matter if the file is empty, unrechable, etc. Don't press start stream, only start record and stop record.
Thank you @pedroSG94. I will add this logging code and try when I get home. Appreciate your help. -Ken
Hi @pedroSG94, I'm so sorry for my simple mistake.
The files are being created, I can find them when manually looking for them. The reason I thought they were not created is they don't show up in the default photo's app automatically.
I remember now that I had solved this issue before by calling the following function after the file is created, in order for the file to automatically show up in the photos app.
private void sendFileCreatedBroadcast() {
Log.d("DEBUG:", "sendBroadcast MEDIA MOUNTED");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
final Intent scanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
String filePath = "file://" + storePath + fileName + "." + fileFormat;
final Uri contentUri = Uri.parse(filePath);
scanIntent.setData(contentUri);
this.activity.sendBroadcast(scanIntent);
} else {
final Intent intent = new Intent(Intent.ACTION_MEDIA_MOUNTED,
Uri.parse("file://" + Environment.getExternalStorageDirectory()));
this.activity.sendBroadcast(intent);
}
}
So the issue has been resolved.
Thank you @pedroSG94 for your time.
It is good to know. I'm closing issue
Hi, thank you for this awesome library. I'll try to summarize my issue as succinctly as possible.
I'm getting the following error in the console when trying to stream and record to a file:
I'm using record-to-file code almost similar to: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/app/src/main/java/com/pedro/rtpstreamer/defaultexample/ExampleRtmpActivity.java
Here is a summary of my code:
I believe this traces back to this file: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/util/RecordController.java
Any idea what might be wrong?
Thank you very much, I hope that is enough information. -Ken