Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 545879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:48:30+00:00 2026-05-13T10:48:30+00:00

This might be a way too generic question, but what is the general approach

  • 0

This might be a way too generic question, but what is the general approach for seeking within media files (video or audio of any kind/format) if the data has variable bitrate (VBR)?

It seems an easy thing to do if the stream has a constant bitrate (CBR). E.g. if you know it is 256 kbit/s and you want to seek forward/backward by 30 seconds, just calculate how many bits that are (approximately), convert that to byte and seek that many byte forwards/backwards in the file. Finally keep on reading and parsing till the next header/block-start/keyframe/whatever is found and continue playback from there.

Okay, but what do you do if the bitrate is highly variable? E.g. it can be anything from 32 to 512 kbit/s and keeps changing frequently? I know that this might depend on audio/video format. Some file formats have index tables at the beginning/end you might use and some files contain pointers in the stream how many bytes to skip for skipping the next X seconds. In that case you can work with that information, however, what if the format has no such table or pointers?

The most naive approach I can think of is to just estimate the bitrate as good as possible (e.g. by looking at the average bitrate of the last couple of seconds you played back), jumping where you think it could be correct according to the estimated bitrate, and look how far you really jumped. If you jumped too much, try jumping back a bit. If you jumped too little, try jumping forward a bit. Maybe keep jumping in one direction till you jumped too far again, now reverse the direction again as well as the step size (similar to a binary search algorithm). Each time you jumped too far, you reverse the direction and decrease the step size. You will get closer and closer to the correct point and if you are close enough (below some chosen delta), just start playing again (after all the jump doesn’t have to be accurate to the millisecond).

While the algorithm above might work, it sounds rather poor and is probably very slow in practice. So how is it really done? Anyone ever wrote a media player/player-plugin of some kind? Or is it just like this that every “decent” format supporting VBR must have some kind of index tables or skip pointers in the stream if it expects software to correctly seek and not just play from start to end?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:48:30+00:00Added an answer on May 13, 2026 at 10:48 am

    This is exactly why (for example) DVDs use VOB files instead of raw bitstreams. With a VOB file you get not only the bitstream itself, but also pointers to consecutive frames, so you can skip to another frame quickly and easily.

    OTOH, most video bit streams are designed so it’s fairly easy to synchronize and find the beginning of a frame (necessary for things like broadcast TV), so estimating (and rounding down), then searching for a frame start works reasonably well also. Many also have constraints on the maximum compression rate that’s acceptable, so careful estimation can give you reasonably close to the beginning of a frame.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be a stupid question but if there's a better or proper way
This might seem like a stupid question I admit. But I'm in a small
This might sound like a little bit of a crazy question, but how can
This might be an odd question, but when I scale my image in C#
I think I might be approaching this in the wrong way, so I would
This might be on the discussy side, but I would really like to hear
This might be a bit on the silly side of things but I need
This might seem obvious but I've had this error when trying to use LINQ
This might be an interesting question. I need to test that if I can
This might be a little hard to explain, but I will try. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.