1.1.5 • Published 4 years ago

img2vid v1.1.5

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

img2vid npm version

Generate videos or gifs from images. Includes captions, audio, transitions, zoompan and a watermark image.

Requires

ffmpeg with --enable-libass

Install

npm install img2vid

Example Usage

var img2vid = require('img2vid')
var payload = {
  slides: [
    {
      path: 'examples/exampleData/squirrel.jpg',
      duration: 2
    },
    {
      path: 'examples/exampleData/cassettes.jpg',
      duration: 2
    },
    {
      path: 'examples/exampleData/mouse.jpg',
      duration: 2
    }
  ],
  captions: [
    {
      text: 'Img2Vid',
      start: 0,
      end: 6
    }
  ],
  width: 640,
  height: 419,
  output: 'examples/outputs/simple.webp',
  assOutput: 'examples/outputs/simple.ass',
  forceScale: true
}
img2vid.render(payload)

Options

keyrequireddefaulttypedescription
slidesYObjectSee Slide Options
captionsNObjectSee Caption Options
widthY640NumberPixels
heightY480NumberPixels
outputYoutput.mp4Stringfilepath.mp4/gif/webp
assOutputY iff using captionssubs.assStringASS File Output - filepath.ass
audioNStringPath to audio file
genpaletteNfalseBooleanGenerate color palette for Gifs/Webp outputs
forceScaleNfalseBooleanUse if input images are different sizes
durationNNumberOutput Duration
gifLoopNtrueBooleanContinually loop Gifs/Webp outputs
hardSubNtrueBooleanRender captions over output
verboseNtrueBooleanShow Logs
watermarkNObjectSee Watermark Options

Slide Options

keyrequireddefaulttypedescription
pathYStringimage filepath
durationY2NumberSeconds
transitionNObjectSee Transition Options
zoomPanNObjectSee ZoomPan Options

Transition Options

keyrequireddefaulttypedescription
typeYStringSee Available Transitions
durationY1NumberSeconds to transition

ZoomPan Options

keyrequireddefaulttypedescription
startTimeN0NumberSeconds from start of slide
endTimeYNumberSeconds to finish ZP
zoomStartN1NumberScale Factor to Start
zoomEndY1NumberScale Factor to End
xStartN0NumberStart X Position
yStartN0NumberStart Y Position
xEndY0NumberEnd X Position
yEndY0NumberEnd Y Position
jitterScaleN2Number|FalseTemp scale image up to reduce jitter

Caption Options

keyrequireddefaulttypedescription
textYStringimage filepath
startY0NumberSeconds in total output
endY0NumberSeconds in total output
styleNObjectSee Style Options

Caption Style Options

keyaliasdefaulttypedescription
fontNamefnArialStringx,y position in pixels
fontSizefs28Number
borderSizebord2Number
color#FFFFFFStringMust be 6 char hex color
borderColor#000000StringMust be 6 char hex color
fadefadNumber,NumberfadeIn,fadeOut in ms
positionposNumber,Numberx,y in pixels
lineAlignmentantop leftStringtop,middle,bottom left,center,right
scaleXfscx100Numberas a percentage
scaleYfscy100Numberas a percentage
animatetStringSee animate string syntax
moveNumber4startX,startY,endX,endY
shadowshadNumberdepth of shadow
shadowColorStringMust be 6 char hex color
shadowAlphaStringMust be 2 char hex alpha color
boldb1Number1 or 0
italicsi0Number1 or 0
underlineu0Number1 or 0
strikeouts0Number1 or 0

Watermark Options

keyrequireddefaulttypedescription
pathY0StringPath to watermark image
heightN100NumberPixels (-1 to keep aspect ratio)
widthN-1NumberPixels (-1 to keep aspect ratio)
xN10NumberPixels
yN10NumberPixels
alphaN1NumberOpacity of image (Between 0 and 1)

Available Slide Transitions

View transitions types and demos available from FFMPEG xfade filter.

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.5.0

4 years ago

0.4.8

4 years ago

0.4.7

4 years ago

0.4.6

4 years ago

0.4.5

4 years ago

0.4.4

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.2.18

4 years ago

0.3.0

4 years ago

0.2.17

4 years ago

0.2.16

4 years ago

0.2.15

4 years ago

0.2.14

4 years ago

0.2.13

4 years ago

0.2.12

4 years ago

0.2.11

4 years ago

0.2.10

4 years ago

0.2.7

4 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.18

4 years ago

0.1.17

4 years ago

0.1.12

4 years ago

0.1.13

4 years ago

0.1.14

4 years ago

0.1.15

4 years ago

0.1.16

4 years ago

0.1.10

4 years ago

0.1.11

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago