How to parse RTP H264 packet using FFMpeg [closed] - c++

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am new to this forum,
i hope someone can help me with my problem.
I need to convert RTP H264 packets using FFMpeg to BMP files, i have achieved the following until now :
-Reading H264 file and convert it to BMP files using FFMpeg.
-Receiving raw RTP H264 packets.
I would really appreciate if someone can help me decode RTP H264 packets using FFMpeg,
i have done lots of searchs over the internet, and found the following solutions:
libavformat using rtp_h264.c, i could not download the library anywhere, although the file is there, but no way to use it without downloading the library, can someone please provide a download link and an example if possible?
live555 using H264VideoRTPSource, after downloading the library, i did not understand how to use this code, should i instantiate the class? or inhert it? is there an example over the internet on using H264VideoRTPSource?
Is there any other way to do it WITHOUT reading all the standards (RFC3984 and RFC6184)
Thank you.

Related

How to create an avi file from scratch? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
My task is to create an avi file by saving n number of frames in c++ .
There are many inbuilt function which can be used to create .avi file as given in below link .
https://learn.microsoft.com/en-us/windows/desktop/multimedia/avifile-reference
Using them we can create our own avifile , one such example.is
http://www.wischik.com/lu/programmer/avi_utils.html
But i want to create it without using Windows.h and vfw.h as they are very extensive.
So i need to make my own function of avifilewrite , appendframes etc
But i can't find any reference link on internet .
Can anyone please explain how can i build avifile without using Windows.h and vfw.h .
Thank you ,
How to create an ... file ...?
You can use the standard file stream API to create a file. To write a binary file, you'll need to use an unformatted output function such as std::ofstream::write().
... an avi file from scratch?
The AVI format is specified by Microsoft: https://learn.microsoft.com/en-us/windows/desktop/directshow/avi-riff-file-reference
However, you can save a lot of effort by using an existing API.

How do I open and display a file with any file extension in C++? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I'm doing a program where I have to read information from a file and it can be a file with any extension. Do you know any way in C++ to read and display the information from a file different than the .txt extension?
There is actually no real difference that would be made by a file extension, so you can - in theory - open any file you want, for example by using std::ifstream. However, files that are not using a human-readable encoding (like txt/json/... files), you propably want to open it in binary mode (you can specify this to std::ifstream).
However, if you actually want some usefull information of some specific, not human readable file (like for example the dimensions of a images saved as a png file), you need way more detailled code. To read, for example, information from an png file, you have to open it in binary mode using std::ifstream, and then interpret the read bytes yourself to get any usefull information out of it. So you actually have to know how the specific file format you want to read is encoded, and need to have (or to implement yourself) a decoder for that specific file format.

How can I analyze file and detect if the file is in H.264 video format? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I write software C/C++ to recover deleted files, and I need to identify files according to their binary content, so my question is there a simple way to know if a particular file is H.264 format video? is H.264 has an signature?
I saw the code of FFMPEG here, but can it help me, how?
For those who encounter this question but are looking for a cli solution you can use ffprobe:
ffprobe -loglevel error -select_streams v -show_entries stream=codec_name -of default=nw=1:nk=1 input.mkv
Outputs:
h264
The problem is that H.264 is not a file format, it is a video compression standard, and as such it can be found in multiple file formats. You can have a .f4v encoded with H.264 as much as you can have .mp4 with H.264.
So, how do you solve your issue? Well, I strongly advise you to use a library that does that for you. libavformat, for example, should do the trick (check the AVStream and AVFormatContext structures, and the avformat_open_input function).
Now, if you absolutely want to do it without libraries, you can check out the documentation for each video container format that supports H.264 to see how to retrieve the encoding information of the video stream, but expect this to take you at least a month or two.
If you want to use FFmpeg - avformat_find_stream_info() should help you. An there is an example.

Can't use YouTube-dl to download specified bitrate [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
After needing something both easy and powerful that would allow me to download YouTube playlists and finding no better alternative, I've recently started using youtube-dl (with ffmpeg) in the command line. I'm currently in the process of playing around with and testing the quality of my downloaded playlists, but I've run into a problem converting a playlist to M4A audio at 192kbps. Here is what I'm using:
youtube-dl --extract-audio --audio-format m4a --audio-quality 192 --playlist-items 1-26 https://www.youtube.com/playlist?list=PLR3nWwHlZ9WBpi3uWsjSe6r1PiA8MTbnE
The --audio-quality 192 doesn't seem to be registering, even though the syntax seems right as far as I can tell, and when the audio files are downloaded and extracted, they consist of a whole range of different bitrates, from 189 to 254. Can anyone tell me why I might be having this problem?
According to the youtube-dl helpfile, for bitrate, you need to specify the K after 192. Otherwise it treats it as variable bit rate:
-audio-quality QUALITY Specify ffmpeg/avconv audio quality,
insert
a value between 0 (better) and 9 (worse)
for VBR or a specific bitrate like 128K
(default 5)
See: Post Processing Options in helpfile
UPDATE BASED ON COMMENT: There are open issues suggesting that ffmpeg does not report all the errors it faces when processing, particularly the mp4 (m4a) codec. See Issue 8230. An alternative format may be a workaround. Another workaround may be changing the system's mp4 codecs such that ffmpeg is happier with them.
If neither of these workarounds work for you, please post the output of running the command with the --verbose option so that we can see the debug info.
UPDATED SINCE DOESN'T AFFECT MP3s:
Since ffmpeg is known to have some mp4 codec issues, another thing you can try is use avconv and avprobe instead of ffmpeg and ffprobe as post-processors for youtube-dl. You can download the latest Windows binaries here: LibAV Windows binaries. Don't forget to add the executables to your PATH system environment variable so that youtube-dl can find them.
Then add the --prefer-avconv option in your youtube-dl command and see if it behaves better.
EDIT WITH KNOWN-BUG DETAILS:
It seems you may have tripped over a previously-missed version of this bug M4a Audio file post-processing skipped - While the developer has addressed the slightly different case in the bug description, it seems to occur in your case as well. It may be worth posting the details to the youtube-dl Github Issue Tracker.
Switching to a different format (like mp3) may be the only workaround at this point.

Writing data from buffer to wave file on disk [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm writing a program which play wave file using waveOutOpen and PlaySound. Now I must write a function to record voice from microphone in Wave file on disk. I use writeInOpen and waveInAddBuffer to record sound in buffer but i can't find an easy class to manipulate on wave file and copy buffer content to file .wav. Thanks for suggestions!
You have to create the file yourself.
You can use the Multimedia File I/O API, specifically at mmioOpen(), mmioCreateChunk(), mmioAscend(), and mmioWrite() functions. You need a good understanding of how the WAVE file format works, how the WAVEFORMAT/EX structures work, etc so you know which pieces to write and how to write them correctly.
Or use DirectX's DirectSound API, specifically the IDirectSoundCaptureBuffer8 interface and the CWaveFile helper class:
Writing to a WAV file
Until you have an understanding of either approach, you should consider using an existing library to do the hard work for you, for example:
Wave Class for Playing and Recording Wave Files