FFMPEG command to combine a WAV file and a video file? - windows

I use Qt & OpenCV to record video and QAudioInput to record audio into wav format. I want to combine them into one video file. How can I accomplish this? I have researched so much but I can't seem to find a command to accomplish this.
I use both Windows and Mac.

FYI, this operation seems to be accomplished through the cmd-line in this thread. This approach may turn into an easy hack since you can call this command using system().
But if you still want to do it programatically, I suggest you take a look at Dranger's FFmpeg tutorials. It provides 8 interesting tutorials that shows how to do simple stuff, from taking snapshots of a video to more complex stuffs like writing a simple video player with audio/video sync.
These tutorials teach how to work independently with audio and video streams, which is what you need to do: read the audio stream from the WAV file and then insert it as the audio stream of a video file.
Maybe not directly related to what you are aim for, but this answer demonstrates how to use FFmpeg to retrieve the audio stream of one file and play it with SDL, while simultaneously using OpenCV to retrieve video frames and display them in a SDL window.

Related

merge/mix multiple audio using ffmpeg

I need to merge/mix multiple audio file into one single audio file using ffmpeg api, I googled a lot but didn't find any useful code samples, could anyone help to provide some guide on how to do this with ffmpeg apis?
You can use SOX for this task. Check documentation http://sox.sourceforge.net/sox.html. FFMPEG is widely used for audio conversions from one format to another. SOX is the best library which is widely used for mixing or concatenating audios.

Stream youtube sound via Ruby?

I'm trying to build a music player/playlist maker with Ruby and TK. I still haven't figured out a way to stream the youtube video (actually only the sound) I don't want to download and then play the song, cause that would take too long. And I couldn't find any information regarding streaming directly without some kind of embedded player.
Does anyone know how I could best tackle this?
Seems to be an intersting project, so I searched a little. From this reddit post: Tip: Use mpv + youtube-dl as streaming audio player there's this code using the mpv program to stream audio:
mpv "https://www.youtube.com/watch?v=sVK5Z6wnMxg" --no-video
That URL is a livestream of the Bonaroo music festical that's currently happening. I tried it and it does start the audio. Under the hood this is using youtube-dl which has this note in the man page:
How do I stream directly to media player?
You will first need to tell youtube-dl to stream
media to stdout with -o -, and also tell your me‐
dia player to read from stdin (it must be capable
of this for streaming) and then pipe former to
latter. For example, streaming to vlc
(http://www.videolan.org/) can be achieved with:
youtube-dl -o - "http://www.youtube.com/watch?v=BaW_jenozKcj" | vlc -
So if you wanted to pass the stream to a different media player, that would be a good place to start.
In terms of Ruby; well, this isn't really a Ruby solution per se, and you'd simply call the shell program from Ruby using backticks, system, Process.spawn, fork, etc.

Convert exe video to avi

Yes,I know there is no exe video,but there is screen recording software that save the videos as SWF or EXE for better compression ratio (as they say )
for swf it won't be a problem since there is a lot of swf readers out there,
But for exe it can be problem for a lot of reasons
like i can't read it on other platforms except for windows
can't upload it online
can't edit it
and also i don't trust executable files
So how can i convert those executables videos to AVI (or any other format ) without having to execute the file on my machine
In either case, the trouble you're having is that you are not working with an actual video. You are working with an executable file that is playing a series of images. It's not the same thing as an actual video stream that uses CODECs that can be converted.
So, there is really no way to convert that, short of doing some sort of screen capture of the video playing back.

Convert FLV to MP4 video files on MAC OSx

I am newbie on Mac OSx. I want to convert videos from one format to another like MP4 to MOV, FLV to MP4, MP4 to 3GP etc. I have already surfed on net. I found cocoa can do something using its QTKit architecture. In this, we can export videos in different formats. but i am not able to check that is it useful for FLV format. I want to convert FLV to MP4. Am I on right way or is there any other way for this conversion of videos.Your any kind of help will really appreciate.
Thanks.
FLV is probably the simplest video container in existence, Just download the spec (Adobe Flash Video File Format Specification Version 10.1), and parse it manually. Then use QTKit, or another third party library to remux to mp4.
This is the easiest way to convert video formats using MacOSX command line (any version). First download this compressed file and unpack it to your Movies Folder:
https://drive.google.com/file/d/0B3NlLwMD4yd9QU0yVGJyU1NiUDA/view?usp=sharing
You will then have a MMedia_Converter directory with two apps: MMedia_Convert and Android_Converter. Those are my own developed MacOSX open source applications, bassed on FFMpeg Group and HandBrake Group France previous work. Both are fully compliant Mac compilled applications and you´ll have have to do nothing but extract them to your Movies Folder.
You also have there, 3 folders: clip_in, clip_out and scripts.
You must put the videos you want to be converted in the clip_in folder.
The converted output videos, will be generated automatically in the clip_out folder.
In addition you have 2 bash scripts, that you must move to your Mac OSX Desktop.
Once these bash are on desktop, edit them with TextEdit, and change my user name by your Mac name.
In my case, I use one script to generate thumbnails and the other to generate thumbnails too, and to automatically convert videos from any formar to wathever I choose.
"Whatever" means, that if you want to convert mpeg to mkv, you will have to declare it in line: DEST_EXT=mkv (or wathever known video format you want).
Hope this will help you all.
Best Regards, Tomás Hernández

fragmented mp4 javascript converting

I wanted to know if there is a way to convert regular mp4 to a fragmented mp4 via javascript. (like mp4box does) Is it efficient enough (not suppose to be a complicated task)? did anyone write something like this?
to make it harder, can it be on the fly? meaning I will not download the whole mp4 from the server but download in parts and convert it into fragments compatible with fragmented mp4 and mpeg-dash - I'm trying to overcome to problem to not have to use 2 different file types to play a video or do mp4box on all my library in advance.
Regardless, is it possible to convert from h.264 compatible files with different containers (mov, flv etc.) to fragmented without a server? meaning do it in the browser with javascript somehow?
appreciate the help,
Yug
I am working on something similar (which lead me to here) but no clue so far. However, below is my finding:
Broadway:
https://github.com/mbebenita/Broadway
The idea is you may write a C/C++ using FFMPEG source library, then use Emscripten to compile your C/C++ coding into Javascript. I yet start working with this method, not sure this will work or not. If you did do let me know.

Resources