lvs2

command module
v0.0.0-...-7ddfcc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 1 Imported by: 0

README

lvs2

lvs2Local Video Servicev2版本,用于本地mp4文件的托管

前提

  1. mp4文件视频编码格式为h264,音频编解格式为aac
  2. 对于非mp4文件或编码格式不满足上述要求的情况,可以使用ffmpeg工具转换

特性

  1. 扫描用户指定目录下的mp4文件,生成sqlite3数据库档案(文件名、路径、大小、播放时长、缩略图)
  2. 基于gin提供播放服务,通过解析请求头中的Range属性实现分段下载播放

构建

git clone https://github.com/beekeeper1010/lvs2.git
cd lvs2
go build -ldflags="-s -w"

使用

  • 扫描mp4文件

    # 扫描目录1和目录2中的mp4文件,过滤掉小于60秒的视频,指定缩略图高度为100px,生成lvs2.db数据库档案
    lvs2 scan --dir=目录1 --dir=目录2 --filter=60 --height=100 --db=lvs2.db
    
  • 运行服务

    # 基于lvs2.db数据库档案启动视频服务,监听8080端口,并将日志输出到lvs2.log文件中
    lvs2 run --addr=:8080 --db=lvs2.db --log=lvs2.log
    
  • 自动补全

    # 以powershell为例,使用lvs2命令自动补全
    lvs2 completion powershell | Out-String | Invoke-Expression
    
  • 通过lvs2 -hlvs2 help command来查看完整的帮助信息

    lvs2 is a Local Video Service
    
    Usage:
    lvs2 [command]
    
    Available Commands:
    completion  Generate the autocompletion script for the specified shell
    help        Help about any command
    run         Run server
    scan        Scan mp4 files to generate sqlite db file
    
    Flags:
    -h, --help      help for lvs2
    -v, --version   version for lvs2
    
    Use "lvs2 [command] --help" for more information about a command.
    

组件依赖

组件 必选 说明
ffmpeg Y 用于获取播放时长、生成缩略图,测试版本4.4.x
nssm N 用于安装Windows服务,测试版本2.24
upx N 用于二进制瘦身,测试版本4.2.2

TODO

后端
  • 鉴权
  • IO性能优化
  • 弹幕
  • 其他
前端
  • 用户管理
  • 播放页面,卡片中展示缩略图、文件名等
  • 搜索
  • 适配移动设备

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL