Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Custom FFmpeg Encoding Parameters in iw3 CLI (e.g specific using libx265) #203

Closed
TheRainstorm opened this issue Aug 16, 2024 · 9 comments

Comments

@TheRainstorm
Copy link

TheRainstorm commented Aug 16, 2024

Thanks for this great project! I noticed that iw3 defaults to H.264 encoding, which results in very high bitrates for 4K Full SBS videos. This causes stuttering and pixelation when playing back on my VR headset (Pico 4). Manually converting to H.265 (CRF 20) using ffmpeg fixes the issue, but it's an extra step.

Is it possible for iw3 CLI to generate h265 video directly? It may also help decreasing the video size.

@nagadomi
Copy link
Owner

nagadomi commented Aug 16, 2024

Added support for libx265 f5ded90

For iw3.cli, you can use --video-codec libx265 option to output in h265/hevc.
I have not tested enough, so let me know if there are any problems.

Edit:
Sorry, I fixed the option example from ---video-codec libx265 to --video-codec libx265 (wrong number of hyphens).

@nagadomi
Copy link
Owner

Also, iw3 defaults to preset=ultrafast, you can reduce the file size by specifying --preset medium option.

@TheRainstorm
Copy link
Author

For iw3.cli, you can use --video-codec libx265 option to output in h265/hvec.

Thanks for replying, I tried and it worked, thank you.

@diverswan9
Copy link

diverswan9 commented Aug 16, 2024

Using GUI...

2024-08-16_121258

@TheRainstorm
Copy link
Author

you can reduce the file size by specifying --preset medium option

The file size does decrease. Here’s the data (Original video is at 3840x2160@60, duration is 00:01:00, and the generated full SBS video is at 7680x2160@60):

  • Default h264: 933 MB
  • h264 with preset "medium": 449 MB (artifacts reduced but still present)
  • h265 with preset "medium": 275 MB (no artifacts when playback)

@nagadomi
Copy link
Owner

nagadomi commented Aug 16, 2024

@diverswan9
Does that error always occur with other videos or any options?
I guess some incompatible option is being used, but I have no idea which one.

@diverswan9
Copy link

@diverswan9 Does that error always occur with other videos or any options? I guess some incompatible option is being used, but I have no idea which one.

I'll check... ahh! I had 'level' set at 4.1 for x264. Put it on 'auto' and worked fine... thanks!

@nagadomi
Copy link
Owner

nagadomi commented Aug 16, 2024

@diverswan9
It seems that libx265 causes the error if the size of the video is out of level spec. It is more strict than libx264.

x265 [error]: picture dimensions are out of range for specified level

@nagadomi
Copy link
Owner

I added notes to the README about H.265 level problem and the large file size problem.

https://github.com/nagadomi/nunif/tree/master/iw3#video-codec
https://github.com/nagadomi/nunif/tree/master/iw3#large-video-file-size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants