Converting a Video without Re-encoding

FFMPEG can be used to convert a video from one format to another. Very often, the video itself to be converted is already encoded in an appropriate format. You just want to convert the container format.

In the following example, the source video is encoded in MPEG-2 in an MKV container. It will be converted to an MPG video. No re-encoding is required since the source video is already in the target format. You can also select one or more audio tracks during conversion if this is part of the requirements.

ffmpeg -i input.mkv -map 0:a:1 -map 0:v -c:v copy -c:a copy output.mpg

Router AC68U Having 100% CPU Problem


If the router runs into a problem of 100% CPU affecting the internet connection, normal courses of actions include re-booting the router, power recycle the router and applying the latest firmware.

If none of the above works, check the computers that have a wired connection to the router. The problem may be caused by one of those computers that require a restart after Windows update. If that is the case, simply restart the computer to finish the update process and the router problem should go away.

Extracting a Portion of Video using FFMPEG

If you would like to extract a portion of a video without re-encoding, consider using FFMPEG. The following example illustrates a command to extract a video from the 24th minute line and for 4 minutes 8 seconds, keeping all audio tracks.

ffmpeg -i input.mp4 -c copy -ss 00:24:00.000 -t 00:04:08.000 -map 0:v -map 0:a output.mp4

The example above may result in blank video in the beginning. If it is more important to have the video than audio, the following can be used (which may cause blank audio in the beginning).

ffmpeg -ss 00:24:00.000 -i input.mp4 -c copy -t 00:04:08.000 -map 0:v -map 0:a output.mp4

The most accurate way to extract part of a video is to re-encode (without -c copy), which may result in loss of quality and takes longer to process. This article describes the topic in details.

Setting the default audio stream using FFMPEG

Here is another use case for FFMPEG. In some projects, after you mixed and matched video and audio streams from different files, the resultant file may not have the default audio stream as desired. You can use the following command to set the default audio stream while you are mixing the video/audio streams.

ffmpeg -i movie.mkv -i audio.dts -map 0:v:0 -map 1:a:0 -map 0:a:0 -c copy -disposition:a:0 default -disposition:a:1 none movie_combined.mkv

Add a new audio track to an existing file

There is yet another common use of FFMPEG, i.e. adding a new audio track to an existing file which can be a video-only file or a video file already with an audio track. A use case will be adding a second audio track to a file already with video and sound. The following is an example of the command to add audio.dts audio track to an existing mkv file:

ffmpeg -i input.mkv -i audio.dts -map 0 -map 1 -c copy output.mkv

Announcing: Windows Defender ATP support for Windows 7 and Windows 8.1

With Windows 10 we built the most secure Windows ever, by hardening the platform itself and by developing Windows Defender Advanced Threat Protection (ATP) – a unified endpoint security platform that helps stop breaches. This means that for the first time we’ve built threat and exploit protection, and Endpoint Detection & Response right into the operating system, powered by the cloud. We hear from our customers security is one of the biggest motivators for their move to Windows 10. Meanwhile, we know that while in their transition, some may have a mix of Windows 10 and Windows 7 devices in their environments. We want to help our customers achieve the best security possible on their way to Windows 10 ahead of the end of support for Windows 7 in January 2020. (…….. read the whole story)

Correcting for audio/video sync issues

Due to various reasons, the audio and video tracks sometimes may become out-of-sync in a video clip, i.e. there are some delay between the tracks affecting the overall viewing experience. Use the following as examples to fix the issue.

CASE 1: Audio happens before video (aka “need to delay audio stream 1”):

ffmpeg -i clip.mp4 -itsoffset 0.150 -i clip.mp4 -vcodec copy -acodec copy -map 0:0 -map 1:1 output.mp4

The “itsoffset” in the above example is placed before file 1 (remember that linux counts from 0, so 0 is the first and 1 is the second), so when the mapping happens, it says “Take the video of file 0 and the audio of file 1, leave the video of file 0 alone and apply the offset to the audio of file 1 and merge them into a new output file”. The delay is only .15 seconds.

CASE 2: Video happens before audio (aka “need to delay video stream 0”):

ffmpeg -i clip.mp4 -itsoffset 0.150 -i clip.mp4 -vcodec copy -acodec copy -map 0:1 -map 1:0 output.mp4

The “itsoffset” in the above example is placed before file 1. When the mapping happens, it says “Take the audio of file 0 and the video of file 1, leave the audio of file 0 alone and apply the offset to the video of file 1 and merge them into a new output file”. The delay is only .15 seconds.