2

I'm trying to reduce the resolution of some raw video using avconv. The output must keep the same raw video format, as at a later stage I need to load it into another program which is extremely picky and won't accept any other kind of input. Now, I have tried doing

avconv -i myvideo.avi -s 88x72 -vcodec rawvideo myvideo-small.avi

An this produces the reduced video alright, but it seems like the format is not exactly the same one. avconv says that the read input is

Stream #0.0: Video: rawvideo, pal8, 352x288, 30 fps, 30 tbr, 30 tbn

while the produced output is

Stream #0.0: Video: rawvideo, yuv420p, 88x72, q=2-31, 200 kb/s, 30 tbn, 30 tbc

Even though both are rawvideo, input is "pal8" and output is "yuv420p". I'm not aware of the differences between these two formats, but I need my output to retain the exactly same format as the input. How can this be done?

  • In the future you may wish to ask questions like this one in video.se rather than here. There are many more people who know about video encoding there, and this particular question has very little to do with Ubuntu. – v010dya Dec 14 '14 at 17:31
  • Good suggestion. I asked here because I saw some other questions regarding avconv around, but it certainly makes more sense. – albarji Dec 14 '14 at 18:02
1

It appears to me that avconv at this time only supports pal8 for the input. To check that you can run:

$ avconv -pix_fmts |grep pal8

my output is:

avconv version v12_dev0-498-g2e09359, Copyright (c) 2000-2014 the Libav developers
  built on Dec  5 2014 09:32:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
I..P. pal8                   1             8

The legend for the first part is:

I.... = Supported Input  format for conversion
.O... = Supported Output format for conversion
..H.. = Hardware accelerated format
...P. = Paletted format
....B = Bitstream format

So pal8 can be read, but not written. This means that there is no way for you to actively encode any of the streams into this format, which is something you need to do if you intend to alter the size of the frame.

If you will find another pixel format that your "picky" software will accept besides pal8 and that can be encoded with avconv, you can select that particular format with the -pix_fmt option:

avconv -i in.avi -s 88x72 -pix_fmt FORMAT -c:v rawvideo out.avi
  • Thanks @Volodya! I was unaware about the pixel format setting. It makes sense now why Matlab (the picky software) would work with one video but not the other. Also, my version of avconv has exactly the same support for pal8 (no output), so I will look for other pixel formats I can work with. – albarji Dec 14 '14 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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