Leo Ma
b2ec6c8e55
Fix MP4 recording bug
...
AV tracks and samples should be cleared when recording finishes.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
6c922d3026
Open x264 preset setting method from JNI
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
3b79c48a0a
Remove unneccesary log
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
50f364b356
Add YUV sampling FPS detect
...
Some android cameras have low sampling fps therefore the output fps is
not large enough for streaming.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
eed0b14a3e
Promote output fps for x264
...
Use "superfast" as the presetting and ABR as bitrate control.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
73a65b9e4d
Open multi-threaded feature of x264 for Android
...
In NDK lpthread is integrated into libc, so the configuration should
check libc instead of lpthread as the condtion of multi-threaded option.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
f947fb5f10
Not repeat nal headers in x264
...
Repeat nal headers in front of each I-frame will produce lower output fps.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
1e49d04a39
Fix soft and hard encoding selection bug
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
b87bc2d616
Add configuration header
9 years ago
Leo Ma
6d10b3915a
Process video in UI thread for less CPU occupation
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
945d9961fb
Update UI for encoder switch
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
c840be301f
Set the encoding resolution as 32x for MTK codec
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
d3d3135aa7
Add x264 for soft encoding
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
903c655e7b
Add camera focus mode
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
f876d48687
Set color format for camera always be NV21
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
f7f52cef57
Fix GetDirectBufferAddress bug in jni for Nexus
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
4fbb1328a3
Fix libyuv mirror flipping and rotation
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
358b4e9e96
Add libyuv
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
e5179d4a31
Change mime type macro into constant string
...
For Android API compatibility.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
2042e33305
Clear warning
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
c9c5ee8816
Select proper resolution for 16:9 screen ratio
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
9607b4f34d
Fix camera surface view binding
...
Surface view will be destroyed on pause and should be reset to camara on
resume.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
25bca4aee4
Compress Mp4parser utility
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
317a8c640a
Fix orientation setting bug
...
We should explicitly indicate the enum value of camera orientation since
there is still an UNKNOWN value which is an exception.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
25ab6f385f
Change UI layout as full screen
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
a72cdd0fe5
Separate YUV porcessing from UI thread
...
Huge amounts of calculation.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
35515cbd8f
Remove zip file
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
c278d6e50f
Fix compiling bug
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
7a31662ab5
Merge branch 'mp4-storage'
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
fe6351f5f6
Layout simplification
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
093d1eb65b
Seperate encoder and muxer
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
232f3e632a
Add onpause and onresume handler of recording
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
89d5f72f8e
Reset bool flag on stopping recording
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
2a8bbbe5f3
Add pause recording function
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
b2b4b3f75b
Recording while streaming
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
a8b3856b97
Use return of write as file size calculation
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
db8610e945
Fix mdat size bug
...
Use volitale for counting.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
1d0580e1c8
Fix recording video frame size bug
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
3081b3805e
Video is OK
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
4ef6381338
AAC is OK
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
bb3ca01edd
Update
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
540a40c2f5
Publishing under dynamatic orientation
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
b086328590
Add recording event handler
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
3a24aaf221
MP4 file muxing
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
281bd83006
Update
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
8a4adc545b
Fix bug
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
a4ee06a9de
Directory adjustment
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
a987d9bd10
Add MP4Parser library
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
91dac74d9e
Modify sea into yasea
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
5ee43c681e
Final patch for RTMP timestamp
...
Extended timestamp in chunk type 3 should not be forgotten.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
9e35f22b7f
Fix extended timestamp
...
Once the extended timestamp is sent, the subsequent extended timestamp
should always be sent.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
848b0763b9
Better interface
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
bbd0e7df2f
Add metadata on publishing
...
Video resolution set method.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
0307650290
Fix key frame interval setting
...
The unit of the parameter is second(s) not number of frames.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
a9cdb36a66
Fix connection packet format
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
4111df5876
Add property length info to AmfMap writing
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
4ec88b7131
Add video output FPS dectection
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
be1b7d888b
Fix type cast bug
...
In the '_return' of connection, the 'data' property could be amf0 number
type if there is only version field or amf0 object type if there is
special information. We need to probe the type on receiving it.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
18a1358534
Supplement get methods of publisher
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
205e72a234
Complete reset on connetion shutdown
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
e95be5335b
Reduce target sdk version for android M (API 23)
...
Class library Camera could not run on android M.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
d071b6ed8d
Retrieve server ip/pid/id on connection if any
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
b5e39cb218
Revert onMetaData sending
...
That is an issue on Nginx-RTMP. The test showing there is no video stream
downloaded to the player through it with onMetaData function and being all
right without it confuses me quite a lot. Due to some users' complain, I
decide to revert onMetaData in repo and continue research in the future.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
882ce15d3e
Fix streaming on nginx-rtmp
...
Nginx-rtmp module needs extra special AMF0 data including @setDataFrame
string field, onMetaData string field and a null AMF0 null object before
AV streaming.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
71a7e51940
Remove unnessary condition in SrsFlvMuxer stop
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
04c831146d
Add event handler for RTMP
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
7281158f1c
Fix RTMP packet timestamp marking
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
cc08c9f399
Fix timestamp mark
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
0e2e7e5e80
Connection process synchronization
...
1. Add timeout in waiting for connection failure.
2. Do not use wall time for timestamp in case of overflow.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
d418715673
Encapsulate `SrsRtmpPublisher` into `SrsRtmpFlv`
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
1178a1be3a
Adjust video frame cache size
...
Just cache GOP / FPS seconds data according to latency.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
d42d01a742
Adjust video frame cache number to GOP x 2
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
6a7bc1afd9
Fix RTMP packet timestamp
...
Use relative time instead of wall time as packet timestamp.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
d999b08765
Rename
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
4cb3ab0811
Adjust GOP and FPS parameters
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
576e6537a2
Generate random RTMP URL to avoid conflict
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
624b84b94a
Adjust FPS and GOP parameters
...
GOP indicates the interval frames of I-frames which have larger sizes
than P-frames have. And therefore the larger GOP setting comes with less
bandwidth overhead. For instance, GOP=60 and FPS=15 means every 4 seconds
comes with an I-frame which is better for pictures with less movements.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
95902f5ccf
Optimization for YUV transformation
...
Cropping ahead of flipping and rotation.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
6307f6c5ad
Camera size validity check
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
e082e3ba2e
Clear queue while shutting down
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
fd7eb0566d
Streaming parameter adjustment
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
5930749228
Simplification
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
5f37bd808b
Fix socket and thread close method
...
1. Use boolean flag in write thread to avoid InterruptedException while
it is blocked and use interrupted flag in read thread.
2. Do NOT close input stream in read thread and output stream in write
thread when shutting down. socket.close() will handle it automatically.
Otherwise SocketException will be raised in the corresponding thread.
3. Do socket.shutdownInput() before ending read thread and capture
EOFException which may be the only correct way to return the blocking
input stream read method.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
33f3195c7a
Fix NullPointerException
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
e4340b09ee
Handle return to home page by onPause
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
9bc3bc2e73
Replace Looper with Queue for less CPU overhead
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
73c6c8e451
Add video cached frame counting
...
To check networking situation according to cached frame counting.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
236636ca74
Handle InterruptedException by Thread.interrupt()
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
2b83e5656d
Use runOnUiThread to process exception
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
e54db1cd8b
Use ConcurrentLinkedQueue to reduce CPU overhead
...
Since isEmpty method of ConcurrentLinkedQueue may take some time, and
therefore it would not detect new elements offered, we have to wait a time
out to ensure ConcurrentLinkedQueue can detect new elements.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
e89a5caf12
Replace ConcurrentLinkedQueue with Looper & handleMessage
...
ConcurrentLinkedQueue may have some bug since the queue is still empty
while elements have been added into it.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
62bb4823c4
Add DefaultUncaughtException for global error processing
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
ff98ae24c6
Synchronize thread extermination
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
bb6d7e00e3
Sleep in RTMP reading thread
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
f30393bd81
Force resolution stride for hard encoding
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
0022325e57
Fix color format yuv420 plannar transformation bug
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
aec2257fdd
Fix index out of bound bug
...
When processing Cb and Cr component In yuv420planner frame, the length
of width and height should be half of that in Y component.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
bcb8d641c6
Fix RTMP connection sequence
...
The createStream response from the server may come after onFCPublish.
Therefore we have to wait until onStatus containing NetStream.Publish.Start
status code arrives.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
1100bd2b5f
Remove EditTextChangedListener to reduce CPU overhead
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
fc7991c220
Fix bug
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
7c7e428585
Fix encoding PTS bug
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
ecf26cef4c
Fix importing bug
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
3d7a4a0da3
Add Acknowledgement packet decoding support
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
e087e07e85
Fix SetChunkSize command bug
...
The chunk size of RTMP packet means two things: When the SetChunkSize
command comes from the server, it changes rx chunk size of the peer
while the tx chunk size still stays unchanged.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
2e751b2027
Change app name
...
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
9 years ago
Leo Ma
a2a499efb8
Have fun
9 years ago