_____ _ _ _ _ __ ___ _ | ___(_) |_| |_(_)_ __ __ _ \ \ / (_) __| | ___ ___ | |_ | | __| __| | '_ \ / _` | \ \ / /| |/ _` |/ _ \/ _ \ | _| | | |_| |_| | | | | (_| | \ V / | | (_| | __/ (_) | |_| |_|\__|\__|_|_| |_|\__, | \_/ |_|\__,_|\___|\___/ |___/ ___ _ __ __ _ / _ \| '_ \ / _` | | (_) | | | | | (_| | \___/|_| |_| \__,_| _____ _ | ___| | ___ _ __ _ __ _ _ | |_ | |/ _ \| '_ \| '_ \| | | | | _| | | (_) | |_) | |_) | |_| | |_| |_|\___/| .__/| .__/ \__, | |_| |_| |___/ by TheOuterLinux https://theouterlinux.gitlab.io Last updated: 2021/07/29 Discussion URL (Reddit): https://www.reddit.com/r/TheOuterLinux/comments/esgv8n/fitting_a_46_minute_576_mib_video_on_a_35_floppy/.compact Discussion URL (LinuxQuestions.org): https://www.linuxquestions.org/questions/blog/theouterlinux-1169710/theouterlinux-m-se-fitting-a-46-minute-576-mib-video-on-a-3-5-floppy-disc-38284/#comments Fitting a 46 minute (576 MiB) video on a 3.5" floppy disc I recently watched a video in regards to FreeDOS's 25th anniversary and randomly thought, "How can I fit this ~46 minute video on a 3.5" floppy disc? However, quality in this case was not a concern as doing something like this would only benefit classic video podcasts as most details would be lost. And most of the time, when it comes to podcasts, you really only need the audio. Also note, though FreeDOS's 25th anniversary was the inspiration behind this, do not expect to actually play the video on a DOS machine as codecs were used that even up-to-date DOS media players still have yet to support, or as far as I know (vpx-vp9 & opus). So, a 46 minute video podcast on YouTube was found and then converted: ffmpeg -i 'input.mp4' -vf scale=320:-1 -b:v 1K -r 10 -c:a libopus -ar 8K -b:a 1K -ac 1 -threads 0 'output.webm' ...and the resulting file size was 5.6 MiB. With the details being: video:2112kB audio:2354kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 22.401190% This was great, but 5.6 MiB does not fit on a floppy, I can compress the crap out of the resulting file with 7z, but it only takes off ~ 1 MiB. So, I tried the following (160p): ffmpeg -i 'input.mp4' -vf scale=160:-1 -b:v 1K -r 10 -c:a libopus -ar 8K -b:a 1K -ac 1 -threads 0 'output.webm' ...The above gave me a 4.5 MiB file. I then tried shrinking the video size more (80p) with: ffmpeg -i 'input.mp4' -vf scale=80:-1 -b:v 1K -r 10 -c:a libopus -ar 8K -b:a 1K -ac 1 -threads 0 'output.webm' ...and this gave me a file size of 4.3 MiB with details being: video:863kB audio:2354kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 31.005966% Notice anything about the above? The video size is actually only 863kB in size but the audio itself is what is taking up most of the room. What can be done about this to lower the audio size?... 1. Rip the audio out of the original video as a 11025Hz WAV file (saves space): ffmpeg -i 'input.mp4' -b:a 11025 -threads 0 'output.wav' ...Saves space and you are going to use some seriously low bitrates anyway. Converting from a normal large WAV file to an OPUS one using opusenc has the same file size as doing so from an 11025 Hz WAV file. 2. Convert the original video to an audio-less webm file, scaled with very low bitrates: ffmpeg -i 'input.mp4' -vf scale=160:-1,eq=contrast=1.5:brightness=-0.05:saturation=0.75 -c:v libvpx-vp9 -minrate 1K -maxrate 1K -b:v 1K -r 10 -an -quality good -speed 0 -tile-columns 0 -threads 0 'output.webm' ...You may notice video filters for changing the contrast, brightness, and saturation; this is because without lowering them, it makes it much harder to distinguish things going on in the video. Also, do not bother lowering the scale anymore than this because it seems as though ffmpeg has a hard time going lower than 2.5kbits/s regardless. I would like to also note that adding '[...],format=pal8' to the video filter (-vf) will increase the quality if you still have a little bit of space but not enough to increase the scale. I have no idea why using less colors can have higher bitrates, even 'monow' filter for 1-bit color does it. 3. Convert the previously made WAV file to a very low bitrate OPUS: opusenc --bitrate 2K --hard-cbr --downmix-mono 'input.wav' 'output.opus' 4. Combine the video and audio files: ffmpeg -i 'input.webm' -i 'input.opus' -c:a copy -c:v copy -threads 0 'output.webm' 5. Create a 7z archive: 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on output.7z 'input.webm' ... And the resulting file size is 1.3 MiB, or 1304 KiB. Does this look like crap? Yes. Does it make people sound like Cylons? Yes. But now, you can't say that fitting a 46 minute video onto a floppy disc isn't possible, now can you? ;) Besides, with shorter videos, you can increase the bitrates with ffmpeg and opusenc to get better quality with the chance of also increasing the scale of the video. You can grab a 20 minute version of the above except using a TEDTalk entitled "Feats of memory anyone can do" by Joshua Foer from this link (1.1MB 7z file): https://theouterlinux.gitlab.io/Downloads/TEDTalk.webm.7z