ffmpeg, stereo + 5.1 surround, and YouTube's "Recommended upload encoding settings" - ffmpeg

I'm trying to make sense of something YouTube has listed on their recommended upload encoding settings for the best possible quality. Here's the link: https://support.google.com/youtube/answer/1722171#zippy=%2Caudio-codec-aac-lc
Specifically this line:
Channels: Stereo or Stereo + 5.1
I'm Googling for "Stereo + 5.1" and anything to do with ffmpeg but I can't seem to find much of anything.
I have trailers with surround audio I need to export for a client for YouTube.

You need to create a stereo downmix. (5.1 to stereo).
See https://trac.ffmpeg.org/wiki/AudioChannelManipulation#a5.1stereo
Then you combine your
video
audio (stereo) and
audio (5.1)
into one file with a total of 3 tracks.

Related

Scalable solution for converting an image sequence to video

We are developing a stop motion app for kids and schools.
So what we have is:
A sequence of images and audio files (no overlapping audio, in v1. But there can be gaps between them)
What we need to do:
Combine the images to a video with a frame rate between 1-12 fps
Add multiple audio files at a given start times
encode with H265 to mp4 format
I would really like to avoid maintaining a VM or Azure batch jobs running ffmpeg jobs if possible.
Is there any good frameworks or third party APIs?
I have only found transloadit as the closes match but they don't have the option to add multiple audio files.
Any suggestions or experience in this area is very appreciated.
You've mentionned FFmpeg in your tag and it is a tool that checks all the boxes.
For the first part of your project (making a video from images) you should check this link. To sum up, you'll use this kind of command:
ffmpeg -r 12 -f image2 -i PATH_TO_FOLDER/frame%d.png PATH_TO_FOLDER/output.mp4
-r 12 being your framerate, here 12. You control the output format with the file extension. To control the video codec check out this link, you'll need to use the option -c:v libx265before the filename of your output.
With FFmpeg you add audio as you add video, with -i option followed by your filename. If you want to cut audio you should seek in your audio with -ss -t two options good for that. If you want and audio to start at a certain point, check out -itoffset, you can find a lot of examples.

Libavformat- Passing an object of images to libavformat to generate a video

I am trying to generate a video with libavformat/Libavcodec with a bunch of images that are in memory.
Can someone point me in the right direction, please?
Thanks in advance.
First, the basics of creating a video from images with FFmpeg is explained here.
If you simply want to change/force the format and codec of your video, here is a good start.
For the raw FFmpeg documentation you could use the Video and Audio Format Conversion, the Codec Documentation, the Format Documentation the and the image2 demuxer documentation (this demuxer will manage images as an input).
If you just want to take images and make a simple video out of it, just look at the 2 first links. FFmpeg's documentation gives you powerful tools but don't use them if you don't need them.
A sample command to create a video from images is:
ffmpeg -i image-%03d.png video.mp4
This will take all the files in sequence from image-000.png to the highest number available and make a video out of it.
You can force the format with the extension of the output file. To force the video codec use -c:v followed by a codec name available in the codec documentation.

Encode uncompressed avi from webcam

I have to record videos for a project I'm doing. Two of these are USB cameras and another is a n IP overhead camera.All three are connected to a laptop computer. After recording the videos I need to be able to open them in an editor (not for editing particularly but for modeling stuff in them for which I need a timeline). I have chosen Sony Vegas Pro for my editor. I have been able to record the uncompressed avi using gstreamer with this command:
gst-launch v4l2src device=/dev/video0 ! 'video/x-rawyuv,width=640,height=480,framerate=10/1' ! mux. avimux name=mux ! filesink location=temp.avi
I had to set the framerate to 10 because I was using two USB cameras and a framerate of 30 on both could not be accomodated in the bandwidth of the USB controller. I do not care about audio in my file so I don't grab audio. Similary, while encoding I wouldn't care about audio as well. This is raw uncompressed avi. I was not able to open this in Sony Vegas Pro. I believe I need to encode this uncompressed avi using a codec that will be opened by Sony Vegas Pro (I don't know which codecs Sony likes, so I'll probably try different ones until one of them opens).
For encoding this video, I have several options: mencoder, ffmpeg, gstreamer. But I am not able to figure out how to use these tools to get what I want. Ideally, I would like just to sort of "insert" a codec with other settings remaining the same. I don't really care about the how much space the resulting video takes since the length of the videos are not going to be more than 3 minutes and I have space available, so lossless codecs also work. I believe Sony reads mpeg avi's so if I can get that, it'll be great.
Thanks for reading and I appreciate all the help.
I was able to figure this out after some searching. It is based on the information here. I found that Sony Vegas pro seems to open avi videos encoded with the xvid codec.

ffmpeg picture slideshow with audio

I'm trying to make a batch of videos for uploading to youtube. My emphasis is on the audio (mostly MP3, with some WMA). I have several image files that need to be picked up at random to go with the audio (ie) display an image for 5 seconds before showing the next. I want the video to stop when the audio stream ends. How should I use ffmpeg to achieve this ?
Ref:
http://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images

where to download cool animations for testing?

I am looking for some sites where I can download some short clips (5-20seconds) for testing purposes of video import routines.
Does anyone has some data sources for wmv, mpeg, mov, etc. ?
Thanks!
http://www.open-video.org/
http://www.archive.org/
http://reefvid.org/
Or just take some short vids with a digital video camera (or digital camera), import them onto your computer.
You can convert video files at http://www.zamzar.com/ to any format from any format.
Youtube, and convert it with ffmpeg
Or film trailers are often in mov (imdb: http://www.imdb.com/Sections/Trailers/ )
Or game trailers, gamershell / gamespot / ...
I was searching for this few days ago and here is best one I found:
http://www.jhepple.com/support/sample_movies1.htm
16 different files (two original samples), rather small sizes, covering most of popular formats.
MetaCafe allows you to download videos. I have some clips that I use for testing which are downloaded from there.
Some HD clips:
http://www.microsoft.com/windows/windowsmedia/musicandvideo/hdvideo/contentshowcase.aspx - Windows Media Audio and Video 9 Series, 1080p WMV files
http://www.apple.com/quicktime/guide/hd/ - H.264 in Quicktime containers
http://www.w6rz.net/ MPEG-2 Transport Stream Test Patterns

Resources