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 6183333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:20:52+00:00 2026-05-24T01:20:52+00:00

I have H264 encoded Video file came from Android mobile camera and I want

  • 0

I have H264 encoded Video file came from Android mobile camera and I want to get the frames and store them as files one by one. The problem is, how can I distinguish the frames, do the frames split up by some special tag? Now I have this function which can get the frames length by bytes, maybe it helps to understand my questions,Thx:)

  public static int h263Parse(byte[]buf, int offset, int nLen)
{
            int vop_found, i;          
    vop_found = 0;        
    i=0;
    if(vop_found == 0)
        {
        for(i=(offset + 3); i<(offset+nLen); i++)
                {
            if(buf[i-3] == 0x00)
                    if(buf[i-2] ==  0x00)
                            if((buf[i-1]&0xff) < 0x84)
                                    if((buf[i-1]&0xff) >= 0x80)
                        {
                i++;
                vop_found=1;
                break;
            }
        }
    }

    if(vop_found == 1)
        {
        for(; i<(offset+nLen); i++)
                {
                if(buf[i-3] == 0x00)
                    if(buf[i-2] ==  0x00)
                            if((buf[i-1]&0xff) < 0x84)
                                    if((buf[i-1]&0xff) >= 0x80)
                        {
                return i-3-offset;
            }
        }
    }
    return -1;
}
  • 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-24T01:20:53+00:00Added an answer on May 24, 2026 at 1:20 am

    I seriously don’t know what your code is doing (because it is named h263parse) and you are asking about h264.

    Anyways, H264 frames do split up by a special tag, called the startcode prefix, which is either of 0x00 0x00 0x01 OR 0x00 0x00 0x00 0x01
    All the data between two startcodes comprises a NAL unit in H264 speak. So perhaps what you want to do is search for the startcode prefix in your h264 stream and do something with the NAL unit that follows (until the next startcode prefix) in the stream.

    Something like this perhaps:

    void h264parse_and_process(char *buf)
    {
        while(1)
        {
            if (buf[0]==0x00 && buf[1]==0x00 && buf[2]==0x01)
            {
                // Found a NAL unit with 3-byte startcode, do something with it
                do_something(buf); // May be write to a file
                break;
            }
            else if (buf[0]==0x00 && buf[1]==0x00 && buf[2]==0x00 && buf[3]==0x01)
            {
                // Found a NAL unit with 4-byte startcode, do something with it
                do_something(buf); // May be write to a file
                break;
            }
            buf++;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have received the following video file from a camera (from security camera) http://dl.dropbox.com/u/1369478/tmw/recording.264
I want to capture live video streams to .mp4 file. I have downloaded H264
I have images which are H264 encoded. I have generated a video from these
I have a 11-minute .mkv file with a h264 video stream, taking up 184MB
Background: I have encoded a raw h264 file using ffmpeg. I'm trying to create
The scenario is this: My Windows client app gets H264-encoded frames from a network
I have encoded a video with H.264 using handbrake all the standard settings for
I have a group of H.264 images (I-frames only) that I want to encode
What i want to do is the following procedure: Get a frame from the
I have a *.mp4 video file(MPEG4 video codec) and I am trying to convert

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.