<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>Hello,</div>
<div> </div>
<div>I try to encode raw video data with the Motion JPEG codec of ffmpeg.</div>
<div> </div>
<div>At first I tried encoding with the pixelformat AV_PIX_FMT_YUV420P.</div>
<div>But MJPEG doesnt support this format, so opening the codec context failed.</div>
<div> </div>
<div>Then I tried encoding with the pixelformat AV_PIX_FMT_YUVJ420P.</div>
<div>I could open the codec and the sws_scale pixelformat-conversion from AV_PIX_FMT_RGB24 to AV_PIX_FMT_YUVJ420P works as well, but the avcodec_encode_video2 function failed (runtime error: Integer division by zero).</div>
<div>Also ffmpeg creates the following warning: deprecated pixel format used, make sure you did set range correctly.</div>
<div>Modifing the srcRange and dstRange values of my SwsContext via sws_setColorspaceDetails did not affect the outcome.</div>
<div> </div>
<div>My configuration perfectly works for other codecs like H264, HEVC and VP9.</div>
<div>What am I doing wrong?</div>
<div> </div>
<div>Best regards</div>
<div> </div>
<div>Felix Schillmaier</div>
</div>
</div></div></body></html>