[Libav-user] sws_scale crash
YIRAN LI
mrfun.china at gmail.com
Mon May 20 02:05:17 CEST 2013
Hi, you can check if pixel format ever changes between frames. Once up a
time I also had a crash problem, which I later found is caused by pixel
format change.
2013/5/19 yy-zed <samhalligan15 at gmail.com>
> Hi Guys,
>
> I'm trying to figure out to cause of constant crashes on sws_scale calls.
> I'm reading in a video frame, decoding it, then trying to scale, encode and
> write to video. Reading the frame and decoding it seem to be working fine,
> but sws_scale keeps crashing.
>
> Here's where I set the context:
>
>
> p_codec_ctx
>
> =p_in_video_ctx->p_fmt_ctx->streams[p_in_video_ctx->i_video_stream_idx]->codec;
>
> p_out_video_ctx->p_sws_ctx = sws_getContext(p_codec_ctx->width,
> p_codec_ctx->height, p_codec_ctx->pix_fmt,
> p_out_video_ctx->i_vwidth, p_out_video_ctx->i_vheight,
> AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL);
>
> and here's where I make the call to scale the frame:
>
> debugLogR->debug("here1");
> sws_scale(p_out_video_ctx->p_sws_ctx,
> (uint8_t const * const *)
> p_in_video_ctx->p_video_frame->data,
> p_in_video_ctx->p_video_frame->linesize, 0,
> p_codec_ctx->height,
> p_out_video_ctx->p_video_frame->data,
> p_out_video_ctx->p_video_frame->linesize);
>
> debugLogR->debug("here2");
>
> here1 is printed, but the program exits with error code "-1073741819"
> before
> printing here2. Google tells me thats a general access memory violation.
>
> Has anybody got any ideas where I'm going wrong?
>
> Thanks,
> Sam
>
>
>
>
> --
> View this message in context:
> http://libav-users.943685.n4.nabble.com/sws-scale-crash-tp4657631.html
> Sent from the libav-users mailing list archive at Nabble.com.
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130520/9fefc021/attachment.html>
More information about the Libav-user
mailing list