# convert-video

> A lightweight video conversion tool to convert mp4, avi and mov file.

Latest version **1.0.0** (published 2021-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install convert-video
pnpm add convert-video
yarn add convert-video
bun add convert-video
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-04-27 |
| First published | 2021-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Suvro |
| Maintainers | sdn101 |
| Keywords | video, converter, mp4, avi, mov, mp4 to avi, mp4 to mov, avi to mp4, avi to mov, mov to mp4, mov to avi, conversion, convert |

## Links

- npm: https://www.npmjs.com/package/convert-video
- Repository: https://github.com/suvro404/convert-video
- Homepage: https://github.com/suvro404/convert-video#readme
- Issues: https://github.com/suvro404/convert-video/issues
- npm.io page: https://npm.io/package/convert-video

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-04-27

## README

## convert-video
##### A lightweight video conversion tool to convert mp4, avi and mov file.

### [DEMO](https://suvro404.github.io/convert-video-playground/)

#### Install
```
npm install convert-video
```

### Usage
```
import VideoConverter from 'convert-video'

VideoConverter.convert(sourceVideoFile, targetVideoFormat);
```

### Example Code
```
<input type='file' accept=".mp4, .avi, .mov" onchange="convertVideo(this)" />

import VideoConverter from 'convert-video'

async function convertVideo(input) {
    let sourceVideoFile = input.files[0];
    let targetVideoFormat = 'avi'
    let convertedVideoDataObj = await VideoConverter.convert(sourceVideoFile, targetVideoFormat);
}
```
##### This convert function will return a converted video data object which includes video file's name, format and blob URL.
##### This blob URL can be used to download the converted video.

```
function downloadVideo(convertedVideoDataObj) {
    let a = document.createElement("a");
    a.href = convertedVideoDataObj.data;
    a.download = convertedVideoDataObj.name + "." + convertedVideoDataObj.format;
    a.click();
}
```


### License
MIT

---
_Source: https://npm.io/package/convert-video · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
