<div dir="ltr"><div>Actually av_image_alloc() should set it for you so you shouldn't need to set it yourself.<br><br><br></div>Gabriel.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><br><a href="http://lives-video.com" target="_blank">http://lives-video.com</a><br><a href="https://www.openhub.net/accounts/salsaman" target="_blank">https://www.openhub.net/accounts/salsaman</a><br></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Apr 18, 2018 at 10:49 AM, salsaman <span dir="ltr"><<a href="mailto:salsaman@gmail.com" target="_blank">salsaman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>linesize should be w * 4 for ARGB I think.<br><br></div>Gabriel.<br></div><div class="gmail_extra"><br clear="all"><div><div class="m_-7373039253112481280gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><br><a href="http://lives-video.com" target="_blank">http://lives-video.com</a><br><a href="https://www.openhub.net/accounts/salsaman" target="_blank">https://www.openhub.net/<wbr>accounts/salsaman</a><br></div></div></div></div></div><div><div class="h5">
<br><div class="gmail_quote">On Wed, Apr 18, 2018 at 2:04 AM, Valeriy Shtoma <span dir="ltr"><<a href="mailto:shtomavaleriy@gmail.com" target="_blank">shtomavaleriy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi to all dear developers,<br>
<br>
I want to convert QImage to AVFrame and than push it to<br>
filter. But when I pushed AVFrame, I got an error:<br>
<br>
 [in @ 0x11c71c200] Changing frame properties on the fly<br>
is not supported by all filters.<br>
<br>
and than<br>
<br>
 [libx264 @ 0x10ea52c00] Input picture width (640) is greater<br>
 than stride (0)<br>
<br>
But in this case my picture 1280x720...<br>
I know, that my code wrong(not correct pointers and linesize)<br>
What I’m doing wrong?<br>
<br>
My code:<br>
<br>
Varian 1:<br>
AV_PIX_FMT_ARGB or AV_PIX_FMT_RGB32<br>
<br>
QImage img = ...;<br>
 AVFrame *frame = av_frame_alloc();<br>
 avpicture_fill((AVPicture*)fr<wbr>ame, img.bits(), AV_PIX_FMT_ARGB,<br>
 img.width(), img.height());<br>
<br>
Variant 2:<br>
AVFrame *frame = av_frame_alloc();<br>
av_image_alloc(frame->data, frame->linesize, w, h, AV_PIX_FMT_ARGB, 1);<br>
frame->width = w;<br>
frame->height = h;<br>
frame->format = AV_PIX_FMT_ARGB;<br>
frame->linesize[0] = w;<br>
av_image_fill_arrays(frame->da<wbr>ta, frame->linesize, (uint8_t*)img.bits(),<br>
 AV_PIX_FMT_ARGB, w, h, 1);<br>
<br>
Thanks for attention. :)<br>
<br>
Kind Regards,<br>
Valeriy V Shtoma<br>
______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/list<wbr>info/libav-user</a><br>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>