bennetimo / shrinkwrap

Shrink audio and video from cameras and GoPros at high quality, preserving metadata and original file modification times
http://coderunner.io/shrink-videos-with-ffmpeg-and-preserve-metadata/
67 stars 13 forks source link

Incompatible pixel format 'yuvj420p' for codec 'libx265 #2

Closed bartusp-zz closed 3 years ago

bartusp-zz commented 4 years ago

I am unable to set pix_fmt=yuvj420p option (default pixel format for GoPro session ) The following message is displayed: Incompatible pixel format 'yuvj420p' for codec 'libx265', auto-selecting format 'yuv420p' I've tried it with newest ffmpeg version and it worked fine.

Is it possible to upgrade ffmpeg version ?

bennetimo commented 4 years ago

Hi @bartusp, do you know which is the minimum version of ffmpeg that you need?

riyadamr commented 4 years ago

Hi @bennetimo, first thank you for this tool, it is really helpful! I am trying to encode to 265, and using something like :

docker run -v path/to/files:/files bennetimo/shrinkwrap -i mp4 -c:v libx265 -c:a copy -x265-params crf=25 /files/GOPR0212.mp4

I get

Error: Unknown option -c:v Error: Unknown option -c:a Error: Unknown option -x265-params

So i think it might be a ffmpeg issue. So could you give a clue on how to change / update ffmpeg on your tool ?

Edit : Apparently ffmpeg need to be configured with the flag: --enable-libx265. Is there somewhere where you handle configuration?

Thank you.

bennetimo commented 4 years ago

Hi @AmraniRiyad, shrinkwrap builds off a minimalist docker image of ffmpeg which should already be configured with --enable-libx265.

It looks like you're trying to pass ffmpeg command line options to shrinkwrap though, which won't work. What's happening is shrinkwrap is interpreting the options you've specified for itself (which it doesn't understand), instead of passing them along to ffmpeg underneath.

You need to use the --ffmpeg-opts in shrinkwrap to pass raw ffmpeg options, in a comma separated list.

So for example, something like:

docker run -v path/to/files:/files bennetimo/shrinkwrap:latest --input-extension mp4 --preset standard --ffmpeg-opts crf=25,preset=veryfast,c:v=libx265 "/files/GOPR0212.mp4"

That should get you started with an h265 shrink. Then you can customise the raw ffmpeg params as you need.

Hope that helps