V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
qq1340691923
V2EX  ›  Go 编程语言

如何用 golang 检测音频文件损坏,求思路

  •  
  •   qq1340691923 · 2019-11-04 09:42:59 +08:00 · 3300 次点击
    这是一个创建于 1606 天前的主题,其中的信息可能已经有所发展或是发生改变。

    正给我朋友做一个帮他检测音频文件有无损坏的工具

    4 条回复    2019-11-04 11:28:40 +08:00
    thomaspaine
        1
    thomaspaine  
       2019-11-04 10:35:08 +08:00
    检测机制和语言无关吧,语言只不过是实现机制的工具
    qq1340691923
        2
    qq1340691923  
    OP
       2019-11-04 10:52:26 +08:00
    @thomaspaine 求思路,检测头文件可以吗
    keepeye
        3
    keepeye  
       2019-11-04 11:00:03 +08:00
    调 ffmpeg 检测吧,go 的话想获取视频长度都麻烦
    delectate
        4
    delectate  
       2019-11-04 11:28:40 +08:00   ❤️ 1
    简单来说,是不要重造轮子,用 go 去调用 ffmpeg,方法:
    ffmpeg -v error -i file.avi -f null - 2>error.log

    How can I check the integrity of a video file (avi, mpeg, mp4…)?
    https://superuser.com/questions/100288/how-can-i-check-the-integrity-of-a-video-file-avi-mpeg-mp4
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1136 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 978ms · UTC 22:58 · PVG 06:58 · LAX 15:58 · JFK 18:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.