I need to find the duration of numerous formats of audio and video files, in milliseconds. I've been searching around for a while, but I can't find anything that will let me do this. I'm using C/++ in Linux. Thanks in advance.
There is a MediaInfo SourceFourge project that shows this info. You can look in its code for that.
Related
I am working on "de-multiplexing a midi file", which means extracting all the the instruments played on channel at any moment in the song. I thought that the solution could be extracting the instrument played on one note at the time and store it in a data structure. I am supposed to use C++.
Does anyone know a good reference to start with? I have no idea about how to manipulate midi files using C++; I just read some good references about midi structure but no more.
You can take a look at JUCE. It has a lot of MIDI functions that may help you figure out what you need to know. You can also look here for a description of the MIDI file format.
I'm working on a sonification project where I have to track a colored object from my camera and play music if that object moves in different positions, e.g.: play music on the right speaker if the object moves right.
I've been looking for an audio library on internet, but haven't found a solution. I tried to use the BASS audio library, but I couldn't find any tutorials for it. I need to use BASS because I read that it has a multispeaker Option.
Does anyone know how to use this multispeaker option?
There are many options. I personally recommend you to use OpenAL or fmod.
I would recommend that you start by looking at the examples provided with the library. When you get to something that you don't understand, try going to the documentation page and searching for functions: http://www.un4seen.com/doc/.
If all else fails, try looking around on the BASS forum.
I found a solution using IrrKlang. With this library I can manage the 3D sound tracking project... I recommend to use this library, it's the most accurate and helpful that I found.
I want to make a screen capture utility, so far i am able to capture the screen in regular interval to get a numbered sequence of images and now i want to encode them to a video format preferably flv(because of good compression and web support)
....I tried the ffmpeg.exe for that reason but for some strange reason it did'nt work
on my vista ultimate...only the first picture is encoded while the rest -I dont know what happened to them.
Also I would prefer doing the encoding stuf programatically (using c/c++ library api if any for that purpose) rather than using tools as ffmpeg.exe and i am interested in encoding picture sequence to video not capturing contineouse video directly.
I searched through internet....there are lots of libraries and tutorial for converting between video formats but I did'nt find something usefull for my problem.
I am not verry proficient with video formats and sdk library, I just need a quick way to encode some pictures to video with some basic control (as time interval between two consecutive frames).
So can you help me with some pointers as to which library i should use and how(code fragment and little descriptive answer would greatly help) and please dont recomend any .NET solution I need to learn something out of this and dont want to apply some bruteforce approach to solve the problem.
Sorry for my english....and thanks in advance.
It appears that an .avi file can more or less directly be made of .jpg's:
An AVI file may carry audio/visual data inside the chunks in virtually any compression scheme, including Full Frame (Uncompressed), ..., Motion JPEG.
Also, something very similar has been discussed here before.
I have tried, in vain, to fetch the duration of a video file using c++. I'm on a Linux platform. How do I go about it?
Is there some file on my native file system where this information is stored, or does it move with the video file?
Google gives me every method on ruby, c# etc etc, but I haven't found any libraries for c++.
Give libavcodec a shot.
You can try to look at midentify source code. It's a tool that come with mplayer (http://www.mplayerhq.hu/). If you're too lazy, you can take it's output and parse it in your c++ application
So all I need is a simple function that sets it up (eating incoming PCM RATE (for example: rate near to 44100) It's channels (for example: 2) and -bits (for example: 16) and desirable 128 kb\s rate) and another one that takes PCM data and encodes it into pure MP3 frames.
I know it looks like a silly homework task but I assure you - it is not.
I hope it will be of help to all C++ developers starting with MP3s.
So can anybody please help me with that?
See the example I gave in your other question for the basic usage of Lame. It should contain everything you need.
It's a long time since i messed with this, but Lame lib contains all you need to do it, check out lame.h , there is some test code you could look into.
Personally, I'd be looking at ffmpeg's libavcodec. There's an example file containing an audio_encode_example which ought to be more or less what you're looking for.
See also this question.
Note that not all ffmpeg packagings include mp3 codec support (patent issues) by default, although there's usually some simple way of enabling it.
GStreamer should definitely be able to handle this.
If you are on Windows you can use the GStreamer Winbuilds to get started.