Crop video in iOS see weird green line around video

后端 未结 2 497
[愿得一人]
[愿得一人] 2020-12-30 12:37

Hey everyone I am cropping a video taken from the camera on iPhone and then cropping it an playing it back like this. When i do it however I get a weird green line around th

2条回答
  •  孤独总比滥情好
    2020-12-30 13:10

    There are width requirements for either the iOS encoders or the video format itself. Try making your width even or divisible by 4.

    I wasn't aware of there being a similar requirement for height, but that could be worth a try too.

    I've never found it documented, but requiring evenness makes a certain amount of sense as h.264 uses a 4:2:0 yuv colour space, where the UV component is half the size (in both dimensions) of the Y channel, which has the overall dimensions of the video. If those dimensions weren't even, the UV dimensions wouldn't be integral.

    p.s. the hint in these cases is the mysterious green colour. I think it corresponds to 0, 0, 0 in YUV.

提交回复
热议问题