VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. I want to be able to calculate a target bit rate for a two pass encoding to hit a specific file size.
    I can do this for avi/mp4/mkv/mov/m2ts (at least least relatively accurate) and there are quite a few sources out there talking about the container overhead for these containers, but I no discussion about flv container overhead.

    As video streams I would use: MPEG-4 AVC, VP8, VP9
    As audio streams I would use: mp3, aac, wav, speex
    Muxing would be done with: ffmpeg

    I know of the Adobe Flash Video File Format Specification and I know that knowing this specification and the ffmpeg source code it should be possible to come up with a 'rough' container overhead estimation, since this is a lot of work and I probably rather pass on flv as a container than trying to figure this out.

    Since I couldn't find any info using Google, I'm interested in this issue for quite some time and it doesn't seem to be too far fetched that someone already figured this out:

    Does anyone know how to calculate the container overhead of flv files before multiplexing?

    Or are there at least some folks that can share some 'rule of thumb' ways they use to estimate the overhead?

    Cu Selur
    Quote Quote  
  2. How accurately do you need to know the overhead? There will be a fixed overhead (ie a fixed size header), an overhead per track (each track will have info about it), and an overhead per frame of video, and chunk of audio. The fixed overheads are negligible for long videos but significant for very short videos.

    As a start, I'd just take a pair of video and audio elementary streams and mux them into an FLV file. The difference in size is the sum of all those overheads.
    Quote Quote  
  3. How accurately do you need to know the overhead?
    ideally as accurate as +/- 0.1MB
    good would be an accuracy of +/- 1MB
    at this moment anything which is just a few MB off would be a decent start.

    Input file sizes of the content would vary between ~160GB and 1MB, but most around 100 to 500MB.

    Cu Selur
    Quote Quote  
  4. Mux two videos (including audio), one very short, one very long, into two files.

    Code:
    filesize1 = (variable overhead * number of frames1) + fixed overhead
    filesize2 = (variable overhead * number of frames2) + fixed overhead
    Two equations, two unknowns.
    Quote Quote  
  5. Different (audio/video) frame sizes -> different container block sizes -> different overhead, such tries are simply too rough and will not get you any where near a usable estimation. (tried that with around 100 samples a few month ago, didn't really help)

    Cu Selur
    Quote Quote  
  6. Then you'll just have to get the FLV spec, analyze the structure, and compute the overhead. And, of course, different FLV muxers will pad differently, pack differently, and add different structures, so you'll have to account for each muxer and the different settings they can use.
    Quote Quote  
  7. Thanks, I know that and like I wrote before, I probably pass on flv as a container then. Took me quite a while to figure out a way to estimate the overhead of m2ts files (still can't really estimate the overhead of trueHD streams), don't have the time or motivation to start such a reading and testing marathon again. So the initial question still stands.

    Cu Selur
    Quote Quote  
  8. Originally Posted by Selur View Post
    Thanks, I know that
    Then why did you ask? Just hoping someone had figured out all out for you and would give you the equations?
    Quote Quote  
  9. Then why did you ask?
    Why shouldn't I? Isn't the purpose of asking about something, the hope of not having to 'invent the wheel again' ?
    It seems kind of normal for me to ask if someone knows a way to solve a problem before trying to solve it, if I know that it would require me month of reading and testing.
    I also thought that this might be interesting for other to know too.
    So, at least now I know that you are not interested in the problem and you don't really know anything useful about it, that I didn't know already, or do not care to share that information.

    Cu Selur
    Quote Quote  
  10. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Quote Quote  
  11. Thanks, but I already know the "Adobe Flash Video File Format Specification", it gave me some general hints, but didn't solve the problem.
    Quote Quote  
  12. It would have been helpful if your original post told us what you know already so we don't have to guess.
    Quote Quote  
  13. Sorry, I thought I wrote that when I wrote the
    I know of the Adobe Flash Video File Format Specification ...
    chapter. My mistake for not expressing me more precise. (should have left out the 'of' :/, my bad, this kind ofnuance sometimes slips by me)

    To make it clear:
    a. I know how to make educated guesses based on specifications and test samples.
    b. I know how to program in a bunch of languages
    c. I'm not to shabby when it comes to algorithm design and mathematics.
    So, yes if I send enough time and read up on all the stuff I could probably figure out some heuristic to calculate the overhead of the flv container. (for most newer containers the best you can hope for is a heuristic since you don't normally know the frame type ratios and similar stuff)
    Yes, flv container overhead calculation is not something I will spend days on figuring it out by my own, since it's not that important to me, since I normally do not use flv as a container and I really have not the drive too spend to much time with it.
    Yes, I assumed that others would have spend some time on this, since I assumed that it would be a relatively popular container format, seems like I was wrong.

    Cu Selur
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!