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

1 Answer 1


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.

  • 1
    This worked for me, except before step 6, I edited source/CMakeLists.txt: (a) line 10 -> OLD->NEW cmake_policy(SET CMP0025 NEW) (b) line 16 -> OLD->NEW cmake_policy(SET CMP0054 NEW) (c) line 48 -> remove include(Version) and replace with (i don't think the actual numbers functionally matter): set(X265_VERSION "3.5") set(X265_LATEST_TAG "3.5") set(X265_TAG_DISTANCE "0") message(STATUS "X265 RELEASE VERSION ${X265_VERSION}")
    – Landon
    Commented Apr 15, 2023 at 22:08
  • 1
    I also downloaded master from github.com/videolan/x265
    – Landon
    Commented Apr 15, 2023 at 22:10

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