0

I'm planning to convert my video collection from h.264 to h.265 in order to save disk space. Source files are in mp4 and mkv containers.

The videos are mostly watched using mpv. Especially for the videos from the action cam, single stepping should work smoothly in both directions (using , for backward and . for forward stepping). In my test results so far, the h.264 videos work very well, but the h.265 only work a few steps backward (maybe up to the latest I-Frame), but then any further step is extremely slow (up to two seconds for every step).

I've followed the instructions found in How to generate an MP4 with H.265 codec using FFmpeg?. I've tried mp4 and mkv as container formats for the output with unfortunately the same result. These are the commands:

ffmpeg -i IN.mp4 -c:v libx265 -c:a copy -x265-params crf=25 OUT.mp4
ffmpeg -i IN.mkv -c:v libx265 -c:a copy -x265-params crf=25 OUT.mkv

Is there anything I can do to make stepping / searching easier for mpv or is it a general problem with h.265 ?

Edit:

I would like to add that the issue only occurs when single stepping backwards. "Normal" searching (i.e. going backwards by 10 seconds or one minute using the cursor keys) works without any problem in the created h.265 videos.

Arch-User
  • 1
  • 2
  • 1
    Well, on a basic level your command can be simplified to be: `ffmpeg -i IN.mp4 -c:v libx265 -c:a copy -crf 25 OUT.mp4`. Past that, x265 is *very* CPU intensive. So if your system is a bit on the under-powered CPU side, that could account for the slowness, – Giacomo1968 Jan 05 '20 at 05:34
  • 1
    It's interesting to read that x265 is still CPU intensive these days ... I've recently seen the specs of the new Raspberry Pi 4 where they say it can decode x265 in the GPU. Anyway ... My PC is not short in CPU power: It's an AMD Ryzen 5 2600 – Arch-User Jan 05 '20 at 06:53
  • Is the player using hardware to decode? Might want to test as whatever method you are not using may result in the desired performance. – llogan Jan 06 '20 at 18:25
  • Yes, mpv says it uses GPU output mode – Arch-User Jan 11 '20 at 05:32

1 Answers1

-1

It's the players job to handle seeking. By using smaller GOP sizes you can make the players job easier. But if the player cant do it, it doesn't matter how you encode the video.

szatmary
  • 3,543
  • 1
  • 14
  • 16
  • I'm aware that everything during playing is the player's job. However ... my hope was to add some additional metadata (like indices) to the video for making the player's job easier. Making the GOPs shorter will be more I-Frames and thus bigger file size, the mopposite of what I would like to achieve by doing the conversion at all. – Arch-User Jan 05 '20 at 07:00