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 "processing 0%" 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 <9 MB file into >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 "video" 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 >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 "video" payload, not 60 MB. So something is very wrong with these codecs or the way they are parameterized.