Skip to content

feat: 新增字幕功能,修复ffmpeg参数,VID字段与user邮箱与手机号不再对公共api进行返回! - #173

Open
aimiliyaai wants to merge 27 commits into
wangzmgit:serverfrom
aimiliyaai:server
Open

aimiliyaai wants to merge 27 commits into
wangzmgit:serverfrom
aimiliyaai:server

Conversation

@aimiliyaai

Copy link
Copy Markdown
Contributor

01:新增字幕功能,支持vtt与srt!
02:修复一个ffmpeg已在新版丢弃的参数!
03:api调整,公共视频api隐藏内部自增vid字段与公共user的api不返回个人邮箱与手机号,因为发现可以通过脚本批量抓取,且没任何保护!
04:user认证api已有雏形,暂时没启用,用于类似大平台的身份认证,如机构或知名等!
05:PGC系统已有雏形,但没正式使用,属于测试阶段,前端已包含PGC简易项目,暂不支持打包!

aimiliyaai and others added 27 commits April 11, 2026 13:00
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…action safety

- Replace file-polling audio wait with channel-based signaling (audioDone)
- Handle getMP4InitRange errors instead of silently ignoring them
- Add FOR UPDATE lock in completeTransCoding to prevent race condition
- Check video/resource existence before updating status
- Detect OSS total upload failure (uploadCount == 0)
- Reduce GPU concurrency from 3 to 2 for memory safety
- Add unit tests for 9 pure transcoding functions (46 test cases)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add max_cpu_concurrency / max_gpu_concurrency to transcoding config.
Defaults to hardcoded constants (2) when not set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add admin endpoints: getManageList, adminUpdateStatus, adminDelete
- Filter pgc_attached content from UGC video management lists
- Auto-register ContentPGC menu under content management (sort after video)
- Fix MenuListToMenuTree to sort children by sort field
- Add API docs, Casbin rules, and sync data for new endpoints

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 新增 ParseResourceID() 支持 shortId 或数字字符串解析资源
- GetVideoFile / GetResourceQuality 接受 resourceShortId 参数
- PlaylistVideoResp 添加 ShortID 字段,SQL 查询补充 video.short_id
- GetPlaylistVideoListWithParts 响应补充 shortId / resourceShortId 字段

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
convertToInt("") 返回 error 导致不传 pgc_type 时直接 500。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 新增 CommentDislike 模型与迁移
- comment service 增加点踩/取消点踩与状态查询
- 视频/文章评论 API 与路由适配点踩
- data.go 初始化数据调整

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- online 服务 groupVideoRid 由 string(rune) 改为 strconv.FormatUint,修复大 id 和代理对退化为 U+FFFD 的分组碰撞
- GetVideoOnlineConnect 透传 rid,建立 vid+rid 复合分组
- danmaku 服务按分组 ws 广播,同时对发送者回推,支持前端单条插入

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 将顶层函数与 package-level 状态收进 TranscodeService 结构体
- 合并 encodeVideoOnly / encodeVideoOnlyGPU 为单个 runVideoEncodeTask,消除大段重复
- 新增 StorageUploader 接口,留出依赖注入口便于单测
- SharedTask 抽为通用 once+wait 模式,音频编码只跑一次多处等待
- OSS 上传重试改为 ctx 感知的 select/time.After,进程关停不阻塞
- FFmpeg 单实例线程数按并发数等分并夹在 [1, 8],避免 CPU 上下文切换风暴
旧流程对未软删的 resource 走 GORM 软删,会保留 deleted_at 非空的行;
但 resource.short_id 上有 UNIQUE 索引且不含 deleted_at 判定,新资源复用
同一 ShortID Create 时必报 Error 1062 Duplicate entry。

改为统一硬删:用户侧数据(弹幕/历史/收藏/点赞)均通过 short_id 或 vid
关联,新资源复用 ShortID 即可续上绑定;按 resource.id 关联的
video_index_file / video_file_ref 本就由转码重建。软删除在此场景没有业务价值。
- pkg/redis 新增 SetNX 原子封装,消除 Get+Set 的 TOCTOU 竞态
- internal/cache/share.go 按 (userId, vid/aid) 申请占位
- ShareVideo / ShareArticle 计数前先原子占位,命中冷却静默跳过
  (返回 nil 不向前端暴露,攻击者脚本无法通过错误码探测限流边界)

防脚本/外挂对同一稿件反复刷 shares 计数。
…重的 rc-lookahead/AQ 参数\n- bf: 3->2 减少延迟\n\nCPU:\n- 添加 refs:6 B帧参考帧\n- 添加 me_method:hex 运动搜索\n- 添加 subq:9 子像素搜索
- -fps_mode cfr;视频 setpts、音频 asetpts/adelay 与输出 -t 一致

- CPU/GPU 编码合并、线程上限与 NVENC strict_gop

- 补充 ffmpegOutputDurationArgs 等单测
…o shortId, hide internal IDs in JSON, fill shortId fallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant