1

I want to use h264_videotoolbox codec to encode my video in FFMPEG lib.I input image format is AV_PIX_FMT_YUV420P, but output video frame like follow.
I tried libx264 and all work correctly.
Do you guys know what happen?Why encoded frame like that?

enter image description here

enter image description here

My test code:
https://github.com/BeiKeJieDeLiuLangMao/videotoolbox

Resolution
Data should align to 32.

Community
  • 1
  • 1
Yang Chen
  • 55
  • 11
  • Resolution on the image is strange. Check whether that toolbox codec has certain limitations on sizes. Like, it may expect sizes are divisible by 8 or something. – the kamilz Jan 07 '19 at 07:20
  • @the kamilz Image what i feed to toolbox codec is 478 * 850, divisible by 2 is ok for libx264. I try to feed 478 * 850 video to ffmpeg-cli toolbox codec, it works. And there isn't any option to set size or something related in AVOptions of toolbox. – Yang Chen Jan 08 '19 at 02:49
  • I wonder what will happen if you supply 850x478 video. Worth trying.. – the kamilz Jan 08 '19 at 08:10
  • @thekamilz If i feed 850 * 480 image to ffmpeg native lib, output frame like above. – Yang Chen Jan 08 '19 at 09:29
  • @thekamilz I think maybe you are right.This issue maybe come with size problem.If codec handle this image as 300 * 850, it treat (400, 0)pixel as (100, 1), and output frame will like above.But i don't know why this happened, i set width and height (478 * 850) to AVCodecContext like what i do with libx264. – Yang Chen Jan 08 '19 at 09:37
  • Also check any orientation settings, like aspect ratio. – the kamilz Jan 08 '19 at 10:59
  • I tried, but nothing changed. – Yang Chen Jan 09 '19 at 08:19
  • I push my test code to github, would you mind to take a look? – Yang Chen Jan 09 '19 at 08:27
  • Data should align to 32, that solve this problem. – Yang Chen Jan 09 '19 at 10:37
  • Sorry I just noticed, busy day.. Anyway, so you solved the issue? – the kamilz Jan 09 '19 at 14:35
  • Yep, h264_videotoolbox expect data align to 32. – Yang Chen Jan 10 '19 at 03:09

0 Answers0