VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. Hi guys

    Before I try to reinvent the wheel, I would like to know if someone has already done this:

    Basically I am looking for a tool/library that can open a MPEG-2 ES/PS stream and output various information about the frames inside it :

    e.g:

    - How many GOPs are there ? How many Frames are there ?
    - What are the characteristics of each GOP ? how many B/I/P frames are in each GOP ?
    - what is the bit-rate ?
    - resolution
    - frame-rate
    - MPEG2 profile used e.g. 4:2:0, 4:2:2 etc. is it one profile for all GOPs or different for each GOP ?
    - Macroblock characteristics
    - DCT parameters
    - Quantisation params
    - Any other information (on a GOP-by-GOP or frame-by-frame basis)

    I'll be later using these data to build a application model for research.

    Many thanks
    Quote Quote  
  2. gspot (free) can reveal most of those , mediainfo (also free) (view=>text) can provide some others

    you might need more advanced stream analyzing tools for some parameters (e.g. elecard streameye)
    Quote Quote  
  3. Thank you so much for your advice !
    Quote Quote  
  4. Hi

    I've checked out the tools you've mentioned, the GSPOT tool is quite good.

    Is there a way to find out how many GOPs a *.mpg movie has without parsing the whole MPEG file ? just by the mpeg file headers ??

    also the I:P:B ratios are they fixed for every GOP ? or would they vary depending on the complexity of the video ?

    thanks
    Quote Quote  
  5. Originally Posted by Rosh View Post


    Is there a way to find out how many GOPs a *.mpg movie has without parsing the whole MPEG file ? just by the mpeg file headers ??
    Not with any accuracy, because GOP size isn't always fixed


    also the I:P:B ratios are they fixed for every GOP ? or would they vary depending on the complexity of the video ?
    No, it can vary as well, depending on settings, encoder used etc..


    But sometimes GOP size and frametype placement is always fixed (e.g. hardware encoders for MPEG2 camcorders) , then you can deduce the information from the framecount
    Quote Quote  
  6. Press the little VGS button on GSPot. You can see the structure of every GOP.
    Quote Quote  
  7. the I:P:B ratios are they fixed for every GOP ?
    -nope.
    Quote Quote  
  8. You can estimate the total number of GOPs with:

    running_time * fps / average_GOP_size
    Quote Quote  
  9. You can estimate the total number of GOPs with:
    running_time * fps / average_GOP_size
    only if calculations are based upon very accurate data, otherwise -/+1.
    Quote Quote  
  10. Originally Posted by enim View Post
    You can estimate the total number of GOPs with:
    running_time * fps / average_GOP_size
    only if calculations are based upon very accurate data, otherwise -/+1.
    That's why I said "estimate", not "calculate".
    Quote Quote  
  11. estimations are okay as long as long as the error is relatively small. I actually need an upper bound value.

    in terms of the following :
    running_time * fps / average_GOP_size

    so
    1) how would I find the average_GOP_size by the mpeg2-header ?
    2) similarly running_time is that from the GOP section (start code 0xB8) ?
    3) @enim : why did you say +/- 1 ? that seems very low is it not ?

    Thanks for the help guys.

    Just out of curiosity, do you'll know how to calculate an upper bound for the memory requirements for mpeg-decoding as well ?

    thanks
    Quote Quote  
  12. Originally Posted by Rosh View Post
    1) how would I find the average_GOP_size by the mpeg2-header ?
    GSPot tells you the average GOP size in the video section.

    Originally Posted by Rosh View Post
    2) similarly running_time is that from the GOP section (start code 0xB8) ?
    GSpot reports the video running time and frame rate in the video section.

    Originally Posted by Rosh View Post
    3) @enim : why did you say +/- 1 ? that seems very low is it not ?
    It's worse than that with GSpot because GSpot reports the average GOP size as an integer. And we (at least I) don't know if that values is rounded, truncated, or a median.

    Originally Posted by Rosh View Post
    Just out of curiosity, do you'll know how to calculate an upper bound for the memory requirements for mpeg-decoding as well ?
    That will depend on the decoder. The decoder will have to have at least enough memory to hold the first I/P frame, the subsequent P frame, and all the B frames in between. (The size of those uncompressed frames will vary depending on the colorspace used.) Plus enough memory for at least part of one encoded frame.

    Mpeg Validator gives more detailed information. Including the total number of GOPs.
    Last edited by jagabo; 28th Jan 2014 at 09:42.
    Quote Quote  
  13. I mean can these values be extracted without using GSPot ? (i.e. are they included in the mpeg header, so i can extract them myself using another language - python/c etc.)

    thanks

    Originally Posted by jagabo View Post
    Originally Posted by Rosh View Post
    1) how would I find the average_GOP_size by the mpeg2-header ?
    GSPot tells you the average GOP size in the video section.

    Originally Posted by Rosh View Post
    2) similarly running_time is that from the GOP section (start code 0xB8) ?
    GSpot reports the video running time and frame rate in the video section.

    Originally Posted by Rosh View Post
    3) @enim : why did you say +/- 1 ? that seems very low is it not ?
    It's worse than that with GSpot because GSpot reports the average GOP size as an integer. And we (at least I) don't know if that values is rounded, truncated, or a median.

    Originally Posted by Rosh View Post
    Just out of curiosity, do you'll know how to calculate an upper bound for the memory requirements for mpeg-decoding as well ?
    That will depend on the decoder. The decoder will have to have at least enough memory to hold the first I/P frame, the subsequent P frame, and all the B frames in between. (The size of those uncompressed frames will vary depending on the colorspace used.) Plus enough memory for at least part of one encoded frame.

    Mpeg Validator gives more detailed information. Including the total number of GOPs.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!