While searching for a solution I have tried to render an “animation” as a series of png images, and then I tried to convert these images into a video with FFmpeg using a lossless H.264 encoding. The result looks better, than when I was rendering with Synfig Studio straight to the video, albeit still not as good as the original png image. I am wondering if I could further tune the settings to improve the output quality.
So, if anybody has found a better way, please let me know.
Seeing as this appears to be about the only way to get a better quality, I am thinking about creating a GUI for FFmpeg to facilitate the task. Although, I can only code for Windows.
@BobSynfig, what rendering method currently ensures the best video quality?
In the meantime I found what the problem was. My original image was in the RGB color space and in that case a different codec has to be used, namely the libx264rgb codec. Otherwise, FFmpeg converts RGB to YUV and the colors are messed up in the output. Encoding in RGB results in a somewhat bigger video files and their compatibility decreases (say, the VLC player can play them correctly, but Avidemux fails to open them).
So, yet a better option would probably be to create images directly in the YUV color space, but I have not yet figured out how that could be achieved. Do not see such an option in GIMP.
If anybody knows how to do that, please let me know.
But as of now, with the libx264rgb codec, my lossless video output looks exactly like the original image. But if video editors can not work with RGB videos, then there is little point in producing them at all.
Thanks for some more hints, @bazza.
I tested what you suggested.
Option “-b:v 10M” has no effect at all.
Options “-b:v 10M -vcodec mpeg4 -g 30” make things look even worse.
And these settings “-b 2M -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30” have failed to produce any output at all.
Could you please explain what the “-g 30” option is supposed to do?
I wonder why the developers remain silent about this issue.
"C:\Programs Portable\FFmpeg v3.3.2 (x64)\bin\ffmpeg.exe" -framerate 24 -i "Test Animation.%%04d.png" -b:v 500M -vcodec mpeg4 -g 48 "video.mp4"
But the output video, while more than three times larger than that, encoded with the libx264 codec, has a notably worse quality than the latter.
It seems to me that the problem is not in the bitrate, but rather in the RGB to YUV color conversion.
Thanks, but I cannot open either of the videos. Neither with VLC, nor with Avidemux. Windows Explorer says they have zero length. If it is not too much trouble, could you please make them like 2-3 seconds long, and attach them again?
I can not understand why the quality is so different. I will try tomorrow with a new version of FFmpeg.
Could you please give the exact commands that you used to create two last videos?
This is for your video:
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 237 KiB
Duration : 30 s 0 ms
Overall bit rate : 64.8 kb/s
Writing application : Lavf56.40.101
This is for my video:
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 50.5 KiB
Duration : 4 s 840 ms
Overall bit rate : 85.5 kb/s
Writing application : Lavf57.76.100
MP4 requires big capacity of CPU/GPU for the compression maybe your computer was not the sufficiently good.
Another option is that it was by that you do not use wonderful GNU/linux