how to convert sequence of jpeg image into video format? - c#

hi
I am developing a video capture application using C#.net. i captured
video through webcam and saved it as a JPEG images then i want to make a
wmv file with those images. how can i do that what are the basic steps needed for that can any body help

I am working on this myself. I have found two ways that may be possible - both require the purchase of an outside library.
The first one looks to be the easiest but costs the most, although it will allow you to use it for free you will just have to deal with a pop up telling you to purchase the library: http://bytescout.com/products/developer/imagetovideosdk/imagetovideosdk_convert_jpg_to_video.html
The other involves using Microsoft Encoder 4. I am still working on this one. You can get the free version here: http://www.microsoft.com/download/en/details.aspx?id=18974
C# doesn't natively support much in the way of sound or video so outside reference assemblies seem to be a necessity.
Right now that is the best help I can offer until I figure it out.

Related

Extracting mp3 audio file from youtube video in C#

I am building a program(in C#) and I need to download the audio from a youtube video(using the URL). I found two libraries which allow me to do it:
YotubeExtractor and libvideo(Also known as VideoLibrary), but I don't know how to use them, I mean I tried using their documentation but non of them worked.
Do you know another way which I can download or maybe explain me how to do this?
Thank you and have a nice day!
Don't use other people's code unless it's large and popular or your only option, I recommend, so that you both learn more and know how it works, as well as know how to maintain it if it breaks.
Retrieve the page using standard .NET functionality, parse out the HTML to find the video URL, download it using the same standard functionality, and then convert it to MP3 as a separate logical unit of your software.
For converting to MP3 you may well want to use someone else's library or call an external program like FFMPEG since that's not as trivial as parsing a webpage.

Raw H264 to JPEG, in C#

I get a stream of frames, an initial SPS and PPS h264 data packet and then packets for the I and P frames.
Using c# .NET I want to convert into a series of JPEGs? Has anyone done this?
I have tried AForge.NET FFMpeg wrapper, but can only go from MP4 file to JPEGs?
Also looked at DirectShow.
I can't seem to find an examples that even come close to doing this?
Thanks
In Directshow, it sounds like you need to introduce a SampleGrabber filter into your filter graph. Insert this after the H264 decoder.
This is a pass through filter which can receive a callback containing each video frame. You can then obviously choose what you do with the frame, is save it to disk as a jpeg etc.
Rather than regurgitate MSDN, there is a great page explaining its usage here:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd407288(v=vs.85).aspx
Update taking account of Roman's comments:
SampleGrabber is deprecated as its part of Directshow Editing Services. However, it is quite self contained. If it was removed from a later version of Windows it would be straight forward to replace with an alternative filter. I still use it in one of my consumer applications. Roman is correct though - it has a steep learning curve.

Video editing without media library

Is there a way to edit videos using c# without using a media library eg. Microsoft Expression Encoder etc.
Just need to be able to cut out unwanted parts or insert other videos into a specified time of the original video.
Can I edit the raw video file by perhaps converting it into a binary file and then cutting/pasting the code?
Most video formats have a container and a codec--that might be a good place to start
http://www.pitivi.org/manual/codecscontainers.html
If one were interested in implementing a program modifying video sans libraries a good place to start might be looking at the existing open source video libraries(eg FFMPEG https://www.ffmpeg.org/download.html ) as a reference
No there is no way to edit a video without using anything that would be considered a "library". You either must write your "library" or use a existing 3rd party one.
The only thing that could possibly not be thought of as a "library" is a full external tool that does what you want and your code would just be a front end GUI for it. For example writing a GUI front end for FFmpeg.

Processing images without GDI+ in C#

For some reasons, I need to write few image processing functions without using GDI+. I need to be able to do the following operations on images.
Draw some shapes on existing images (mostly rectangle with a plain background color). Regularly i do this using Graphics.DrawImage() function in GDI+.
Draw texts on existing image. Regularly I do this using Graphics.DrawString() function in GDI+
Save image to MemoryStream. Regularly I do this by Image.Save(stream, imgformat) function in GDI+
Get image bytes. Regularly I do this by MemoryStream.ToArray() function. I need bytes because I need to be able to send image to HttpContext() using the context.Response.BinaryWrite(imageBytes) method.
I've already looked at AForge.net, but it is missing Image.Save() method. It uses native Bitmap.Save() method of GDI+. So I seem to have no way of surviving GDI+ with AForge.
I've also looked at OpenCV and its .NET wrapper Emgu, but after 2 days of hard try, I was not able to successfully integrate the project into my own project (I know this sound silly, but that is truth. Following all the tutorials, probably 20+ SO posts on this did not help, because my solution structure is a little bit more than (more complex) a regular solutions).
How can I achieve this? Show me some way please. Have you even found yourself in such a situation (situation where you need to process images, but no GDI+)? What are the other libraries that could help me?
There's a recent project that's gathering momentum called, appropriately, "ImageProcessor": https://github.com/JimBobSquarePants/ImageProcessor - NuGet reports over 344,000 downloads as of June 2016.
Scott Hanselmann did a feature on it about 8 months ago, explaining the motivation given that .NET Core does not have System.Drawing (and I note that Windows Azure does not officially support GDI in Website Roles): http://www.hanselman.com/blog/RFCServersideImageAndGraphicsProcessingWithNETCoreAndASPNET5.aspx
I just attempted to answer a similar question here:
server-side graphics generation in .net/c#
Adding any other vector graphics (and layout) would be quite simple as well. Let me know if you would like a sample project or code.

Retrieve some part of video without using software. Is it possible?

I am working on a project which is related to videos.
I need to cut part of a video (I want to retrieve that part of video which lies from 00:30:00 to 00:40:00).
I have searched about it and found it can be done by using ffmpeg (This is a command line tool which is used to edit and convert videos.) But I don't want to use any tool.
Is it possible to do this with code, rather then with another tool?
If what you actually want is to build the capability to cut samples out of existing video material into a .net program the splicer project might be what you're looking for.

Categories