WriteAudioFrame for adding audio in VideoFileWriter?
Hi, I´m working with your framework part Accord.Video.FFMPEG.VideoFileWriter. And I have a question or issue!?
The function WriteVideoFrame ist working well. But WriteAudioFrame is not so easy.
I would like to create a Video out of pictures and add a Audio stream. Let´s say 20 Pictures and framerate is 1. So i got a 20sec movie.
Accord.Video.FFMPEG.VideoFileWriter writer = new Accord.Video.FFMPEG.VideoFileWriter(); writer.Open("test.avi", 1024, 768, 1, Accord.Video.FFMPEG.VideoCodec.Default); Bitmap bmp = Bitmap.FromFile(@"D:\samples\test.png") as Bitmap; .. for (int i = 0; i < 20; i++) { writer.WriteVideoFrame(bmp); writer.Flush(); } writer.Close();
How can I add a 20 sec Audio to it? Break into pieces and WriteAudioFrame or is there another possibility?
regards .. Martin
Hi @prybe,
Thanks for opening the issue, and please have my apologies for the extremely long delay in answering.
An improved version of WriteAudioFrame will be available in the next release. In this release, WriteAudioFrame will be updated to take Signals as an input to both offer better control over the duration, sample rate, sample format and other characteristics of the audio stream, and to make it possible to convert the signal to the format expected by the audio stream on-the-fly during encoding.
A new (pre-release) version of Accord.Video.FFMPEG has just been pushed to NuGet. If it helps solving the issue (and if it isn't too late for you of course, as I realize it has been some time since the issue was first opened), please let me know!
Regards, Cesar
@cesarsouza hey I'm trying to do this it seems like from the docs http://accord-framework.net/docs/html/M_Accord_Video_FFMPEG_VideoFileWriter_WriteAudioFrame.htm it still only takes an audio "frame", but I don't know what an audio "frame" is, can you add some kind of example in pseudocode at least or something?