当前位置:网站首页>Optimization of MP4 file missing seconds caused by TS files when downloading videos from easydss video platform
Optimization of MP4 file missing seconds caused by TS files when downloading videos from easydss video platform
2022-06-24 12:43:00 【Tsingsee green rhino video】
EasyDSS The video platform supports video downloading , A copy of the downloaded video file will be kept ts file , At the same time mp4 The format of is saved in the video folder . Under some custom projects ,EasyDSS After downloading the video of MP4 File missing seconds . Although we have dealt with similar problems before , But the reasons for this problem are different .
The problem is actually related to the video file ts Related documents , When the system downloads mp4 When you file , The backend first queries the corresponding ts file , And because the EasyDSS The query for is not complete , Only then causes the user to download MP4 The file is incomplete .
To solve such problems , We change the logic of the system to synthesize according to the downloaded parameters m3u8 file , Use it again m3u8 File transfer mp4 file , The reference codes are as follows :
// Generate m3u8
//m3u8TS, err := r.getRecordM3U8File(id, start, end, videoID, true)
_,fileRealPath_m3u8, err:=service.GeneterateRecordM3u8(id,starttime, endtime,true)
if err != nil {
AbortWithString(c, http.StatusBadRequest, " Generate M3U8 error ")
return
}
//m3u8 turn MP4
//mp4_name := id+"_"+starttime+"_"+starttime+".mp4"
filePath_mp4 := trans.M3U8ToMP4_TimeName(fileRealPath_m3u8,mp4Path)
if filePath_mp4 == "" {
AbortWithString(c, http.StatusBadRequest, "M3U8 turn MP4 Failure ")
return
}
r.operFile(c, operate, filePath_mp4, videoID)
efile.RemoveFile(fileRealPath_m3u8)The composite will be deleted finally m3u8 file ,mp4 Regular file cleaning , The code to free unnecessary disk space is as follows :
After the solution, the complete can be downloaded successfully mp4 file :
边栏推荐
- Data stack technology sharing: open source · data stack - extend flinksql to realize the join of flow and dimension tables
- Smart Policing: how to use video intelligent analysis technology to help urban policing visual comprehensive supervision and command system
- 【概率论期末抱佛脚】概念+公式(不含参数估计)
- JVM GC garbage collection detailed introduction quick check of learning notes
- Continuous testing | key to efficient testing in Devops Era
- Argo 全家桶如何让 DevOps 变的更容易?
- On the value foam of digital copyright works from the controversial nature of "Meng Hua Lu"
- Automatic reconstruction of pod after modifying resource object
- Can Tencent's tendis take the place of redis?
- [2021 techo youth dry goods sorting post, there is always one you are interested in]
猜你喜欢

Opencv learning notes - Discrete Fourier transform

Dingding, Feishu, and enterprise wechat: different business approaches
[mysql_16] variables, process control and cursors

Opencv learning notes - regions of interest (ROI) and image blending

Reading notes of returning to hometown

【2022国赛模拟】摆(bigben)——行列式、杜教筛

MySQL 外键影响

一纸英雄帖,激起千层浪,横跨10国,一线大厂都派人来了!-GWEI 2022-新加坡

解析nc格式文件,GRB格式文件的依赖包edu.ucar.netcdfAll的api 学习

一文讲透植物内生菌研究怎么做 | 微生物专题
随机推荐
A "full cloud" journey of a quasi financial system
Remote terminal RTU slope monitoring and early warning
Use go to process millions of requests per minute
How to open a new bond? Is it safe to open an account
[log service CLS] Tencent cloud log service CLS accesses CDN
Coinbase will launch the first encrypted derivative product for retail traders
[5 minutes to play lighthouse] create an immersive markdown writing environment
In depth analysis, from ordinary clock system to various time service modes
Reset the password, and the automatic login of the website saved by chrome Google browser is lost. What is the underlying reason?
Installation and operation of libuv
Automatic reconstruction of pod after modifying resource object
11+ article - machine learning builds Protics framework - deeply reveals the impact of tumor infiltrating immune cells in different molecular subtypes on prognosis
Kubernetes practical technique: setting kernel parameters for pod
MySQL 外键影响
[cloud based co creation] interpretation of harmonyos application and service ecology
使用开源工具 k8tz 优雅设置 Kubernetes Pod 时区
2021-06-02: given the head node of a search binary tree, it will be transformed into an ordered two-way linked list with head and tail connected.
Data stack technology sharing: open source · data stack - extend flinksql to realize the join of flow and dimension tables
炒伦敦金短线稳定赚钱技巧?在哪里炒伦敦金安全靠谱?
SMS SMS