
Here you may have to add one switch to handle the MPEG-2/4 ADTS header from the transport stream file.įfmpeg -i input.ts -bsf:a aac_adtstoasc -c:v copy -c:a copy outputfromts.mp4

This tells FFmpeg to copy the compressed audio stream into the new file without re-encoding.Ī similar scenario might involve files in the MPEG-2 container format with a. This tells FFmpeg to copy the compressed video stream into the new file without re-encoding.Īudio codec, copy. This is easily done in FFmpeg with this command string:įfmpeg -i input.mp4 -c:v copy -c:a copy output.mov You could input the file into Adobe Premiere Pro and output as needed, but Premiere Pro can’t do that without re-encoding. Say you’re working with an application that only accepts MOV files and your source file is in an MP4 container (or vice versa). Changing Container Formats Without Re-Encoding

(Note that the download will begin automatically when you click this link.) The video is excerpted from a test video provided by Harmonic, Inc. Note that you can download all commands and the input test file used in this tutorial. All of these are customizable, of course, but if all you’re trying to do is to create a video file you can play from a hard drive, the command above will suffice. For the MP4 extension, if you input a 1080p file, FFmpeg will encode using the H.264 video codec at about 9 to 10 Mbps, the AAC audio codec at around 130 Kbps, a keyframe interval of 250 frames, the High profile, and the medium x264 preset.

Note that unless you identify an audio or video codec via switches, FFmpeg will use the default codecs for each container format as well as reasonable encoding parameters. FFmpeg can input most container formats natively, including MP4. This calls the program add drive and folder information for ffmpeg.exe if it’s not in your path.

Here’s the basic FFmpeg command line structure: Though batch command structure and operation is different for each platform, the FFmpeg command syntax is very similar for all. To get started, you can download FFmpeg for free from /download.html, with packages available for Windows, Mac, and multiple Linux flavors including Ubuntu, Debian, Fedora, and Red Hat Enterprise Linux. In this article, I’ll show you how to perform six of these tasks. But it also performs many simple and essential tasks that crop up in a studio or encoding facility, particularly if you do performance or benchmark testing. FFMPEG is a free command-line utility that serves as the engine for most of the largest cloud encoding farms in the world, public and private.
