Giter VIP home page Giter VIP logo

Comments (5)

yellowcath avatar yellowcath commented on August 14, 2024

是的,很多手机的解码芯片不一样,解出来的yuv格式也不一样,兼容起来非常麻烦,而且处理起来会比较慢

from videoprocessor.

iBotasky avatar iBotasky commented on August 14, 2024

@yellowcath
我在实现一个倒放,倒放的实现我是这样,从一段视频的末端到前端去循环每两个I帧之间的Buffer,在把Buffer倒着去做Codec在Muxer,目前遇到的问题就是有些视频会出现UV数据好像错乱,但是我不知道怎么解决。。Surface模式好像不能这样处理。
我看到你的倒放的处理方式,全转成关键帧占用的空间变得很大,并且好像耕费时间。有其他的方案吗?

from videoprocessor.

yellowcath avatar yellowcath commented on August 14, 2024

用buffer也是一样的,因为解码必须是从前至后,所以要倒叙,你必须从某个关键帧一直往后解码到下一个关键帧,这中间的所有解码出来的帧都要缓存,然后倒着放入编码器,占用的内存也会非常大,所以最好仍然是先做一个全关键帧的中间视频,再行倒放

from videoprocessor.

yellowcath avatar yellowcath commented on August 14, 2024

如果一定要解决UV错乱的问题,推荐用MediaCode的getOutputImage,返回的是Image,里面成员变量有3个plane,plane0,1,2分别对应Y,U,V或者Y,UV,VU(可能2,3记反了),plane有两个属性,getRowStride,getPixelStride,第一个表示一行有多长,第二个表示隔多少取一个像素。所以这个数据处理起来是很麻烦的

from videoprocessor.

iBotasky avatar iBotasky commented on August 14, 2024

@yellowcath
OK,谢谢。
我的做法就是把buffer 保存到本地,做Encoder的时候逆序去取本地的Buffer。内存是没啥问题。目前看来还是只能用全关键帧的做法了。

from videoprocessor.

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.