Recently studied the real-time video network transmission problem of Android, spent a lot of effort in video processing, summed up the following five sets of solutions, and compared
An example of a video transmission of the same size
Scheme |
compression rate |
compression/transport |
Realtime |
Average traffic consumption |
transmission distance |
sends the original YUV420 data with the camera's callback function |
0 |
uncompressed, transfer by frame |
high (20~30 fps) |
High (6.5 Mbps) too scary It's o_o. |
Close-up wired or wireless |
send H264 hard-coded yuv420 with Mediarecorder |
High (95%) |
inter-frame pressure Video streaming |
high (+ fps) |
Low (30~70 Kbps) |
can be long distance |
call local H264 encoding library (JNI) to a frame Yu V420 data encoding send |
high (97%) |
inter-frame compression, transfer by frame |
low (2 fps) |
Low (up to Kbps) |
Long distance |
compressed with gzip library for one frame of data sent (very wonderful practice) |
Higher (70%~80%) |
Intra-frame compression, transfer by frame |
Low (5 fps) |
High (3 (Kbps) |
Long distance |
Compress a frame of data in JPEG mode |
general (60% or so) |
Intra-frame compression, transfer by frame |
High (fps) |
high (in Kbps) |
can be long-range (bandwidth permitting) |
Note: Mediarecorder has a strong hardware dependence, so different mobile phone performance is not the same, some mobile phone data transmission when there will be blocking phenomenon, real-time reduction of
In summary, Scenario 2 (Mediarecorder) and Solution 5 (JPEG) can also be considered, because my project only need to be near-distance wireless transmission, and the hardware level is not high, so chose the scenario 5
The above plan is I recently more specific and in-depth study of real-time video coding and transmission scheme summed up, I hope that the study of video transmission friends can be used to reference!
"Go" Overview of the Android live video network transmission scheme (total five sets)