https://github.com/cwithmichael/ts-video-encoder
Simple video encoder
https://github.com/cwithmichael/ts-video-encoder
typescript video video-processing
Last synced: 12 months ago
JSON representation
Simple video encoder
- Host: GitHub
- URL: https://github.com/cwithmichael/ts-video-encoder
- Owner: cwithmichael
- Created: 2024-05-04T15:51:26.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-04T20:26:46.000Z (about 2 years ago)
- Last Synced: 2025-02-22T13:43:16.236Z (over 1 year ago)
- Topics: typescript, video, video-processing
- Language: TypeScript
- Homepage:
- Size: 28.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## TypeScript-Video-Encoder
This is a rewrite of the Codec From Scratch repo originally done in Go.
All credit goes to Github user kevmo314 for the logic.
Please see the [original repo](https://github.com/kevmo314/codec-from-scratch) for more detailed information.
To run this locally:
`npm install`
`cat video.rgb24 | npm run start`
Example run:
```
➜ ts-video-encodder git:(main) cat video.rgb24 | npm run start
> ts-video-encodder@0.0.1 start
> npx tsc && node dist/index.js
Raw size: 53996544 bytes
YUV420p size: 26998272 bytes (50% original size)
Wrote encoded.yuv
RLE size: 13592946 bytes (25.17% original size)
Deflated size: 5743033 bytes (10.64% original size)
Wrote decoded.yuv
Wrote decoded.rgb24
➜ ts-video-encodder git:(main)
```
To play the decoded file:
`ffplay -f rawvideo -pixel_format rgb24 -video_size 384x216 -framerate 25 decoded.rgb24`
You can do the same for the YUV files if you'd like:
`ffplay -f rawvideo -pixel_format rgb24 -video_size 384x216 -framerate 25 decoded.yuv`