Closed Arlem closed 8 years ago
Just a small update, I have made more tests and can now exclude that the size of the data written (1.5GB) or the number of .ts files are the culprit; all registration stopped at approximately 40 minutes, as before. Since it is a problem with FFMPEG, I will try to compile the newer version and go ahead from there.
I updated FFMPEG to version 2.7.1, no differences encountered.
@OnlyInAmerica Have you got a chance to look into this?
@Arlem I am having a hard time building FFMPEG 2.7.1 with rtmp. WOuld you be able to help? I want to use the native rtmp instead of librtmp.
I am able to separately build ffmpeg, openssl (using a different method than guardianproject's). I am not able to build librtmp. I am looking for a script that can build librtmp with my generated openssl. Any help would be appreciated
@Arlem I have also encountered this problem.Stoped at approximately 35 minutes every time.To reproduce the bug running at least 35 minutes. Have you solved it? Looking forward to your reply,thanks
Working properly before approximately 35 minutes, but after about 35 minutes it stop recording and log that: 08-27 23:58:05.158: E/FFmpegWrapper(28230): av_interleaved_write_frame video: 1 pkt: 60493 size: 8892 error: Invalid argument
@gouravd Sorry, I am using hls and haven't tried to build FFMPEG 2.7.1 with rtmp. @JajuanWang No solution found, do you have any guess?
@Arlem https://github.com/OpenWatch/FFmpegWrapper-Android/blob/master/FFmpegWrapper/jni/FFmpegWrapper.c on line 413 //packet->pts = av_rescale_q(packet->pts, *videoSourceTimeBase, (outputFormatContext->streams[packet->stream_index]->time_base));I was going to comment this line,because i need not to adjust the time base,I guess the problem is caused by the this.I have tried to verify it,but recompile the .so files failed
@Arlem and you can see the link http://www.ffmpeg.org/doxygen/2.0/mathematics_8c_source.html on line 130 int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq),I just known it is used to adjust the time base
@JajuanWang It fails when you run ndk-build.sh or build_ffmpeg_for_android.sh?
@JajuanWang I solved (this) problem! Open FFmpegWrapper.c, go to line 420 and modify the code from:
packet->pts = (int) jPts;
to:
packet->pts = (int64_) jPts;
Then, recompile the FFmpeg library and wrapper with
sudo ndk-build.sh
and copy the generated library in the correct folder of your project. I've done registration for more than 1 hour with this change. I have checked that the error originates from jPts being a jlong, which overflows when casted to int (at around 35-40 minutes). I don't know why it was casted to int, since pts is int64_t (as described by https://ffmpeg.org/doxygen/2.8/structAVPacket.html).
I have FFmpegWrapper.so and cant view or edit it. what would be the solution in this case. Thank you.
@Arlem can you please share the corrected and updated. .so files. Thank you
@dyoungjr08 This is my .so file of the FFmpeg wrapper (for armeabi and armeabi-v7a). libFFmpegWrapper.zip
Tell me if you need the other FFmpeg library also.
By the way, have you seen this project? https://github.com/OnlyInAmerica/FFmpeg-Android you might need to recompile on your own in the future.
Thank you. I believe I do need the others. Im getting this crash now when I try and start a stream:
04-13 22:43:33.562 25102-25102/com.peekatucorp.thePartyStarter I/Muxer: Created muxer for output: /storage/emulated/0/MySampleApp/1fd9e0d2-92de-45b1-883f-192b7a2554a0/index.m3u8 04-13 22:43:33.564 25102-25102/com.peekatucorp.thePartyStarter E/art: dlopen("/data/app/com.peekatucorp.thePartyStarter-1/lib/arm/libFFmpegWrapper.so", RTLD_LAZY) failed: dlopen failed: library "libavformat-57.so" not found 04-13 22:43:33.564 25102-25102/com.peekatucorp.thePartyStarter D/AndroidRuntime: Shutting down VM 04-13 22:43:33.565 25102-25102/com.peekatucorp.thePartyStarter E/AndroidRuntime: FATAL EXCEPTION: main Process: com.peekatucorp.thePartyStarter, PID: 25102 java.lang.UnsatisfiedLinkError: dlopen failed: library "libavformat-57.so" not found at java.lang.Runtime.loadLibrary(Runtime.java:371) at java.lang.System.loadLibrary(System.java:988) at net.openwatch.ffmpegwrapper.FFmpegWrapper.<clinit>(FFmpegWrapper.java:43) at io.kickflip.sdk.av.FFmpegMuxer.<init>(FFmpegMuxer.java:72) at io.kickflip.sdk.av.FFmpegMuxer.create(FFmpegMuxer.java:101) at io.kickflip.sdk.av.SessionConfig$Builder.<init>(SessionConfig.java:225) at com.peekatucorp.io.kickflip.sample.Util.create720pSessionConfig(Util.java:58) at com.peekatucorp.thePartyStarter.MainActivity.configureNewBroadcast(MainActivity.java:2141) at com.peekatucorp.thePartyStarter.MainActivity.startBroadcastingActivity(MainActivity.java:2134) at com.peekatucorp.io.kickflip.sample.fragment.StreamListFragment$4.onClick(StreamListFragment.java:241) at android.view.View.performClick(View.java:4786) at android.view.View$PerformClick.run(View.java:19897) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5300) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699) 04-13 22:43:33.566 25102-25102/com.peekatucorp.thePartyStarter D/AppTracker: App Event: crash
@dyoungjr08 These are the ones I am actually using. Let me know if they work ffmpeg+wrapper.zip
Hi, I am using sdk in my project and I am experiencing an error. I initially thought it was something related to the modifications I made to the sdk, so i tested your example app, but the problem still persists. The problem is that the index*.ts file stops being written and is not uploaded until the stop recording button is pressed. To reproduce the bug leave the device recording for at least 40 minutes. This is the resulting logcat (from Sony SGP611 on 5.0.2, I have another Logcat from Galaxy Camera 2 EK-GC200 with 4.3)
This always happened during writing of index214.ts (approximately 1.5 GB of data written), on Sony SGP611 5.0.2, Galaxy Camera 2 EK-GC200 with 4.3 and HTC ONE M7 5.0.2.
Hope this is enough, I can provide more info on different devices if you need, just tell me. Keep up the good work.
P.S. I removed most of the FFmpegWrapper because they added nothing useful and made the logcat less readable.