I've used ffmpeg for years for minor tweaks to sound & video but I know pretty much zero about containers and codecs and whatnot.
I've recently had a need to reduce the physical (disk) size of videos recorded on my phone to meet restrictions for uploads to social media.
Because it's disposable content for social media, best quality isn't that important.
What I really want is to understand what is happening in the following situation:
Source video is from OpenCamera on Android 12, using default settings.
The source video is about 80mb on disk, and the output from ffprobe looks like this:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID_20221101_101217Z.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2022-11-01T10:13:05.000000Z
com.android.version: 11
Duration: 00:00:46.89, start: 0.000000, bitrate: 14227 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1600x900, 14075 kb/s, SAR 1:1 DAR 16:9, 29.95 fps, 29.95 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 90
creation_time : 2022-11-01T10:13:05.000000Z
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
Metadata:
creation_time : 2022-11-01T10:13:05.000000Z
handler_name : SoundHandle
If I do nothing else except this:
ffmpeg -i VID_20221101_101217Z.mp4 VID_20221101_101217Z_NO_CHANGE.mp4
The file size drops to 29mb and the output of ffprobe looks like this:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID_20221101_101217Z_NO_CHANGE.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Duration: 00:00:46.88, start: 0.000000, bitrate: 5019 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 900x1600 [SAR 1:1 DAR 9:16], 4888 kb/s, 29.95 fps, 29.95 tbr, 18k tbn, 59.90 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 121 kb/s (default)
Metadata:
handler_name : SoundHandler
The subjective quality of the two are barely distinguishable & the second version is easily good enough for social media.
I can see that some numbers are different: kb/s, tbn, tbc are smaller, and I can see that 'yuv420p' no longer has '(tv,bt709)' appended. I also note that the kb/s for the audio stream in the second version is higher.
But I don't understand what these numbers mean and what has been "lost" so that the file size has been reduced by ~64%
It's a bt of a general question for SE I realise, but nevertheless I'd hope for some clarification.
thanks