Comments (4)
There seems no difference between MediaCodec
and MediaRecorder
that way. Actually yasea needs some pre-processing on getting the YUV frames from the camera before sending them into the encoder like cropping, flipping and rotation. For instance, the original video data source in android is a landscape picture and what I want is a portrait one, then I need to rotate and may also flip the whole YUV frame.
COLOR_FormatSurface
can really work indeed. But if I do not know the specific color format, how do I make transformation of the YUV frames on pre-processing?
from yasea.
We don't need pre-process frames, at the output we get raw h264 (with COLOR_FormatSurface or another, it does not matter) from mediacodec. I noticed that when use COLOR_FormatSurface - SPS and PPS are not sent. I'm trying to add them (SrsRtmpFlv.writeSampleData()), but it still does not work
https://gist.github.com/Nook2007/92f460c87d8556d35ab5676f40a5e840
from yasea.
Where is your raw h.264 data from? Does it wrapped in the byte buffer returned by getOutputBuffers()
of MediaCodec
? Typically the SPS and PPS are wrapped in the IDR frame generated by the encoder if you do not miss them.
The gist code seems unreliable. The IDR frame is NOT always the first one from the encoder. See SrsFlvMuxer.java to find out the right way.
After all I am afraid I will not try your case on yasea for I am busy with other issues.
from yasea.
@Nook2007 我的也是H264的祼数据, 希望通过writeSampleData来推流, 没有成功, 请问你怎么解决的呢
from yasea.
Related Issues (20)
- How to introduce it in Android Studio? HOT 1
- Can we use .acv file in filter? HOT 1
- Add APK to releases HOT 1
- 请问如何获取camera的流(帧)呢? HOT 1
- 请问如何无预览推流呢?
- 推屏幕 HOT 1
- 测试低带宽出现Network weak HOT 2
- 如何支持RTMPS HOT 4
- 小屏幕推流导致拉流清晰度低 HOT 6
- 推流成功几分钟后就闪退
- 空指针异常 HOT 3
- Error in decoding the stream when using Hardware Encoder HOT 2
- 华为meat40 pro中切换摄像头报错
- 安卓11和12框架使用问题
- Heavy pixelated video
- 推流界面处于onpause状态时怎么让摄像头继续采集数据 HOT 1
- Is Streaming possible over 5G? HOT 1
- Video streaming paused when screen locked HOT 1
- 收音问题 HOT 7
- 推流的视频很糊 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yasea.