VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Member
    Join Date
    Feb 2007
    Location
    United States
    Search Comp PM
    As many of you may know, the Hauppauge HD PVR produces some nice looking recordings from HD cable or satellite. However, the file format is a bit odd in that the files are difficult to edit and/or re-encode. I have been trying to come up with an effective and reproducible method for re-encoding the H.264 recorded files with a lower bitrate to reduce file size. It has not been consistent. I have been reading about frame rates and how they are computed within a video stream using a rate and scale: fps = rate/scale. The HD PVR produces H.264 streams with very odd rate/scale ratios. For example, a recording I made of CSI in HD had rate = 10000000 and scale = 166833 for 10000000/166833 = 59.9401797. As I understand it, these odd ratios can adversely affect playback and seeking with some software players. Hence, I would like to change the ration to 60000/1001 = 59.94005994.

    I have been working with x264 and DivX264 to re-encode my HD PVR recordings, but I cannot seem to change the rate/scale ratio using either encoder. Using the parameter --fps 60000/1001 does not change the ratio in the recorded file. Can anyone help me to determine if the rate/scale ratio can be changed and, if so, how? In addition, if I am incorrect in my assumptions or following a dead-end, let me know. Any help would be appreciated.
    Quote Quote  
  2. Guest34343
    Guest
    The fps info in those streams is 60000 / 1001. You must be using an unreliable tool to read that information, especially as you claim that re-encoding with --fps does not change the result.
    Quote Quote  
  3. Member
    Join Date
    Feb 2007
    Location
    United States
    Search Comp PM
    In truth, I discovered this 10000000/166833 ratio by accident when testing the DivX264 encoder. By creating an Avisynth script as follows

    video = DirectShowSource(e:\videos\csi.tp").Info()
    return video

    and opening the avs in VirtualDubMod, the result displayed is "Frames per second: 59.9402 (10000000/166833)". Is my method incorrect? I know of no other way to determine the rate/scale ratio as Mediainfo does not show the ratio and GSpot does not read AVC files. If I re-encode 100 frames to an mp4 file using x264 and use an avs script to get the file information, the rate/scale remains unchanged, whether or not --fps is in the x264 script.

    By the way, I experimented with --fps 29.97 in an x264 script and this did not change the frame rate from 59.94. What's wrong here?
    Quote Quote  
  4. Guest34343
    Guest
    OK, this is a bit tricky.

    Bottom line: DirectShowSource() cannot be trusted to return correct frame rate information. That's why it has an fps parameter -- so you can set it correctly!

    Here's how to definitively get the frame rate. First, the frame rate is determined by the syntax elements num_units_in_tick and time_scale. See here:

    http://www.atsc.org/standards/a_72_part_1.pdf

    ...Table 6.2.

    So, frame rate = time_scale / (2 * num_units_in_tick)

    Now to see those elements in your stream, first open it in DGAVCIndex. Set a small range including the start. Do Save Project and Demux Video. Now you have an elementary .264 file. Now get Jongov's H264VideoESViewer from here:

    http://tsviatko.jongov.com/index_prj...eoesviewer.htm

    Open the .264 file and highlight a Sequence parameter set. Then expand the vui_parameters in the right pane. Look for the variables above.

    You can short circuit all that by just seeing what DGAVCIndex reports, because it simply reports the frame rate based on the equation above, unless the vui data is missing, in which case it defaults to 25 fps. Since in this case it shows something other than 25 fps, then the vui data is present and 120000 / 2002 is written in the DGA file (I multiply the denominator by 2 so that the ratio is the frame rate). Note that DGAVCIndexNV shows 60000 / 1001 in the DGA file. It's the same rate but the numerator and denominator are divided by 2.

    I'd be happy to address the other oddities you say exist with some other applications. Maybe we can solve those problems!
    Quote Quote  
  5. Guest34343
    Guest
    Bump for important edits to above post.
    Quote Quote  



Similar Threads

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