Coder Social home page Coder Social logo

压缩无法播放 about videocompressor HOT 7 OPEN

fishwjy avatar fishwjy commented on July 2, 2024
压缩无法播放

from videocompressor.

Comments (7)

ZDZN avatar ZDZN commented on July 2, 2024

我也遇到这个问题了,问题主要是压缩参数,目标视频的宽高和码率,调整之后就可以了,但不清楚调整有没有什么规则

from videocompressor.

weixiao666 avatar weixiao666 commented on July 2, 2024

@ZDZN 你是怎么设置的啊,能发一下吗贴一下代码吗

from videocompressor.

biansemao avatar biansemao commented on July 2, 2024

看下是不是你的视频width,height属性,是不是有问题?
MediaFormat里面的width,height属性,只接受2的倍数的。不然就会报Android android.media.MediaCodec$CodecException: Error 0xfffffc0e 错误

解决方法:
在MediaFormat outputFormat = MediaFormat.createVideoFormat(MIME_TYPE, resultWidth, resultHeight);之前做判断,宽高改为2的倍数。
改为
if ((resultWidth & 1) == 1) {
resultWidth--;
}
if ((resultHeight & 1) == 1) {
resultHeight--;
}
MediaFormat outputFormat = MediaFormat.createVideoFormat(MIME_TYPE, resultWidth, resultHeight);

from videocompressor.

mingxin-yang avatar mingxin-yang commented on July 2, 2024

2的倍数也不行 @biansemao

from videocompressor.

baiyang666 avatar baiyang666 commented on July 2, 2024

@biansemao我也遇到了,不是所有手机都出现。压缩后140b

from videocompressor.

RamboMing avatar RamboMing commented on July 2, 2024

华为手Mate30 也是同样问题

from videocompressor.

Hn1993 avatar Hn1993 commented on July 2, 2024

遇到同样的问题 压缩之后无法播放

from videocompressor.

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.