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

  • Home
  • SEARCH
  • 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 7551781
In Process

The Archive Base Latest Questions

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

Background: I have encoded a raw h264 file using ffmpeg. I’m trying to create

  • 0

Background:
I have encoded a raw h264 file using ffmpeg. I’m trying to create my own container like how Smooth Streaming works with fragmented mp4 containers. I’m not happy with the security of smooth stream though since anyone can completely rip a file from IIS with appropriate authentication.

Problem
Anyway I have my raw h264 stream playback “kinda” working using MediaStreamSource within Silverlight with ssl enabled but I can’t get my timestamp right for the chucks that I’m sending from server side to the MediaStreamSource within the silverlight client. There is a delay between h264 data chunks which I have parsed by sps Nals. I saw this question for getting duration. Wondering if there is an easy way to count frames in a h264 stream and get a duration so that I can relay an accurate timestamp to the MediaSampleSource. If someone can A: point me in the direction of an open source frame counter or give me some pseudo code for parsing out frames (Maybe some Hex parsing tips). Or maybe someone has some experience with this exact issue that would be great. Any help would be greatly appreciate. Thanks in advance.

  • 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-30T10:35:06+00:00Added an answer on May 30, 2026 at 10:35 am

    I dug through the ISO 14496-10 Documentation and found some hex strings for finding frames in a raw h264 stream:

    0x00000141,
    0x00000101,
    0x00000165

    If you go through your stream and count these hex strings and your encoding with ffmpeg and libx264 this should get you a pretty solid frame count. (Please Someone Correct Me If I’m wrong). So if you have the total duration of the h264 video and you have the FPS which you should be able to easily get from ffmpeg then you can use the amount of frames calculated in any given chunk of data that is passed to the MediaStreamSource to get a very accurate TimeStamp for you MediaSampleSource. Hope this helps someone because it was really frustrating me a couple nights ago when my playback was all choppy.

    Edit

    As I have tested my playback feature in directshow I have noticed that this is not perfect and only works for simplistically encoded h264 streams using ffmpeg. h264 has variable framerates and bitrates. Although the video runs pretty smoothly, a discerning eye can see that at more complex sequences in the video the timing is a bit awkward. I think for a crude video streaming player this is a fine method especially if keyframes are frequently used. I thought it would be fair to add this before I clicked answered.

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

Sidebar

Related Questions

Background I have been asked by a client to create a picture of the
Background I have made a Web Service in Visual Studio, and I'm trying to
Background: We have a project with many modules. We're using EntityFramework 4.2 with FluentAPI
Background: we have a Grails 1.3.7 app and are using Liquibase to manage our
I have the following code to create a jpg file from a movieclip: var
Background have a custom UITableCellView in which I'm using a custom UITextField that I've
Background: I have a little video playing app with a UI inspired by the
Background I have a massive db for a SharePoint site collection. It is 130GB
Background: I have a kubuntu laptop right now that I can't use wirelessly, i.e.
Background: we have an application that generates reports from HTML (that may or may

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.