Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

感谢大佬的这个视频处理方式。有遇到视频合成出现黑屏现象 #24

Open
JackMayx opened this issue Dec 24, 2019 · 2 comments

Comments

@JackMayx
Copy link

JackMayx commented Dec 24, 2019

视频合成会有黑帧现象

@JackMayx
Copy link
Author

已经解决,给大家贴出来,后面有哥们出现这个问题了好直接用。
这个问题在于视频角度的问题。大佬把那个旋转角度的方式整错了。
以下为解决方式:

  • (CGAffineTransform)transformFromDegress:(float)degress natureSize:(CGSize)natureSize{
    /** 矩阵校正 a b c d /
    // x = ax1 + cy1 + tx,y = bx1 + dy2 + ty
    if (degress == 90 ) {
    return CGAffineTransformMake(0, 1, -1, 0, natureSize.height, 0);
    }else if (degress == 180){
    return CGAffineTransformMake(-1, 0, 0, -1, natureSize.width , natureSize .height);
    }else if (degress == 270){
    ///这个是大佬之前写的代码:-natureSize.height, 2 * natureSize.width
    /// 我修改为: 0, natureSize.width
    return CGAffineTransformMake(0, -1, 1, 0, 0, natureSize.width);
    }else{
    return CGAffineTransformIdentity;
    }
    /

    a 表示水方向的缩放
    tx 表示水平方向的偏移
    d 表示垂直方向的缩放,
    ty 表示垂直方向的偏移
    如果 b c 不为 0 的话,那么肯定发生了旋转。
    */

}

@lihaojie
Copy link

还有这个问题,一般压缩手机屏幕录屏的时候会出现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants