I have a mp4 file that has only video data without moov atom. I have parsed the SPS, PPS. I'm trying to decode the video frames and NALU in this data. When I process each byte of this data to find NALU, I'm getting a false NALU because in RBSP data there are some bytes which are similar as NALU header (0x65, 0x01, 0x21, 0x61). The video data is in AVCC format, not in Annex B so I cannot find the start code to know the starting of the NALU. Is there anything with i can compare the NALU size to find out that it is a valid NALU or not?
how to differentiate between valid and invalid NALU in AVCC?
471 Views Asked by Mohammad Azam At
1
There are 1 best solutions below
Related Questions in VIDEO
- How to open and read video stream in Matlab
- Extract bytes of specific stream from mpegts file using ffmpeg
- AVQueuePlayer crashes when I try to observe the start of the next video: AVPlayerItem was deallocated with observers
- How to get the time stamp of each frame of a GoPro video in MATLAB?
- DFP Videos Ads Internal error
- Get youtube video information using javascript and Youtube-API
- YouTube views not counting on Wordpress embed
- Videos not working on phones using HTML
- How to track multiple youtube videos in google analytics
- Cloudfront stream only part of the video
- Changing switch statement to include both mp4 and ogg files
- How to detect squares in video with OpenCV?
- Saving iOS video buffer
- dynamic video source change issue in azure media player
- Video Editing For Android
Related Questions in VIDEO-PROCESSING
- How to open and read video stream in Matlab
- How to find the average of compression ratios of video manually?
- FFMPEG concat videos
- qtimer and opencv running slow
- Why does video resolution change when streaming from Android via WebRTC
- error: <destination> color.cpp:3650: error: (-215) scn == 3 || scn == 4 in function cvtColor
- How to grab video frames in Qt?
- Beaglebone Black: Video capture & Object Detection Same Time?
- JavaCV Error in Android
- JavaCV convertToIplImage return NULL
- Add animated overlay image to video
- I can't get the resolution of 1334x750 whether through handbrake or ffmpeg
- ffmpeg sepia effect on video
- How to trim the video file and convert to 20 seconds video with Swift?
- How to find the maximum distance between five points?
Related Questions in H.264
- Realtime/zero-latency video stream: what codec parameters to use?
- Including SPS and PPS in a raw h264 track
- How to get width and height from the H264 SPS using ffmpeg
- VLC in Raspberry Pi won't play h264 video file
- Converting mkv to h264 FFmpeg
- Convert JPEGs to H264 and stream to my server
- H.264 decoding error log from RTSP stream
- How to extract key-frames closest to given frame numbers from H264 video with ffmpeg
- Configure MediaCodec with the proper MediaFormat from a raw H.264 byte buffer
- Record and play h.264 video in memory using Jcodec
- forcing VLC to play h264 video file
- Decoding a h264 (High) stream with OpenCV's ffmpeg on Ubuntu
- What video encoder gives best performance on an Android device for given quality?
- Demux H264 from (already recorded) raw RTSP stream on HDD
- Color Banding Playing Live Raw H.264 Stream In Android
Related Questions in MPEG-4
- HTML5 Video MP4 Codec Settings
- Larger image size in outdoor lighting for H.264
- AVAudioRecorder Losing Last Seconds
- Get .mp4 file length Python
- A few questions about the startcode of NALU
- How to port mp3 code to a ARM board
- IOS versions and HTML5 video support
- Video won't play in Quicktime
- Is there a specification for AAC-LC (de)compression?
- Detecting I-frame data in an MPEG-4 transport stream
- Can you find key frame (I-frame) in h264 video without decoding? i.e. is it in packet?
- h.264 and mpeg header
- Size / Compression of MJPEG vs MPEG-4
- Find keyframes in AVI, H.264 file
- DirectShow Mpeg4 filters in a Web Application
Related Questions in NALU
- transcoding part anexB bitstream
- Invalid NAL unit size for MP4 created from NALU with 3-byte start code (0x000001)
- Transmux two videos to side by side without reencoding
- How many h264 packets could make up a complete frame(yuv/rgb)
- how to differentiate between valid and invalid NALU in AVCC?
- FullCalendar in GWT : How to refresh calendar while keeping events
- Is it necessary to transmit predicted block of intra-prediction of H.264 or H.265 to decoder side?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I guess you have MP4 'mdat' atoms with some h.264 payload data in each one. Or maybe you have RFC 6184 payload data. You didn't say.
You should look at the first 'mdat' atom to look for your SPS and PPS NALUs.
That 'mdat' atom probably looks something like this.
In other words, each NALU in the 'mdat' starts with a four-byte length, then the NALU. It can also be a three-byte or two-byte length (two-byte is pretty doggone useless). RFC 6184's definition of Single Time Aggregation Units calls for four-byte lengths.
If the stream is in annexB, each NALU starts with either
00 00 01or00 00 00 01rather than a length.SPS and PPS NALUs don't have a fixed size. And they're hard to parse because their contents are coded using a variable-length scheme called exponential Golomb coding. So your best bet, if you possibly can, is to find their boundaries and treat them as opaque, but variable-length, chunks of bytes.
I put together some Javascript to parse SPS and PPS NALUs because I had a similar problem to yours.