Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd December 2015, 17:50   #1  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Show Encoded IFrame and PFrame Using JM reference software as an Image

I have encoded foreman video using JM Reference software. I have got encoded file which I have converted into hex file. This is the link of that hex file Hex File

Now What I am doing is that, I am reading this file in matlab. I know that each frame starts with "00 00 00 01". So I found all the indices where this string is present and then I read from one "00 00 00 01" to other and try to convert that in Image. i want get an image from h.264 video stream and want to analyze motion characteristic of it. Is it even possible what I am trying to do please help me out.
mushahidh is offline   Reply With Quote
Old 3rd December 2015, 02:52   #2  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
You've chosen a real rabbit hole for yourself; parsing AVC isn't easy, and doing it in Matlab is even harder. You should consider hooking into ffmpeg or gstreamer to do most of the parsing for you; gstreamer can only parse everything down to the slice header, while ffmpeg of course can parse everything, but gstreamer's API is friendlier and easier to use for analysis. There aren't many other options for parsing helper libraries unless you want to pay thousands of dollars.

Otherwise, grab a copy of the spec and start working; it'll probably be one to several weeks just to get unoptimized parsing finished.
foxyshadis is offline   Reply With Quote
Old 3rd December 2015, 06:57   #3  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
why its hard?

Quote:
Originally Posted by foxyshadis View Post
You've chosen a real rabbit hole for yourself; parsing AVC isn't easy, and doing it in Matlab is even harder. You should consider hooking into ffmpeg or gstreamer to do most of the parsing for you; gstreamer can only parse everything down to the slice header, while ffmpeg of course can parse everything, but gstreamer's API is friendlier and easier to use for analysis. There aren't many other options for parsing helper libraries unless you want to pay thousands of dollars.

Otherwise, grab a copy of the spec and start working; it'll probably be one to several weeks just to get unoptimized parsing finished.
Thanks for your response. Well i start working on it by inspiring from this Thread. what i want at the end is to add RS code redundancy to encoded video and pass it through the noisy channel so that if some packet get lost i can recover it using those redundancy bits. Secondly, detecting Frame starting and ending isn't too much hard. I have parsed the whole H.264 file and detected I,P and B frames.
So why are you saying it's much hard to do in matlab? And why its easy in your suggested technologies? How can i start understanding long long codes of ffmpeg Instead i start writing my own in matlab?
Also i need your suggestion in my specific scenario i.e to add redundancy using RS codes at frame or GOP level and pass it through noisy channel and solve error before decoding.
mushahidh is offline   Reply With Quote
Old 3rd December 2015, 10:40   #4  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
I'm confused now; if you just want to include error-correcting codes, why do you need deep parsing? You said you wanted to "analyze motion characteristic" which requires decoding every part of the stream, from the slice header and reference list, to the individual macroblock predictors and motion vectors, including decoding CABAC. If you just want to add ECC, then just add ECC. Slice the stream up into units of information (typically a constant number of bytes, but individual frames or slices would work) and insert the correcting codes however you want, like an SEI message. Sounds like you've already solved the parsing part of your problem.
foxyshadis is offline   Reply With Quote
Old 3rd December 2015, 16:36   #5  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Yeah that's right . Actually the problem is that i'm bit confused my self so unable to convey my message properly. The idea is to add redundant bits based on motion characteristics of frame. So for example if two P frames are identical than there is no need to add equal amount of redundancy to both frames.
What exactly i want is to
1) Encode video
2) Based on motion characteristics add redundancy to each frame
3) Pass it through noisy channel
4) Perform error correction
5) Decode video
6)Calculate SSIM and VQM.
I have following question it would be great if you answer
1)let me know if It is a good idea that if i get motion characteristics of YUV file and then encode the video and give priority to those frames which have identical motion characteristics?
2) What are common noisy channels through which i should pass my data and test it in matlab?
3) And why it is not common among any of the software to add redundant bits to the video? None of the software gives the option to add redundant bits.

Based on my problem your experienced opinion is also valuable . Kindly share your thoughts if i'm thinking on a wrong direction.
Thanks
mushahidh is offline   Reply With Quote
Reply

Tags
frame, h.246, matlab, parsing

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.