I have raspberry pi 2 with osmc/Kodi installed on it, I have several h265 videos on it which can't be played smoothly. I would like to convert them to h264 using some conversion tool or package that should be installed on pi. Can someone please advise which package and how to use it to achieve the conversion ?

Thanks, Ahmed


You can make use of ffmpeg to convert h265 format to h264 format.

  1. Install ffmpeg using command sudo apt-get install ffmpeg
  2. Download h265 codecs. wget http://ftp.videolan.org/pub/videolan/x265/x265_1.7.tar.gz
  3. Install dependencies for compilation. sudo apt-get install cmake cmake-curses-gui build-essential yasm
  4. untar it by tar -xvzf x265_1.7.tar.gz
  5. cd x265_1.7/build/linux
  6. ./make-Makefiles.bash It will ask you for cmake option. Press c to configure and g to generate and exit
  7. make to compile them
  8. 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.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.