3

I'd like to convert a series of PNGs (in this case 180 in total) into an AVI movie using Avidemux. I've tried opening the first of these numbered PNGs (starting at 1I090001.png ending at 1I090180.png) in Avidemux and then clicking File→Save and typing the AVIs name with the .avi extension at the end, but this created an unreadable avi (VLC gave an "No suitable decoder modulate" error).

1

Use ffmpeg instead, e.g.

ffmpeg audio.mp4 -framerate 50 -pattern_type glob -i 3_DucksTakeOff_720p50_CgrLevels_SINC_FILTER_SVTdec05_/'*'.sgi -sws_flags lanczos+print_info -c:a copy -c:v libx264 -preset slow -crf 22 -pix_fmt yuv420p output.mkv

adjust the input file naming as necessary. ffmpeg can read png just fine. If there are other PNGs in the same dir that you don't want to include, use -start_number 090001 -i dir/1I%06d.png -frames 180. (Note that it matters what goes before -i input, and what goes after. Stuff before is input options, stuff after is output options.)

leave out the audio file if you don't have an audio track to mux.

Decrease the CRF to get higher quality at higher bitrate.

Increase the preset to slower or veryslow to get higher quality at similar bitrate but slower encode time.

Leave out the -pix_fmt yuv420p to not force ffmpeg to subsample the chroma after converting from RGB (PNG's color format) to YUV. (Most hardware players will only have hardware decoding for 8-bit 4:2:0 h.264, unfortunately. Same for GPU-accelerated decoding on PCs.)

Hmm, I'm not sure whether ffmpeg defaults to the bt.709 or bt.601 color matrix for RGB -> YUV conversion.

If you really need to make an AVI (with a DIVX / MPEG4-ASP video stream, I assume) for compatibility with an old hardware player, then see the guide. With avidemux, did you make a non-standard AVI, like h.264 in AVI?

I highly recommend against avidemux for video encoding. Its x264 options dialog is ancient and terrible.

1

This did it for me:

avidemux --nogui --load 1.png `for i in {2..15}; do echo "--append $i.png"; done` --no-audio --fps 5 --video-codec Xvid --save-ogm out.ogm --quit

I only tried with 15 images, but you can increase the total number if you want. For whatever reason for me it messed up colours a little bit, and i was unable to save into AVI, but hopefully it will get you started on the right track.

You can do all of this manually, in fact every part of this command is a manual action (just automated). So let's take it apart:

  • --nogui, should theoretically tell the program to not show gui at all (although on my machine i still saw some windows popping up).
  • --load 1.png is equivalent to opening 1.png.
  • --append _.png appends a file to the end of the video. Since we need to do this several times, it's easiest to do this via a command line.
  • --no-audio turns off the audio (you can do that in the menu)
  • --fps 5 sets 5 frames per second. Since images don't have such a setting automatically, you should do it manually.
  • --video-codec Xvid selects Xvid as a video codec, other codecs are Divx, FFmpeg4, VCD, SVCD, DVD, XVCD, XSVCD, and COPY.
  • --save-ogm filename saves the OGM file. --save is there to save an AVI, but unfortunately you don't have others built in.
  • --quit this one quits the program at the end.

Now, if you wish to load all the files into AVIDemux, but not to encode them automatically, nor quit the program (you will be able to play in graphical environment with settings as you are used to) you can do the following:

avidemux --load 090001.png `for i in {090002..090180}; do echo "--append $i.png"; done` --no-audio

If you get an unreadable file when you save into AVI it can be because of the following reasons:

  • Width is not divisible by 8. Actually it's best if your width is divisible by 16, especially when you deal with such an old container as AVI. If this is your problem, try resizing the video, it can be done via video filters; resize or crop or border are your friends. Filters will actually warn you if your result is not divisible by the good value.
  • You have selected a codec that is not suitable for AVI.
  • You have forgotten to explain to AVIDemux that there is no audio in your output (that is why i have added --no-audio for you already).

Having said all that. I recommend that you give avconv a try. It will make many jobs much easier.

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.