I'm trying to convert an YUV frame to RGB using libswscale.
Here is my code : AVFrame *RGBFrame; SwsContext *ConversionContext; ConversionContext = sws_getCachedContext(NULL, FrameWidth, FrameHeight, AV_PIX_FMT_YUV420P, FrameWidth, FrameHeight, AV_PIX_FMT_RGB24, SWS_BILINEAR, 0, 0, 0); RGBFrame = av_frame_alloc(); avpicture_fill((AVPicture *)RGBFrame, &FillVect, AV_PIX_FMT_RGB24, FrameWidth, FrameHeight); sws_scale(ConversionContext, VideoFrame->data, VideoFrame->linesize, 0, VideoFrame->height, RGBFrame->data, RGBFrame->linesize);
My program do SEGFAULT on the sws_scale (...)
I've written a program with OpenCV where I input a video, apply some processing to each frame, and then write each frame to an output file. The code I've written has worked perfectly with lots of video types such as mp4, but when I try to use an MTS video as the format, the program will run correctly, and "imshow" will let me see the video as its running, but the output video is corrupted and I cannot open it like I usually can.
I can upload more code if you like, but these are the main video writing areas of my code. VideoWriter output_cap("output.avi", cap.get(CV_CAP_PROP_FOURCC), (...)
How do I do that? I only know that you'd use FFMPEG, but I don't know exactly how. Also, in the process, can I resize the images and set the video's frame rate? By the way, I have imagick if that helps.
I've got a unique problem here!
UPDATE Interesting development; if I comment out ffmpegBufferedIn.Close(); below, the entire stream always goes through fine... the request just never ends. What could be going on here?
I'm writing a web service that stores audio files in Azure Blob Storage, and converts them to MP3 live when requested through my ASP.NET Web API endpoint. I accomplish this by using 'DownloadToStream' via the Azure Storage API, feeding that stream through the STDIN of an FFMPEG process, and sending the STDOUT stream as the request response.
The block of code that does (...)
ffmpeg -r 1/5 -start_number 2 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
This line worked fine but i want into image another folder. Image names in My folder: img001.jpg img002.jpg img003.jpg ...
How to into images from another folder? example: "C:\\mypics"
I tried this code but ffmpeg set video for first image (img001.jpg) only. ffmpeg -r 1/5 -start_number 0 -i C:\\myimages\\img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
Thanks for (...)
I am trying to extract thumbnail from sharepoint 2013 video library. I found a link which can extract using ffmpeg. this is the link: [How can I save first frame of a video as image? filename = "http://siteurl/" + items["FileRef"].ToString();
When i replaced the input file with sharepoint site url and video name then it does not produce any thumbnail. I also gives error on ffmpeg.Start(); ffmpeg.WaitForExit(); ffmpeg.Close()
I would like to understand how make it work for http url. If it is not possible to use url in ffmpeg can anyone suggest another method to achieve thumbnail.(as i (...)