View Full Version : How to set framerate in raw h264 stream?
rack04
27th May 2009, 15:15
How can I set the framerate in a raw h264 stream? When I demux the raw h264 stream from .mov and .mp4 it appears that mp4box doesn't set the framerate in the demuxed stream. This causes problems when I want to index with DGAVCIndex since it defaults to 25 fps if the stream doesn't contain a framerate. Thanks for any guidance.
Keiyakusha
27th May 2009, 15:23
This causes problems when I want to index with DGAVCIndex since it defaults to 25 fps if the stream doesn't contain a framerate.
Can I ask what problems it causes? I think simple AssumeFPS("ntsc_film") or similar should help...
DeeGee
27th May 2009, 15:25
My understanding is that raw h.264 streams don't have any framerate info to begin with. Only the containers do. I don't think there is a manual option for framerate in DGAVCIndex, but as you are probably using the project in AviSynth, you can just set the framerate there.
[edit] Like in the example above.
rack04
27th May 2009, 15:26
Can I ask what problems it causes? I think simple AssumeFPS("ntsc_film") or similar should help...
I have a batch file that indexes the file using DGAVCIndex, creates the AviSynth Script, and then encodes using x264. If the framerate isn't specified in the raw h264 stream DGAVCIndex defaults to 25 fps. If I don't manually correct the FPS value in the DGA file I may encode using the wrong framerate.
My understanding is that raw h.264 streams don't have any framerate info to begin with. Only the containers do. I don't think there is a manual option for framerate in DGAVCIndex, but as you are probably using the project in AviSynth, you can just set the framerate there.
[edit] Like in the example above.
As far as I know eac3to is able to set the framerate but this requires the raw h264 stream to be encoded with AUDs. Also, tsMuxeR can determine the framerate from the raw h264 stream.
Keiyakusha
27th May 2009, 15:37
Well then maybe you want to include mediainfo cli in your batch file. It will read framerate info from original file and then you can include that info in avs script by adding AssumeFPS(). But this is just guess, I never used mediainfo cli by myself...
DeeGee
27th May 2009, 15:37
Ah, i guess i'm mistaken then. But is there a reason to use DGAVCIndex? Couldn't you just use the .mov/.mp4 files directly with either some avisynth plugin or mplayer/ffmpeg piping to x264?
rack04
27th May 2009, 15:44
Ah, i guess i'm mistaken then. But is there a reason to use DGAVCIndex? Couldn't you just use the .mov/.mp4 files directly with either some avisynth plugin or mplayer/ffmpeg piping to x264?
DGAVCDec is frame accurate so I can set custom i-frames that coincide with chapter marks.
Trahald
27th May 2009, 15:59
if dgavcindex is anything like the mpeg2 one , you can change the framerate in the index file (.dga?) the framerate i think is not listed as fps but as it is stored. ie 23.976 shows as 48000/1001 (framerate * 2)
DeeGee
27th May 2009, 16:30
I know that atleast DirectShowSource isn't frame accurate, but how about ffmpegsource (http://forum.doom9.org/showthread.php?t=127037)? Does anyone have solid info?
[edit] Just checked ffmpegsource's documents and it claims to be frame accurate with mp4.
rack04
28th May 2009, 17:48
Well I figured out how to read the framerate from VUI Parameters.
http://i11.photobucket.com/albums/a199/rack04/h264framerate.jpg
Other than re-encoding is there a way to add the num_units_in_tick and time_scale VUI parameters to a raw stream?
Trahald
28th May 2009, 18:22
h264info will do it. the only thing is it 1) rewrites the entire stream .. very slowly. although its way faster than a reencode. 2) it adds hrd info to the stream i think pretty much always now, even if you dont want/need it to.
look up batchccews on sourceforge.net and goto the last release. its in there.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.