You can make use of ffmpeg
to convert h265 format to h264 format.
- Install
ffmpeg
using command sudo apt-get install ffmpeg
- Download h265 codecs.
wget http://ftp.videolan.org/pub/videolan/x265/x265_1.7.tar.gz
- Install dependencies for compilation.
sudo apt-get install cmake cmake-curses-gui build-essential yasm
- untar it by
tar -xvzf x265_1.7.tar.gz
cd x265_1.7/build/linux
./make-Makefiles.bash
It will ask you for cmake option. Press c
to configure and g
to generate and exit
make
to compile them
sudo make install
to install libx265 to default lib
path
Now that we have ffmpeg
and libx265
installed. To convert just video,
ffmpeg -i <input-file> -an -x265-params crf=25 <output-file.mp4>
To convert with audio,
ffmpeg -i <input-file> -c:a copy -x265-params crf=25 <output-file.mp4>
Please note that, it takes a decent amount of time to convert on x86_64 architecture. Converting it natively on Rpi will take about 4 - 5 x amount of time.
For more details : Read this
Hope it helps.