Is there any way to use ffmpeg to extract the video & audio stream from the files (like .m4v, mkv and mpeg4) and it can play in the mplayer?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Is there any way to use ffmpeg to extract the video & audio stream from the files (like .m4v, mkv and mpeg4) and it can play in the mplayer?
Assuming you'd like to extract audio and video from the file "input.file".
First identify the contents of "input.file" with:
$ ffmeg -i input.file
ffmpeg dumps information on the audio and video streams contained in the input file
Now extract the audio and video and audio contents as below:
$ ffmpeg -i input.file -vcodec copy -an video_only.extn
$ ffmpeg -i input.file -acodec copy -vn audio_only.extn
Of course, adjust the file extensions (.extn) based on what you see in the information dump seen after executing the first command above.
See http://ffmpeg.org/ffmpeg.html for more detailed options
Hi Sanjeev Premi,
It works fine. It is really easy. Can I get the elementary stream? I tried the .es or .264. Both are not working.
Best Regards,
Philip Lee
I haven't used these options but, you may want to try if either help you:
* -f 264 (or other format that you are looking for).
* -f rawvideo
Do checkout detailed options in the ffmpeg documentation.
I tried a method to use the ffmpeg -i xxxxx.mp4 -vcodec copy -acodec -f h264 output.264. It convert a file but it doesn't a H.264 elementary stream. I have a few questions about this.
1. H.264 Elementary streams include SEI, SPS, PPS and also the Coded Slice of an IDR picture and Coded Slice of a Non-IDR picture. Are these in the original .mp4 files?
2. The output of the VLC converted file included all these but I cannot figure out how to generate it. Is there anyone new about these?
Best Regards,
Philip Lee
You may want to address this question to appropriate ffmpeg mailing lists: http://ffmpeg.org/contact.html
Developers/ Advanced ffmpeg users may be able to help you.