GithubHelp home page GithubHelp logo

Comments (4)

pedroSG94 avatar pedroSG94 commented on June 3, 2024

Hello,

You have a filter that allow you to crop the video as you want but this affect to stream, record and preview:
https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/utils/FilterMenu.kt#L158

from rootencoder.

Miles087 avatar Miles087 commented on June 3, 2024

Hello,

You have a filter that allow you to crop the video as you want but this affect to stream, record and preview: https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/utils/FilterMenu.kt#L158

Thank you very mush, I mean when I preview normal frame, and recording a normal video, at the same time record a new video with crop. Do you have any idea to resolve it?

from rootencoder.

pedroSG94 avatar pedroSG94 commented on June 3, 2024

Hello,

By default the library no allow record 2 videos at the same time. You can modify the library to do it but this could be difficult.

I think this could work:

  • Create a new GlStreamInterface and a new VideoEncoder (of course you need to handle with lifecycle of both classes)
  • Link VideoEncoder with GlStreamInterface (You can check StreamBase class)
  • Add a SurfaceManager to OpenGlView and link that SurfaceManager to the GlStreamInterface created (similar to https://github.com/pedroSG94/RootEncoder/blob/master/library/src/main/java/com/pedro/library/view/OpenGlView.java#L277)
  • Render the new SurfaceManager in draw method like others SurfaceManager
  • Create a new AndroidMediaMuxer class
  • Record the video using video data from the new VideoEncoder and reuse current audio data (duplicate the ByteBuffer is a good idea to avoid problems)
  • Add the filter to GlStreamInterface
  • You also need to do all code related with release all when you don't need it anymore

This feels difficult, so maybe the best idea is find a library that allow you modify the video as you want and create a new video modified when you call stopRecord.

from rootencoder.

Miles087 avatar Miles087 commented on June 3, 2024

Hello,

By default the library no allow record 2 videos at the same time. You can modify the library to do it but this could be difficult.

I think this could work:

  • Create a new GlStreamInterface and a new VideoEncoder (of course you need to handle with lifecycle of both classes)
  • Link VideoEncoder with GlStreamInterface (You can check StreamBase class)
  • Add a SurfaceManager to OpenGlView and link that SurfaceManager to the GlStreamInterface created (similar to https://github.com/pedroSG94/RootEncoder/blob/master/library/src/main/java/com/pedro/library/view/OpenGlView.java#L277)
  • Render the new SurfaceManager in draw method like others SurfaceManager
  • Create a new AndroidMediaMuxer class
  • Record the video using video data from the new VideoEncoder and reuse current audio data (duplicate the ByteBuffer is a good idea to avoid problems)
  • Add the filter to GlStreamInterface
  • You also need to do all code related with release all when you don't need it anymore

This feels difficult, so maybe the best idea is find a library that allow you modify the video as you want and create a new video modified when you call stopRecord.

Sorry for reply late, I use OpenCV clip and record frame at the same time. For now it seems working : D

from rootencoder.

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.