当前位置:网站首页>Read H264 parameters from mediarecord recording
Read H264 parameters from mediarecord recording
2022-07-02 10:46:00 【Small waves-】
explain :
Many used to do a test project , Want to put android Mobile video access video server , This is how it works :
hold android The real-time video of the mobile phone is uploaded to the background forwarding server , The forwarding server packages the audio and video streams into IPC rtsp Server form , Streaming media connecting to mobile forwarding server is like connecting IPC The equipment is the same , Use rtsp Pull stream mode to get video stream .
So as to realize the mobile phone --- Forwarding server --- Video server —PC Two way communication of client .
This scheme is a simplified scheme , The mobile terminal is only responsible for packet capture playback and remote playback , The forwarding server only implements one rtsp Encapsulation does not have any other functions , Other modules are unchanged . The mobile terminal uses the top mediarecorder object , While recording echo , Pass audio and video on one side .
The mobile terminal needs to use a custom protocol to communicate with the forwarding server , Inform the server of audio and video parameters , Among them, it is very important to obtain video parameters .
how Get video parameters ? Actually ,mediarecorder(H264) The beginning of the recorded data of contains SPS and pps Parameters , Analyze it and take it out , And the same equipment 、 Obtained with the same configuration sps,pps It's all the same , Just get it when you start the interface , You don't need to get it later .
How to get H264 What about parameters? ?
Solution :
1、 Set the video decoding parameter of the recording to H264
2、 Skip the file header after obtaining the video data :
3、 The back is SPS and PPS:
This will find the video parameters , And then it's packaged , Tell the server .
Reference resources :
I seem to have written an article about sps,pps, At that time, I was doing h264 Slice transmission .
About :
qq:9611153 WeChat lgs9611153
边栏推荐
猜你喜欢
随机推荐
SUS系统可用性量表
Rapid prototyping
Merge ordered sequence
Introduction to MySQL 8 DBA foundation tutorial
判断数组中是否存在重复元素
Pytest framework implements pre post
Pywin32打开指定窗口
13. Semaphore critical zone protection
Retrofit's callback hell is really vulnerable in kotlin synergy mode!
Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
[pit avoidance guide] pit encountered using ugui: the text component cannot indent the first line by two spaces
STM32 and motor development (upper system)
Flutter环境配置保姆级教程,让doctor一绿到底
AI技术产业热点分析
07 data import sqoop
02-taildir source
Post disaster reconstruction -- Floyd thought
从MediaRecord录像中读取H264参数
[unity3d] nested use layout group to make scroll view with dynamic sub object height
js promise.all