
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
core-video-to-gif
Advanced tools
A JavaScript Library To Convert Video Fragments To Gif.
$ npm install core-video-to-gif --save
<script src="./dist/core-video-to-gif.min.js"></script>
const v2g = new CoreVideoToGif({
// specify the video element
el: document.querySelector('video')
})
v2g.shot({
// options,
start: 5, // ms
end: 8
}, (result) => {
// ...
image.src = result
})
| key | Type | Details | Value |
|---|---|---|---|
| * el | Element | The video element | <video ... > |
| workerScript | String | enable Web Worker | Please inclued the [script](https://github.com/JackPu/core-video-to-gif/blob/master/examples/gif.worker.js), and specify the path |
| width | Number | The output git width | 600(default: the video original height) |
| height | Number | The output gif image height | 600(default: the video original height) |
| maxTime | Number | limit the time of gif animation | 5(default: 10) |
| fps | Number | the frame per second | 12(default: 6) |
| quality | Number | the quality of gif | (1-10) The best is 10 |
| onStartShot | Function | call when start shoting | |
| onGifProcess | Function | call when making gif | |
| onGifFinished | Function | call when gif output |
“*” means it is required.
You could use the method to get the video screenshots.
// get current screenshot
v2g.shot( (result) => {
// ...
image.src = result
})
// get screenshot from 5s - 8s
v2g.shot({
// options,
start: 5, // ms
end: 8
}, (result) => {
// ...
image.src = result
})
| key | Type | Details | Value |
|---|---|---|---|
| start | Number | the screenshot start time | 6(s) |
| end | Number | the screenshot end time | 7(s) |
The api is still in draft. Not work!!!
Your contributions and suggestions are welcome 😄😄😄
FAQs
a JavaScript library to convert video to gif
We found that core-video-to-gif demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.