Log in

View Full Version : File size of flv bigger than it should be


sebastiang
1st April 2019, 11:25
Mediainfo:
General
Format : Flash Video
File size : 375 MiB
Duration : 29 min 19 s
Overall bit rate : 1 790 kb/s
Encoded date : Mon Jun 27 21:01:27 2011

Video
Format : VP6
Codec ID : 4
Duration : 29 min 19 s
Bit rate : 1 000 kb/s
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Bit depth : 8 bits
Bits/(Pixel*Frame) : 0.174
Stream size : 210 MiB (56%)

Audio
Format : MPEG Audio
Format version : Version 2
Format profile : Layer 3
Mode : Joint stereo
Mode extension : Intensity Stereo + MS Stereo
Codec ID : 2
Codec ID/Hint : MP3
Duration : 29 min 19 s
Bit rate mode : Constant
Bit rate : 56.0 kb/s
Channel(s) : 2 channels
Sampling rate : 22.05 kHz
Compression mode : Lossy
Stream size : 11.7 MiB (3%)

As you can see size of both audio and video streams combined equals 221.7MB, but the file size is 375MiB, why? When compressed by rar it's still 345MB, so there's something there, not just zeros. File plays fine. What is it and how can I trim it without recompressing? Thanks for help.

mkver
1st April 2019, 18:45
Besides there being something other than the audio and video in the file there are also the possibilities of MediaInfo having a bug or the container containing wrong information regarding the bitrate/sizes of the streams.
You should try remuxing the file with e.g. FFmpeg and see how big it will be.

LoRd_MuldeR
1st April 2019, 21:56
There always is some container overhead. But the difference between 221.7 vs. 375 MiB seems to be too much to be explained entirely by container overhead.

You can try FLV Extract (https://www.moitah.net/) to extract the "raw" streams from the FLV container and see what their actual size is...

StainlessS
2nd April 2019, 04:39
Perhaps not of use in this instance, but might be handy for you at some point.
FlvCheck, early freely available version utility from Adobe (later version bundled with some Adobe package, I dont recall which one), no longer available from Adobe site (links all gone),
I dont have the commercial later version.
http://www.mediafire.com/file/uryrbkga7pcsu35/FlvCheck.7z/file

EDIT: Already posted about it some time ago:- https://forum.doom9.org/showthread.php?p=1373711#post1373711

@Chikuzen, Thanx,

Have D/L'ed, will try. Always nice to have an alternative.

Find link below to Adobe FlvCheck v1.0
(Req vs6 c++ redistributable)

Cannot source a later version, but does exist.

Also incl, brief instructions to fix a bad FLV file.
Many FLV files (including On2 produced) are considered
bad by Adobe FlvCheck, FlvCheck is supposed to fix them
but sometimes flags an error. Instructions tell how to fix
these errors (usually) and then retry with FlvCheck.

This actually does work unlike many fixes you might have seen.
Required:- FFMpeg.Exe

http://www.mediafire.com/file/uryrbkga7pcsu35/FlvCheck.7z/file


EDIT:-
The linked FLVCheck shows itself to be v1.0, however, there are multiple v1.0 FlvCheck's around,
seems Adobe did not update version number. This FlvCheck is freely downloadable from Adobe, however,
you cannnot find it with an Adobe search, brings up stuff about Adobe FLV Server (with which it is included)
but the earlier version is well hidden. I found it via a link from some other site, dont any longer have that
link.

sebastiang
4th April 2019, 10:02
You should try remuxing the file with e.g. FFmpeg and see how big it will be.

ffmpeg -i flv.flv -acodec copy -vcodec copy mkv.mkv
ffmpeg version N-79107-g30d1213 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopenc
ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --ena
ble-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enabl
e-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-l
ibvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-li
bwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enab
le-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 28.103 / 57. 28.103
libavformat 57. 29.100 / 57. 29.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 39.102 / 6. 39.102
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, flv, from 'flv.flv':
Metadata:
canSeekToEnd : true
creationdate : Mon Jun 27 08:48:49 2011
Duration: 00:30:00.04, start: 0.000000, bitrate: 1666 kb/s
Stream #0:0: Video: vp6f, yuv420p, 640x360, 1024 kb/s, 25 fps, 25 tbr, 1k tb
n, 1k tbc
Stream #0:1: Audio: mp3, 22050 Hz, stereo, s16p, 57 kb/s
Output #0, matroska, to 'mkv.mkv':
Metadata:
canSeekToEnd : true
creationdate : Mon Jun 27 08:48:49 2011
encoder : Lavf57.29.100
Stream #0:0: Video: vp6f (VP6F / 0x46365056), yuv420p, 640x360, q=2-31, 1024
kb/s, 25 fps, 25 tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 22050 Hz, stereo, 57 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=11507 fps=0.0 q=-1.0 size= 95224kB time=00:07:40.25 bitrate=1694.9kbits/
frame=19761 fps=19741 q=-1.0 size= 171712kB time=00:13:10.41 bitrate=1779.7kbit
frame=25759 fps=16974 q=-1.0 size= 227842kB time=00:17:10.32 bitrate=1811.6kbit
frame=31436 fps=15578 q=-1.0 size= 274832kB time=00:20:57.45 bitrate=1790.5kbit
frame=37335 fps=14824 q=-1.0 size= 320643kB time=00:24:53.36 bitrate=1758.9kbit
frame=45001 fps=14084 q=-1.0 Lsize= 366660kB time=00:30:00.02 bitrate=1668.7kbi
ts/s speed= 563x
video:352192kB audio:12247kB subtitle:0kB other streams:0kB global headers:0kB m
uxing overhead: 0.609461%

Mediainfo:
General
Format : Matroska
Format version : Version 4 / Version 2
File size : 358 MiB
Duration : 30 min 0 s
Overall bit rate : 1 669 kb/s
Writing application : Lavf57.29.100
Writing library : Lavf57.29.100
CANSEEKTOEND : true
CREATIONDATE : Mon Jun 27 08:48:49 2011

Video
ID : 1
Format : VP6
Format profile : Heightened Sharpness
Codec ID : V_MS/VFW/FOURCC / VP6F
Codec ID/Hint : On2
Duration : 30 min 0 s
Bit rate : 1 579 kb/s
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Bits/(Pixel*Frame) : 0.274
Stream size : 339 MiB (95%)
Default : Yes
Forced : No
DURATION : 00:30:00.040000000

Audio
ID : 2
Format : MPEG Audio
Format version : Version 2
Format profile : Layer 3
Mode : Joint stereo
Mode extension : Intensity Stereo + MS Stereo
Codec ID : A_MPEG/L3
Codec ID/Hint : MP3
Duration : 30 min 0 s
Bit rate mode : Constant
Bit rate : 56.0 kb/s
Channel(s) : 2 channels
Sampling rate : 22.05 kHz
Compression mode : Lossy
Stream size : 12.0 MiB (3%)
Default : Yes
Forced : No
DURATION : 00:30:00.019000000

There always is some container overhead. But the difference between 221.7 vs. 375 MiB seems to be too much to be explained entirely by container overhead.

You can try FLV Extract (https://www.moitah.net/) to extract the "raw" streams from the FLV container and see what their actual size is...

After extracting:
General
Format : AVI
Format/Info : Audio Video Interleave
File size : 345 MiB
Duration : 30 min 0 s
Overall bit rate : 1 608 kb/s

Video
ID : 0
Format : VP6
Format profile : Heightened Sharpness
Codec ID : VP6F
Codec ID/Hint : On2
Duration : 30 min 0 s
Bit rate : 1 603 kb/s
Width : 640 pixels
Height : 368 pixels
Display aspect ratio : 1.739
Frame rate : 25.000 FPS
Bits/(Pixel*Frame) : 0.272
Stream size : 344 MiB (100%)

In both cases video bitrate changed from ~1000kb/s to ~1600kb/s. I have different flv files from same source and they all have this problem, I even found more extreme example:
General
Format : Flash Video
File size : 578 MiB
Duration : 28 min 8 s
Overall bit rate : 800 kb/s

Video
Format : VP6
Codec ID : 4
Duration : 28 min 8 s
Bit rate : 631 kb/s
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Bit depth : 8 bits
Bits/(Pixel*Frame) : 0.110
Stream size : 127 MiB (22%)

Audio
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : 2
Codec ID/Hint : MP3
Duration : 28 min 8 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 2 channels
Sampling rate : 44.1 kHz
Compression mode : Lossy
Stream size : 25.8 MiB (4%)
Writing library : LAME3.98.2

LoRd_MuldeR
4th April 2019, 21:17
In both cases video bitrate changed from ~1000kb/s to ~1600kb/s. I have different flv files from same source and they all have this problem, I even found more extreme example:

FLV is actually a very limited container format. It pretty much consists of a minimalist header, indicating no more than that this is a FLV file, followed by a sequence of individual audio and/or video packets.
https://en.wikipedia.org/wiki/Flash_Video#Flash_Video_Structure

It appears there are no global stream headers that would indicate the (average) bitrate of the audio or video stream. There also is no "index" whatsoever that would support seeking.

I don't know how MediaInfo determines the size or bitrate of a particular stream. But, unless it scans through the entire file and adds all the individual frame sizes – which would be rather slow – it probably makes an "educated guess" :eek:

[EDIT]

You can could try "mediainfo.exe --ParseSpeed=1 YourFileName.flv" for potentially more accurate results. See here (https://sourceforge.net/p/mediainfo/discussion/297610/thread/924a0508/) for details!

sebastiang
4th April 2019, 22:16
Result with --ParseSpeed=1:
General
Format : Flash Video
File size : 583 MiB
Duration : 29 min 13 s
Overall bit rate : 800 kb/s

Video
Format : VP6
Codec ID : 4
Duration : 29 min 13 s
Bit rate : 631 kb/s
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Bit depth : 8 bits
Bits/(Pixel*Frame) : 0.110
Stream size : 132 MiB (23%)

Audio
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : 2
Codec ID/Hint : MP3
Duration : 29 min 13 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 2 channels
Sampling rate : 44.1 kHz
Compression mode : Lossy
Stream size : 26.8 MiB (5%)
Writing library : LAME3.98.2

I tried to remux it to flv using ffmpeg, similar results:
General
Complete name : asd.flv
Format : Flash Video
File size : 583 MiB
Duration : 29 min 13 s
Overall bit rate : 2 790 kb/s
Writing application : Lavf57.29.100

Video
Format : VP6
Codec ID : 4
Duration : 29 min 13 s
Bit rate : 800 kb/s
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Bit depth : 8 bits
Bits/(Pixel*Frame) : 0.139
Stream size : 167 MiB (29%)

Audio
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : 2
Codec ID/Hint : MP3
Duration : 29 min 13 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 2 channels
Sampling rate : 44.1 kHz
Compression mode : Lossy
Stream size : 26.8 MiB (5%)
Writing library : LAME3.98.2

I guess I just remux them all to mkv.