Log in

View Full Version : Making a dummy video


aax
9th August 2016, 01:04
Seeking help from the wise old men of Doom9.

What would be the simplest way to create a dummy video with an exact number of blank frames and smallest size possible, preferably from the command line and without the need for an image file to serve as a basis?

poisondeathray
9th August 2016, 01:10
Seeking help from the wise old men of Doom9.

What would be the simplest way to create a dummy video with an exact number of blank frames and smallest size possible, preferably from the command line and without the need for an image file to serve as a basis?

probably ffmpeg for CLI

What characteristics did you want ?

eg. make a black video, 24 frames long, fps 24, using libx264 crf22 , mp4 container



ffmpeg -f lavfi -r 24 -i color=c=black:s=1920x1080 -frames:v 24 -c:v libx264 -crf 22 -an blank.mp4

aax
10th August 2016, 23:18
Perfect, that's just what I need. Just a couple of things:

- How can I get a raw video stream without container? Using just "blank.h264"?
- What's the command if I want to use duration instead of frames?
- I read that -crf expects a range between 0 and 51, so shouldn't I just use 51 since I want worst quality and smallest size?

Groucho2004
10th August 2016, 23:51
the wise old men of Doom9
There is no such thing. It's a myth that we ageing nerds spread to get you young neophytes show some respect. :)

poisondeathray
11th August 2016, 01:39
- How can I get a raw video stream without container? Using just "blank.h264"?



Yes, but you can explicitly specify -f h264 for format as well

-f h264 output.264



- What's the command if I want to use duration instead of frames?


-t for duration
hh:min:sec.ms notation

e.g. 1 min, 10 second, 250 ms

-t 00:01:10.250

The number of frames will be based on the frame rate you entered with -r


- I read that -crf expects a range between 0 and 51, so shouldn't I just use 51 since I want worst quality and smallest size?

Yes





You can make it even smaller by increasing the max gop length -g (default is 250), and the number of max consecutive b-frames -x264opts bframes=16

But that will negatively impact seeking and compatibility for some scenarios

Or another way is to use VFR in a compatible container like mp4 or mkv (variable frame rate, basically 1 frame can be played for any duration), but that's limited to specific scenarios as well - so it depends on why you need this

Sharc
11th August 2016, 08:08
Other possibility via an Avisynth script, for e.g. for 10 black frames:
BlankClip(10,720,480,"YV12",color=color_black,fps=23.976)

aax
12th August 2016, 22:49
Thanks for the help. I got everything I need now.