Yearly Archives: 2020


Rough note on ffmpeg: Merge Two Videos Side by Side 1

The following command will create a video from two input files and place them side by side using the hstack filter.

ffmpeg -i left.mp4 -i right.mp4 -filter_complex hstack output.mp4;

More information on the hstack filter:

11.104 hstack
Stack input videos horizontally.
All streams must be of same pixel format and of same height.
Note that this filter is faster than using overlay and pad filter to create same output.
The filter accepts the following option:
inputs
Set number of input streams. Default is 2.
shortest
If set to 1, force the output to terminate when the shortest input terminates. Default value is 0

You can use the vstack filter in case you want to place the one video above the other.


ffmpeg: Convert HikVision H.265+ videos to MKV

The following command will find all mp4 files that are in the current directory and in all sub-folders and convert them to mkv.

Recently we needed to share some footage from a HikVision NVR which was recording to H.265+ which was a proprietary format of the company. To do so, we converted them in another format that more players could recognize the videos.

for FILE in *.mp4; do
  echo -e "Processing video '\e[32m$FILE\e[0m'";
  ffmpeg -i "${FILE}" -analyzeduration 2147483647 -probesize 2147483647 -c:v libx265 -an -x265-params crf=0 "${FILE%.mp4}.mkv";
done;

The filename of the mkv file will be the same as the mp4 video with the correct extension. The mp4 extension will be removed and replaced by the mkv extension e.g hi.mp4 will become hi.mkv

A few notes, the compression they use seems really good, the size of the original video is very small in comparison to the generated result.


Cyprus Radio Frequencies for cars imported from Japan

If you are having trouble with the radio of your car that was imported from Japan and you cannot tune in to your favorite radio stations you might have to do a little math!

On many cars that were imported from Japan it seems that to tune in to the station you like you need to subtract from the frequency 16Mhz. For example, if the station you are interested in is broadcasting at 97.2Mhz you will have to set your car radio to 81.2Mhz to listen to it.

A list of frequencies will follow soon.