Selecting a library / framework for video capture & recording - ffmpeg

In one of the project that we have undertaken we are looking for a video capture & recording library. Our groundwork (based on google search) shows that vlc (libvlc), ffmpeg (libavcodec) and gstreamer are the three popular free and open source libraries / multimedia frameworks available for the same. How do these libraries compare on the following parameters:
Licensing policy to allow use within a commercial product without the need to open source any of the components of the product that is using the library
Ability to be used effectively in a multi-threaded environment (library should be inherently thread-safe)
Easy to use and maintain
Documentation: API should be well documented...this is relative...:)
Our primary intention is to be able to capture RTSP video streams (H.264/MPEG-2/MJPEG encoded), convert these streams to raw video / frames so that it can be used for analysis / processing and later on compress these frames and store it on the disk in the form of an MP4 file (using MPEG2 / H.264 encoding).
P.S. We understand that FFmpeg is also one of the components of vlc since vlc uses libavcodec library. Is the same true for gstreamer as well? Does it have any ffmpeg dependency?
Awaiting your responses.
Regards,
Saurabh Gandhi

I suggest you to use Gstreamer.
Gstremer is multimedia framework and it has so many plug-in for various task. Plugin are one type of library. And for Capturing rtsp , converting raw video , and muxing in mp4 all have i think you will easily find out the best plug-in in Gstermer. yOU just need to write one application for this.
1. Licensing policy to allow use within a commercial product without
the need to open source any of the components of the product that is
using the library
i dont know much about this
2. Ability to be used effectively in a multi-threaded environment
(library should be inherently thread-safe)
yea Gstremer internally take care for all threading.
3. Easy to use and maintain
yea Gstremer is easy to use and maintain
4. Documentation: API should be well documented...this is relative...:)
yea Gstremer has verry well managed documented API
No Gstermer framework has no dependency on ffmpeg.but Actualy gstremer has some plugin which are based on ffmpeg. that is gst-ffmpeg

Related

How to convert sequence of image file to video using c programming?

I am working on a V4L2 camera driver.The webcam taking number of sequence of image files.Now I want to convert it into video (mp4) file.How it is possible using FFMPEG/GSTREAM using pure c source code instead of ubuntu terminal command ?
GStreamer can be used to write applications using C. There are application guides available on their documentation site. But you need few extra topics related GObject as well to start using the framework.
I would recommend to go through their documentation site.
https://gstreamer.freedesktop.org/documentation/tutorials/index.html?gi-language=c
It is not that hard if you read through the documentation and they have lots of plugins available to to achieve quite lots of things related to audio/video processing.

HLS (Http Live Streaming) vs MPEG DASH

I am trying to find the differences between HLS and DASH, the two widely used streaming format.
Through my research, I took a look at the image that demonstrates adaptive streaming feature comparison.
I am uncertain about the HTML5 support.
Is MPEG-DASH the only streaming format that supports HTML5
or the below image is kind of old feature comparison?
Image for adaptive streaming feature comparison
The most important difference is probably that MPEG-DASH is a vendor independent, international standard ratified by ISO/IEC MPEG. Previous adaptive streaming technologies - such as Apple HLS – have been released by vendors with limited support of company-independent streaming servers as well as playback clients.
MPEG-DASH allows native playback with HTML5 as mainly the fMP4 container is used but recently also Apple added support for fMP4 at WWDC16. Nevertheless HLS is mainly used and supported with MPEG2-TS which cannot be natively played back with HTML5. There are solutions which transmux the MPEG2-TS segments in JavaScript into fMP4 and therefore allow native playback. These players include hls.js, which is open source.
DASH has some more advantages if you want to use DRM as MPEG-CENC is nicely integrated with this standard. Other things include more compact manifests through SegmentTemplate (in HLS each and every segment needs to be described an URL) which allows to specify a segment URL generation mechanism. The smaller size of the DASH manifest influences the startup delay. Other things that DASH specifies are how you could do failovers with BaseURLs that allow you host your content on several different locations and much more.
However, HLS is also widely used and it is not so complex and easier to implement. So if you do not need DRM, very high resolutions and bitrates (could have performance impacts when transmuxing in JavaScript) or some other specific DASH features its probably better to use HLS.
For DASH as well as HLS there are several services (e.g., zencoder) which could generate content and also open source solutions such as ffmpeg.

How to use Windows Media Foundation instead DirectShow Editing Services?

I am developing a non-linear video editor. I need to have the support timeline, mixing of audio streams, the transitions between videos, etc. These all features are in DirectShow Editing Services, but it is no longer supported in the new versions of Windows. Instead, offer to use Microsoft Media Foundation. Is it possible to implement the same functionality in the MF or is using other SDK? For example, gstreamer. Maybe someone will recommend SDK for video editing on the basis of MF?
With Media Foundation you have to implement it all by yourself. For instance: video trimming could be implemented by Source Reader to Sink Writer and you have to manipulate the samples manually to compare their timestamps with the required range etc. Trimming has been implemented in the MFCopy Media Foundation example already. MFCopy uses the Source Reader/Sink Writer approach, because this way the app has more control over the timestamps.
For a Windows 10 UWP App you can use the Windows.Media.Editing.MediaComposition class.

DivX Decoder libraries?

I saw, in an application from a major software vendor a dll called "DivXDecoder.dll" - which intrigued me as (a) it implies the existence of an easy to use divx library, and (b) I'd rather like to play divx compressed movies in a product I work on.
The DivX project itself seems to concentrate on making Codecs and tools for end users. Are there any C/C++ friendly projects that make playback of divx content in Win32 or Cocoa apps possible?
Look at mplayer sources - it uses the ffmpeg library that handles decoding from a number of formats.
DivX is a compressor that conforms to MPEG-4 Part 2. XviD and some versions of Windows Media are also implementations of the standard. So anything that can decompress MPEG-4 Part 2 should be able to handle things compressed with DivX.
As for actual decompression libraries, I'd recommend libavcodec. It's widely-used (= good support), cross-platform, and open-source (LGPL, so can be used in commercial apps). It's also fairly easy to use from it's C binding. It can open and play many different codecs (and with libavformat, handle many different wrappers i.e. avi, mkv, etc.).
If it's Windows-only, using the OS-provided Video For Windows might be a better option if you just want to play MPEG since you wouldn't need to ship it with your app and you avoid potential license issues. Be warned, though, that this requires the user to have certain codecs installed. On Win7 (and Vista I think) the MPEG codecs required to play DivX/XviD are installed by default, however they're not on XP...
Don't waste your time trying to implement DivX playback in a Cocoa application. Use QTKit. If someone wants to playback DivX content in your app they will install a DivX QuickTime plug-in.

Which video and audio format/codec should I use?

Environment: Windows XP/Vista, VS2008, C#/.NET 2.0, VideoGrabber.
Hi All,
I'm writing an app which captures cameras input and encodes them into a movie file (including sound).
My client suggests I encode the movie using the DivX codec. But it's not installed by default and it's not redistributable: Users would have to download, install and configure it themselves.
Is there a Codec available in default Windows (XP+) installations that I could use to encode video and sound? It must support compression. Ideally, I should be able to programmatically set basic configuration.
Note: I read this question but it doesn't actually address my needs.
TIA,
Is there a Codec available in default Windows (XP+) installations that I could use to encode video and sound?
About the best you can hope for is WMV2 (WMV v8). You may be able to encode it using qasf.dll.
The codecs you get for AVI in XP are all woeful efforts from the early days of ‘Multimedia PCs’: things like Cinepak and RLE, which are of zero use for modern full colour/resolution video, and Intel 4:2:0, which is only chroma subsampling, not really actual video compression.
If you need better than that you'll have to start embedding your own codecs, eg. from ffmpeg.
But it's not installed by default and it's not redistributable: Users would have to download, install and configure it themselves.
That's best anyway. Silently installing codecs onto a system is rather antisocial as there are often clashes between them and you could end up messing up other DirectShow applications. For example there are (at least) three different common DirectShow codecs that can handle “DivX” (which is really nothing more than MPEG-4 Advanced Simple Profile video plus MP3 audio in an AVI container): DivX, Xvid and ffdshow. Having more than one installed can be a recipe for bugs.
Not sure how useful this is to you, but I was trying to answer that very question just recently. This article suggests DIB, I420, or IYUV are supported on all platforms... at least in OpenCV. I had the least trouble with I420.

Resources