npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mmstudio/an000044

v1.4.0

Published

保存视频文件到文件服务

Downloads

5

Readme

保存视频文件到文件服务

将视频文件保存进数据库,对象数据库采用minio

注意事项

  1. 上传视频过程会对视频文件进行采样截图,将截图信息作为文件的返回信息并返回给调用者(key='file.meta.screenshot'),该信息为截图文件的id。
  2. 如果视频文件编码不是h264,则将其转换为h264文件
  3. 有些视频文件如部分(flv)不是mp4格式,但其编码方式为h264,同样可以在浏览器中播放
  4. 视频文件的转换比较耗时,鼓励用户直接上传mp4格式文件,不建议在服务器上进行大量转换操作,因其消耗大量cpu资源,将会严重拖慢服务器运行效率。
  5. 同样因为转换比较耗时,非mp4格式的文件(确切地讲,视频编码格式非h264的文件)在处理时不作等待即返回给客户端,但该文件仅当转换结束后方可访问。之前不能被访问到,并非上传失败,需谨记此,诱导用户操作时需说明,不要让用户作大量重复上传,同样会拖慢服务器运行效率。

返回格式

{
	id: string;
	contentType: string;
	meta: {
		screenshot: string;
		video:{}
		audio:{}
	},
	md5: string;
	name: string;
}

配置文件

mm.json

{
	"minio": {
		"endPoint": "127.0.0.1",
		"port": 9000,
		"accessKey": "mmstudio",
		"secretKey": "Mmstudio123",
		"useSSL": false,
		"region": "cn-north-1",
		"partSize": 5242880
	}
}

docker

version: '3.7'

services:
  minio:
    image: minio/minio
    container_name: minio
    command: server /data
    volumes:
      - /home/taoqf/data/minio:/data
    ports:
      - 9000:9000
    environment:
      MINIO_ACCESS_KEY: mmstudio
      MINIO_SECRET_KEY: Mmstudio123