1

I have ffmpeg=4.1.3 and I want to convert a regular jpg file to nv12 (yuv). I used the command:

ffmpeg -y -i image.jpg -vf -pix_fmt nv12 out.yuv

and got: Unable to find a suitable output format for 'nv12'

I made sure the format exists with:

    ffmpeg -pix_fmts|grep nv

ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0)
  configuration: --prefix=/home/shani/anaconda2 --cc=/home/conda/feedstock_root/build_artifacts/ffmpeg_1556785800657/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-gpl --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-libx264 --enable-pic --enable-pthreads --enable-shared --enable-static --enable-version3 --enable-zlib --enable-libmp3lame
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
I.... = Supported Input  format for conversion
.O... = Supported Output format for conversion
IO... nv12                   3            12
IO... nv21                   3            12
..... nv16                   3            16
..... nv20le                 3            20
..... nv20be                 3            20

1 Answers1

1

The -vf introduces a filter, and expects a following argument, see here Filtering Guide. In this case, it consumes the -pix_fmt, and leaves nv12 as an output URL.

What follows the -vf in an ffmpeg command line is a ​filtergraph description. This filtergraph may contain a number of chains, each of which may contain a number of filters.

Try:

ffmpeg -y -i image.jpg -pix_fmt nv12 out.yuv

If you wanted to provide a filter, then you'll need to add an argument to the -vf, for example the following will reduce the resolution to 50% of the input.

ffmpeg -y -i image.jpg -vf scale=iw/2:-1 -pix_fmt nv12 out.yuv
Attie
  • 20,734