Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mmis1000/nodejs-video-frame-extractor
extract frame as rbg from output of ffmpeg
https://github.com/mmis1000/nodejs-video-frame-extractor
Last synced: about 2 months ago
JSON representation
extract frame as rbg from output of ffmpeg
- Host: GitHub
- URL: https://github.com/mmis1000/nodejs-video-frame-extractor
- Owner: mmis1000
- Created: 2015-06-05T13:50:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-27T04:42:37.000Z (about 6 years ago)
- Last Synced: 2024-04-14T22:53:54.161Z (9 months ago)
- Language: CoffeeScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
###Nodejs Video Frame extractor
split rgb24 stream into frames
------
usage:
class Extractor
constructor: new Extractor stream, width, height
stream : any stream, file stream is also ok
width : width of video
height : height of video
event:
frame (Image)
emit when every frame finished
# since raw rgb24 stream doesn't have header,
# it is impossiple to detect the real size of video automatically
class Image
constructor: rgbBuffer, width, height
constructor: width, height
methods:
getPixel: (x, y)
setPixel: (x, y, color)
addPixel: (x, y, color)
propertys:
buffer: buffer contains pixel data
width : width of image
height: height of image
length: length of internal buffer
# the color is a array contains r, g ,b value
------
generate test.rgb `by ffmpeg` for test
`cat [yourvideo] | ffmpeg -i - -vcodec rawvideo -qp:v 0 -pix_fmt rgb24 -r "2" -vf scale=320:240 -f rawvideo pipe:1 > test.rgb`
run test by `coffee test.coffee`