Open phial3 opened 15 hours ago
There are several issues in your code:
codec_context
, which is why codec_context.width
and codec_context.height
are both zero. You need to call codec_context.apply_codecpar(&stream.codecpar())?;
before opening the codec_context
.scale_frame(
should be zero since your image doesn't have stride: https://github.com/FFmpeg/FFmpeg/blob/2eef902d38dded68df7d874bc348aaa42ec87933/libswscale/swscale.h#L235packet
is None
.You can refer to the example here.
there's my code:
error info: