Log in

View Full Version : How to insert blank frame in a h246 stream ?


Sergejack
8th July 2005, 15:50
I have a 24fps raw x264 that I want to make 120fps.
I used to work with VDUB and simply use "change framerate" + direct stream copy.
How to do that with non vfw tools ?

bond
8th July 2005, 16:15
afaik there is nothing like n-vops in h.264, so its propably not possible to insert "blank frames"

Sergejack
8th July 2005, 17:02
I don't know if I should use the words "blank frame" but, when I used VDUB to make h264 avi file, I could change the framerate and use direct stream copy.

bond
8th July 2005, 17:04
changing the framerate is of course very easy

simply import the raw stream for example to .mp4 with mp4box or mp4creator and set the framerate you want

Sergejack
8th July 2005, 17:43
changing the framerate is of course very easy

simply import the raw stream for example to .mp4 with mp4box or mp4creator and set the framerate you want

I don't want to change the duration neither the perceptive speed, just the number of frames.

bond
8th July 2005, 17:54
i doubt that changing the framerate in virtualdub changes the framenumber

if you want to change the framenumber with avc than you will have to reencode the stream again and use an avisynth script which duplicates the frames as you need it

Sergejack
8th July 2005, 19:58
i doubt that changing the framerate in virtualdub changes the framenumber

If you set 119.88fps using a 23.976 fps file in framerate convertion in vdub and save the resulting video using direct stream copy, the frame number will e multiplied by 5.
Since that process is very fast and the resulting file can be decoded nearly as fast as the original one despite having 5 times more frames, I guess there's is a way to insert "null frames".

lamer_de
8th July 2005, 21:26
If you set 119.88fps using a 23.976 fps file in framerate convertion in vdub and save the resulting video using direct stream copy, the frame number will e multiplied by 5.Interesting. I didn't know that.
It's pretty pointless though, as this process will not allow you to create files with segments that have a different source framerate. You need special tools for that to create the "common" 120fps file (In guess, at least that's the way I read it in guides).

CU,
lamer_de

berrinam
8th July 2005, 23:45
If you set 119.88fps using a 23.976 fps file in framerate convertion in vdub and save the resulting video using direct stream copy, the frame number will e multiplied by 5.
Since that process is very fast and the resulting file can be decoded nearly as fast as the original one despite having 5 times more frames, I guess there's is a way to insert "null frames".
I tried with VirtualDub and VirtualDubMod, and I haven't been able to do what you say. Every time I change the framerate, the length of the video changes and the number of frames stays constant.

Sergejack
9th July 2005, 02:37
Here is a sample made with using a 23.976fps H264 avi file (itself made using vdub).

Sergejack
9th July 2005, 02:43
Interesting. I didn't know that.
It's pretty pointless though, as this process will not allow you to create files with segments that have a different source framerate. You need special tools for that to create the "common" 120fps file (In guess, at least that's the way I read it in guides).

CU,
lamer_de

It's just the opposite.
If you have an 36 fps segment and a 24 fps segment you still can convert those into 72 fps segments then joint them.

119.88 (fps) is the common mutiplicator of 23.976 (fps) and 29.97 (fps).

Doom9
9th July 2005, 11:44
I've played through that scenario with both x264 and libavcodec mpeg4 and I have come to the same conclusion as berrinam.. it doesn't change anything but the fps in the header. What you're experiencing is some weird anomaly but it's definitely impossible for VDub to add or remove frames without recompression (and in fact for every other tool.. imagine you're removing a reference frame.. that'll cause havoc when decoding).

Sergejack
9th July 2005, 15:19
I've played through that scenario with both x264 and libavcodec mpeg4 and I have come to the same conclusion as berrinam.. it doesn't change anything but the fps in the header. What you're experiencing is some weird anomaly but it's definitely impossible for VDub to add or remove frames without recompression (and in fact for every other tool.. imagine you're removing a reference frame.. that'll cause havoc when decoding).

It can't remove any frame.
I can set 120 fps to a 24 fps animation, but not the opposite (120->24).
And I should be able to if it was just a setting in the header.

Anyway, did you check the sample I made ?

Doom9
9th July 2005, 15:26
Anyway, did you check the sample I made ?Yes, and as I said, something is wrong with it. You cannot add frames in direct stream mode. Read up in video compression.. it's just not possible in this scenario. We have frames that depend on each other, you cannot just add stuff to that without breaking anything.

Sergejack
9th July 2005, 16:25
afaik there is nothing like n-vops in h.264, so its propably not possible to insert "blank frames"

Aren't n-vop relative to the container ?

Anyway, I guess I don't need to convert 24fps and 30fps animations to a common 120fps since VBR should be usable now. I didn't want to get involved with real VBR that early tough.

EDIT : VFR

bond
9th July 2005, 17:24
Aren't n-vop relative to the container ?no

Anyway, I guess I don't need to convert 24fps and 30fps animations to a common 120fps since VBR should be usable now. I didn't want to get involved with real VBR that early tough. i guess you mean vfr

winman
9th July 2005, 19:14
It is a new feature added to recent version of VirtualDub:

Build 23538 (1.6.7, experimental): [June 12, 2005]
[features added]
* Script: Added support for cast expressions to int/long/double.
* Video direct-stream path now treats zero-byte (drop) frames as non-
essential. A video stream that has been spaced with drop frames to a
higher frame rate can now be cleanly converted down as well.

VirtualDub will remove the [D] frames when down converting 119.88 to 23.976 or 29.97.

Also will insert [D] frames when up converting 23.976 or 29.97 to 119.88.

Unless original source is a hybrid of 23.976 and 29.97, up converting to 119.88 is totally pointless and a waste of time from technical point of view. However, some people think that raw ain't "leet" if it is not 120 fps. Also, some will actually do this to make the raw "just a tad different" from the original.

Fortunately, with this new feature, it is a simple task of doing down converting with-in VDUB without using FDecimate() or multiples Decimate().

berrinam
10th July 2005, 00:26
Ok, I have tested based on Sergejack's screenshot, and I have been able to change the framerate in the way Sergejack described. However, when trying to convert it with avi2raw, it told me that 57 video frames had been written, and 117 empty frames dropped (I had increased the framerate by 3x), so it seems that this sort of thing is not possible without hackery in raw, and therefore mp4 files.

bond
10th July 2005, 13:00
first of all drop frames are frames that are no frames :D
meaning afaik avi is told that there is a frame and it reserves the space for the frame, but actually in this space there is no frame

so a 2 frame avi file with 2 drop frames actually has no frames stored
therefore if you extract the "video stream" from this avi file to raw you will get no frames, as there are none
therefore this is all done on the container level and not the stream level

therefore it has to be said that drop frames are different than n-vops, as n-vops are real frames (part of the mpeg-4 asp standard, but not avc)

MeteorRain
11th July 2005, 09:35
try using avi60 to insert null frames into an avi file.