Hmm, that makes sense...though when I switch the order of the instructions or remove av_image_alloc, I get an unhandled exception (at 0x6C9280EA avcodec-55.dll access violation reading 0x.....). Thank you for taking the time to help me by the way.
On Thu, Apr 11, 2013 at 12:42 AM, Steffen Ebersbach-2 [via libav-users] < [email protected]> wrote: > > I'm wanting to grab the pixels from the screen, and encode that into a video. > The screenshot will save fine to a bmp file, but when I try and cast it to > work with encoding into a video, I get a swscale() src image error in my > output and the video file is just a blank white/gray screen. I made a topic > on > stackoverflow<http://stackoverflow.com/questions/15914012/encoding-a-screenshot-into-a-video-using-ffmpeg> > > <http://stackoverflow.com/questions/15914012/encoding-a-screenshot-into-a-video-using-ffmpeg> > where you can see the source I'm using. > > > > I mad this for a longer time and now it works. I will look at my code > later. But for the moment i think these two lines are wrong: > > avpicture_fill((AVPicture*)inpic, (uint8_t*)pPixels, PIX_FMT_BGR32, c->width, > c->height); > av_image_alloc(inpic->data, inpic->linesize, c->width, c->height, c->pix_fmt, > 1); > > you first copy the screenshot from pPixels to the AVpicture inpic, but > then allocat the AVpicture, so a empty frame gots to the encoder. > > > > _______________________________________________ > Libav-user mailing list > [hidden email] <http://user/SendEmail.jtp?type=node&node=4657240&i=0> > http://ffmpeg.org/mailman/listinfo/libav-user > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://libav-users.943685.n4.nabble.com/Encoding-a-screenshot-into-a-video-using-FFMPEG-tp4657231p4657240.html > To unsubscribe from Encoding a screenshot into a video using FFMPEG, click > here<http://libav-users.943685.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4657231&code=cGh1emU5QGdtYWlsLmNvbXw0NjU3MjMxfC05NjM0NDkwOTQ=> > . > NAML<http://libav-users.943685.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://libav-users.943685.n4.nabble.com/Encoding-a-screenshot-into-a-video-using-FFMPEG-tp4657231p4657249.html Sent from the libav-users mailing list archive at Nabble.com. _______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
