Giter VIP home page Giter VIP logo

Comments (4)

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

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.

Nook2007 avatar Nook2007 commented on May 18, 2024

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.

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

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.

lynx-liu avatar lynx-liu commented on May 18, 2024

@Nook2007 我的也是H264的祼数据, 希望通过writeSampleData来推流, 没有成功, 请问你怎么解决的呢

from yasea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.