Данные кадра уже закодированы в I420 и не требуют преобразования.
Вот что я пытаюсь сделать:
Код: Выделить всё
const char *frameData = /* Raw frame data */;
x264_t *encoder = x264_encoder_open(¶m);
x264_picture_t imgInput, imgOutput;
x264_picture_alloc(&imgInput, X264_CSP_I420, width, height);
// how can I fill the struct data of imgInput
x264_nal_t *nals;
int i_nals;
int frameSize = x264_encoder_encode(encoder, &nals, &i_nals, &imgInput, &imgOutput);
Код: Выделить всё
x264 --output video.mp4 --fps 15 --input-res 1280x800 imgdata_01.raw
Спасибо.
Подробнее здесь: https://stackoverflow.com/questions/282 ... frame-data