Module | FFMpeg::VideoOptions |
In: |
lib/ffmpeg/video_options.rb
|
Set bottom crop band size (in pixels).
# File lib/ffmpeg/video_options.rb, line 94 94: def crop_bottom(size) 95: FFMpegCommand << "-cropbottom #{size}" 96: end
Set left crop band size (in pixels).
# File lib/ffmpeg/video_options.rb, line 99 99: def crop_left(size) 100: FFMpegCommand << "-cropleft #{size}" 101: end
Set right crop band size (in pixels).
# File lib/ffmpeg/video_options.rb, line 104 104: def crop_right(size) 105: FFMpegCommand << "-cropright #{size}" 106: end
Set top crop band size (in pixels).
# File lib/ffmpeg/video_options.rb, line 89 89: def crop_top(size) 90: FFMpegCommand << "-croptop #{size}" 91: end
Disable video recording.
# File lib/ffmpeg/video_options.rb, line 135 135: def disable_video 136: FFMpegCommand << "-vn" 137: end
Set frame rate (Hz value, fraction or abbreviation), (default = 25).
# File lib/ffmpeg/video_options.rb, line 79 79: def framerate(fps) 80: FFMpegCommand << "-r #{fps}" 81: end
Add a new video stream to the current output stream.
# File lib/ffmpeg/video_options.rb, line 193 193: def new_video 194: FFMpegCommand << "-newvideo" 195: end
Set bottom pad band size (in pixels).
# File lib/ffmpeg/video_options.rb, line 114 114: def pad_bottom(size) 115: FFMpegCommand << "-padbottom #{size}" 116: end
Set color of padded bands. The value for padcolor is expressed as a six digit hexadecimal number where the first two digits represent red, the middle two digits green and last two digits blue (default = 000000 (black)).
# File lib/ffmpeg/video_options.rb, line 130 130: def pad_color(color) 131: FFMpegCommand << "-padcolor #{color}" 132: end
Set left pad band size (in pixels).
# File lib/ffmpeg/video_options.rb, line 119 119: def pad_left(size) 120: FFMpegCommand << "-padleft #{size}" 121: end
Set right pad band size (in pixels).
# File lib/ffmpeg/video_options.rb, line 124 124: def pad_right(size) 125: FFMpegCommand << "-padright #{size}" 126: end
Set top pad band size (in pixels).
# File lib/ffmpeg/video_options.rb, line 109 109: def pad_top(size) 110: FFMpegCommand << "-padtop #{size}" 111: end
Set frame size. The format is `wxh’ (ffserver default = 160x128, ffmpeg default = same as source). The following abbreviations are recognized:
'sqcif' 128x96 'qcif' 176x144 'cif' 352x288 '4cif' 704x576 'qqvga' 160x120 'qvga' 320x240 'vga' 640x480 'svga' 800x600 'xga' 1024x768 'uxga' 1600x1200 'qxga' 2048x1536 'sxga' 1280x1024 'qsxga' 2560x2048 'hsxga' 5120x4096 'wvga' 852x480 'wxga' 1366x768 'wsxga' 1600x1024 'wuxga' 1920x1200 'woxga' 2560x1600 'wqsxga' 3200x2048 'wquxga' 3840x2400 'whsxga' 6400x4096 'whuxga' 7680x4800 'cga' 320x200 'ega' 640x350 'hd480' 852x480 'hd720' 1280x720 'hd1080' 1920x1080
# File lib/ffmpeg/video_options.rb, line 64 64: def resolution(resolution) 65: FFMpegCommand << "-s #{resolution}" 66: end
Use same video quality as source (implies VBR).
# File lib/ffmpeg/video_options.rb, line 171 171: def same_video_quality 172: FFMpegCommand << "-sameq" 173: end
Set the video bitrate in bit/s (default = 200 kb/s or ‘200k’).
# File lib/ffmpeg/video_options.rb, line 69 69: def video_bitrate(bitrate) 70: FFMpegCommand << "-vb #{bitrate}" 71: end
Set video bitrate tolerance (in bits, default 4000k). Has a minimum value of: (target_bitrate/target_framerate). In 1-pass mode, bitrate tolerance specifies how far ratecontrol is willing to deviate from the target average bitrate value. This is not related to min/max bitrate. Lowering tolerance too much has an adverse effect on quality.
# File lib/ffmpeg/video_options.rb, line 143 143: def video_bitrate_tolerance(tolerance) 144: FFMpegCommand << "-bt #{tolerance}" 145: end
Set video buffer verifier buffer size (in bits).
# File lib/ffmpeg/video_options.rb, line 160 160: def video_buffer_size(size) 161: FFMpegCommand << "-bufsize #{size}" 162: end
`-vcodec codec’ Force video codec to codec. Use the copy special value to tell that the raw codec data must be copied as is.
# File lib/ffmpeg/video_options.rb, line 166 166: def video_codec(codec) 167: FFMpegCommand << "-vcodec #{codec}" 168: end
Set the number of video frames to record.
# File lib/ffmpeg/video_options.rb, line 74 74: def video_frames(number) 75: FFMpegCommand << "-vframes #{number}" 76: end
Set max video bitrate (in bit/s). Requires -bufsize to be set.
# File lib/ffmpeg/video_options.rb, line 148 148: def video_maximum_bitrate(bitrate) 149: FFMpegCommand << "-maxrate #{bitrate}" 150: end
Set min video bitrate (in bit/s). Most useful in setting up a CBR encode: ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v It is of little use elsewise.
# File lib/ffmpeg/video_options.rb, line 155 155: def video_minimum_bitrate(bitrate) 156: FFMpegCommand << "-minrate #{bitrate}" 157: end
Select the pass number (1 or 2). It is used to do two-pass video encoding. The statistics of the video are recorded in the first pass into a log file (see also the option -passlogfile), and in the second pass that log file is used to generate the video at the exact requested bitrate. On pass 1, you may just deactivate audio and set output to null, examples for Windows and Unix:
ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
# File lib/ffmpeg/video_options.rb, line 182 182: def video_pass(index) 183: FFMpegCommand << "-pass #{index}" 184: end
Set two-pass log file name prefix to prefix, the default file name prefix is "ffmpeg2pass". The complete file name will be `PREFIX-N.log’, where N is a number specific to the output stream.
# File lib/ffmpeg/video_options.rb, line 188 188: def video_pass_logfile(prefix) 189: FFMpegCommand << "-passlogfile #{prefix}" 190: end