How to make a SMALL video from single still image + audio, one key frame and all the rest p frames or whatever I have a WhatsApp message of 1 hour duration, it is an .ogg audio of less than 9 MB in size.
I want to upload it to YouTube, so I have to make it at least a single-frame video. So I made a JPEG cover picture of 1024 x 768 pixels. First I just used VLC and output a youtube SF or whatever output, but YouTube churns on that &quot;processing 0%&quot; for days on end now. So now I have to do something else. Using ffmpeg. Ideally I would just use the awesome ogg compression passing it through:
ffmpeg -loop 1 -y -i image.jpg -i audio.ogg -shortest -acodec copy -vcodec libx264 -crf 25  -pix_fmt yuv420p result.mp4

But that doesn't play in some players, so I won't even bother youtube with it.
ffmpeg -loop 1 -y -i image.jpg -i audio.ogg -shortest -acodec mp3 -vcodec libx264 -crf 25  -pix_fmt yuv420p result.mp4

That creates a huge file of over 120 MB in size! I have crappy internet, not going to blow a &lt;9 MB file into &gt;120 MB just to upload it you youtube.
So I thought if I could have only one i-frame and the rest p-frames which should be basically empty because the &quot;video&quot; has no changes to the picture over time. I read about the -g option:
ffmpeg -loop 1 -y -i image.jpg -i audio.ogg -shortest -acodec mp3 -vcodec libx264 -crf 25  -pix_fmt yuv420p -g 100000 result.mp4

The -g 100000 covers the 94,288 frames. But still with that I get &gt;60 MB.
How can I make the most compact mostly-audio + still image video that youtube will actually finish processing?
Here is some more calculation to show just why anything above 20 MB should not be acceptable.
Audio in the ogg compression is 8.61 MB in size. That makes a bitrate of
  8.61 MB * 1024^2 [B/MB] / 8 [b/B] / 62 [min] / 60 [s/min] 
= 303.368... b/s

That is 303 bits per second! That's pretty awesome encoding power of this one channel mono ogg audio. Imagine what a 300 bits per second teletype terminal feels as you type! And now imagine how you can talk faster through this sort of low bandwidth line than you can type and see a screen refresh!
But I'm perfectly OK with the MP3 audio perhaps being a little bigger. What I am not OK is the video encoding or something else giving this codec license to stream data out in ~200 kb/s, kilo-bit, even if that is at 4x the speed, 50 kb/s is still too much if the payload goes with less than 1 kb/s.
BTW, that Title image JPEG is 170 kB in size. If I just put a new full key i-frame copy of it every minute, then I'd get 10 MB for the &quot;video&quot; payload, not 60 MB. So something is very wrong with these codecs or the way they are parameterized.
There are a couple of things which you may still tune in the x264 encoder like listed here but also in the mp3 decoder like shown here if you are OK with a lower audio bitrate.My assumption is that not everything is eaten up by the video.
I have tried
ffmpeg -loop 1 -y -i image.jpg -i audio.ogg -shortest -acodec mp3 -qscale:a 7 -vcodec libx264 -preset ultrafast -tune stillimage -maxrate 5K -bufsize 100K -crf 25  -pix_fmt yuv420p -g 100000 result5.mp4

and got a video file that was half the size of the ogg file.
Here is what the parameters do and how to use them:
-maxrate 5K -bufsize 100K
this has a direct impact on the video bitrate. I lowered the values until I got VBV underflow messages then raised it back again. The quality of the jpeg was very low but got better when I increased bufsize.
-qscale:a 7
This produces a 100 kbit Audio stream which was more than OK for my sample.
In a nutshell, you may need to tweak these parameters a little bit in order to improve things. I suspect that it is actually the audio in your case consuming a large part.
Let me know if it works.