Encode loopback capture data in mp3 using ffmpeg in VC++ - c++

I'm trying to work on loopback capture(What you hear) and record this file in mp3/aac format using VC++.
->I can capture audio and can create a .wav file i.e. not compressed but I want a compressed file so I'm encoding this through ffmpeg to write an mp3 file not a .wav.
However I'm not getting any way to do it directly?
I referred this for loopback capture.
Please share your experience and opinions.
Thanks!

Related

Get encoding of audio track

Suppose I have .3g2 file. I noticed, they can contain audio track of different encoding (AAC, AMR).
Or, for example, an .m4a file can contain (AAC or ALAC) encoded audio track.
MediaInfo detects it pretty well, but I want to be able to do that using C++.
My question is, how can I detect the type of the audio track in a media file?
Thanks.
MediaInfo is also available with a C++ interface, just download MediaInfo library package, and here is a C++ example.
For getting the first audio track format: MediaInfo::Get(Stream_Audio, 0, "Format")

Saving recorded audio as .wav via openAL

I am trying to record audio using C++ with openAL and save it as .wav file, so far i suceeded with first part, but can't find a way to save audio in a file. I read documentation and didn't find any way to do so. Am I missing something?
To save a *.wav file, you don't really need OpenAL. Look at the *.wav type-specifications, which are all over the web. You have just to create a header which describes your data and paste in your recorded data.

Are wave files better candidate for steganography than mp3?if so then why?

I read about wav file format and found too many projects of steganography based on it but didn't found that much projects based on mp3 though it is found more frequently on web than wav.
The wav format is uncompressed audio with no formatting headers. You can change a few bits in this format without significantly affecting the audio; you will not break the file format and a listener will not be able to tell the difference between the original file and the modified one.
The mp3 format is compressed audio. If you change bits in mp3, you run risks:
You modify a header and the audio no longer plays back
You modify the audio, and a listener can tell the file is weird. The audio is compressed, so changes in the audio data get magnified upon decompression.

Finding Bitrate of video file

How can we find bitrate of a video file in c++? Can we do this by file handling?
Thanks
Install FFMEPG it will give you all the information related to the video
e.g.
ffmpeg -i filename.flv
If you want to implement such yourself you need to be able to read the video container format (Quicktime, ASF, AVI, Matroska etc) and try to find the bitrate from the metadata.
You can use ffprobe from the ffmpeg project to get the information about your video files and get a nice JSON ouput.
Check this answer for an example.

Creating web-browser playable webm files with vp8 SDK?

I'm using the vp8 SDK (www.webmproject.org) to create a vp8-encoded video file. However, the SDK sample produces an IVF file, which the browser doesn't play.
I know the webm format is a matroska container so I guess I should store the video data in that format, but the mkv format specification is lengthy and complex and I don't think I should reinvent the wheel by figuring it out by myself.
So I would like to know if someone can recommend a sample of how to encode and produce a playable webm vp8 file.
If there is no such sample (as my searches on google suggest) at least point me to a simple and usable matroska lib which is proven to work for the browsers.