Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: docker内ffprobe段错误 #864

Closed
4 of 7 tasks
leon0625 opened this issue Jan 23, 2025 · 22 comments
Closed
4 of 7 tasks

[Bug]: docker内ffprobe段错误 #864

leon0625 opened this issue Jan 23, 2025 · 22 comments
Labels
enhancement New feature or request

Comments

@leon0625
Copy link

Don't skip these steps | 不要跳过这些步骤

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field | 我明白,如果我“故意”删除或跳过任何强制性的*字段,我将被限制
  • I am sure that this is a running error exception problem and will not submit any problems unrelated to this project | 我确定这是运行报错异常问题,不会提交任何与本项目无关的问题
  • I have searched and double-checked that there are no similar issues that have been created | 我已经通过搜索并仔细检查过没有存在已经创建的类似问题

Occurrence environment | 触发环境

  • Workflow | 工作流
  • GUI | 软件
  • Docker
  • Command line | 命令行

Bug description | 具体描述

docker内的ffprobe获取一些url的分辨率时存在段错误。

ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of json http://z.b.bkpcp.top/m.php?id=cctv1
{
Segmentation fault (core dumped)

在容器内使用apt install ffmpeg重新安装ffmpeg,则没有段错误,获取分辨率正常

ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of json http://z.b.bkpcp.top/m.php?id=cctv1
{
    "programs": [
        {
            "streams": [
                {
                    "width": 1920,
                    "height": 1080
                }
            ]
        }
    ],
    "streams": [
        {
            "width": 1920,
            "height": 1080
        }
    ]
}

Error log | 报错日志

No response

@leon0625 leon0625 added the bug Something isn't working label Jan 23, 2025
@go626201
Copy link

#859 我昨晚发过一个issue,确实存在这个问题。当前的docker版本 针对有域名的ffprobe结果 都不正常。

@Guovin
Copy link
Owner

Guovin commented Jan 23, 2025

这是ffmpeg的问题,有可能是由于构建的版本较低导致,我可以尝试升级。
@go626201 关于你另一个issue说的情况,由于你关闭了issue,是否需要额外安装别的依赖还有待验证,应该是部分url会出现该情况,并不是所有都会。

@Guovin Guovin added enhancement New feature or request and removed bug Something isn't working labels Jan 23, 2025
@wongsyrone
Copy link
Contributor

目前Dockerfile里面使用的静态ffmpeg是来自静态glibc的,glibc天生不适合静态编译。如果考虑静态编译建议使用基于musl-libc的alpine,同时能一定程度解决静态glibc导致dns问题。找到一个现成的镜像,可以从这个镜像里面copy出来需要的ffmpeg和ffprobe。

参考: https://github.com/wader/static-ffmpeg

@Guovin
Copy link
Owner

Guovin commented Feb 5, 2025

目前Dockerfile里面使用的静态ffmpeg是来自静态glibc的,glibc天生不适合静态编译。如果考虑静态编译建议使用基于musl-libc的alpine,同时能一定程度解决静态glibc导致dns问题。找到一个现成的镜像,可以从这个镜像里面copy出来需要的ffmpeg和ffprobe。

参考: https://github.com/wader/static-ffmpeg

收到,感谢你的建议

Guovin added a commit that referenced this issue Feb 5, 2025
@Guovin
Copy link
Owner

Guovin commented Feb 5, 2025

目前Dockerfile里面使用的静态ffmpeg是来自静态glibc的,glibc天生不适合静态编译。如果考虑静态编译建议使用基于musl-libc的alpine,同时能一定程度解决静态glibc导致dns问题。找到一个现成的镜像,可以从这个镜像里面copy出来需要的ffmpeg和ffprobe。

参考: https://github.com/wader/static-ffmpeg

可惜并不支持linux/arm/v7

@wongsyrone
Copy link
Contributor

如果是为了多架构支持,建议直接全部切换到alpine linux的docker base image上,ffmpeg 直接通过包管理器 APK 安装

@wongsyrone
Copy link
Contributor

官方 docker base image 支持架构:Supported architectures: (more info⁠)
amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
最新稳定版ffmpeg版本
https://pkgs.alpinelinux.org/packages?name=ffmpeg&branch=v3.21&repo=&arch=x86_64&origin=&flagged=&maintainer=

Guovin added a commit that referenced this issue Feb 5, 2025
@wongsyrone
Copy link
Contributor

cron的处理不太一样,There are many cron implementations, but Alpine Linux comes inbuilt with the BusyBox version of cron. Some of the other packages available in Alpine Linux are cronie, fcron, dcron.

https://wiki.alpinelinux.org/wiki/Cron

@Guovin
Copy link
Owner

Guovin commented Feb 5, 2025

cron的处理不太一样,There are many cron implementations, but Alpine Linux comes inbuilt with the BusyBox version of cron. Some of the other packages available in Alpine Linux are cronie, fcron, dcron.

https://wiki.alpinelinux.org/wiki/Cron

嗯,是的,apline应该使用dcron

@wongsyrone
Copy link
Contributor

如果用系统原生cron,找到个例子:https://github.com/keckelt/cron-alpine/blob/master/Dockerfile

可能需要定制一下entrypoint.sh

@Guovin
Copy link
Owner

Guovin commented Feb 5, 2025

如果用系统原生cron,找到个例子:https://github.com/keckelt/cron-alpine/blob/master/Dockerfile

可能需要定制一下entrypoint.sh

应该不影响,dcron和cron的执行命令应该是一样的

@wongsyrone
Copy link
Contributor

wongsyrone commented Feb 5, 2025

上一个builder里面的错误看起来是编译Pillow时候缺少zlib依赖,apk add zlib-dev应该就可以了。

现在builder里面用的是ubuntu的,但是运行镜像却是alpine,估计pillow会报错

@Guovin
Copy link
Owner

Guovin commented Feb 5, 2025

上一个builder里面的错误看起来是编译Pillow时候缺少zlib依赖,apk add zlib-dev应该就可以了。

现在builder里面用的是ubuntu的,但是运行镜像却是alpine,估计pillow会报错

我以为是因为alpine缺少了太多依赖导致,干脆用最全的作为builder了,就怕不止缺少了zlib,还要逐个排查安装

@wongsyrone
Copy link
Contributor

还有个 jpeg-dev

@Guovin
Copy link
Owner

Guovin commented Feb 5, 2025

还有个 jpeg-dev

哈哈,我觉得还会有

@wongsyrone
Copy link
Contributor

编译终于过了

@Guovin
Copy link
Owner

Guovin commented Feb 5, 2025

镜像已构建完成并推送,欢迎拉取试用(使用官方镜像命令,代理会有缓存)

@go626201
Copy link

go626201 commented Feb 5, 2025

刚拉取最新镜像,完全全新建立的 也运行出现
/bin/sh: /iptv-api-entrypoint.sh: not found
应该是docker镜像复制有误。

@YoungAir
Copy link

YoungAir commented Feb 5, 2025

刚拉取最新镜像,完全全新建立的 也运行出现 /bin/sh: /iptv-api-entrypoint.sh: not found 应该是docker镜像复制有误。

我这会儿拉取也是同样的问题,你解决了嘛

Guovin added a commit that referenced this issue Feb 5, 2025
@Guovin
Copy link
Owner

Guovin commented Feb 5, 2025

刚拉取最新镜像,完全全新建立的 也运行出现
/bin/sh: /iptv-api-entrypoint.sh: not found
应该是docker镜像复制有误。

已处理,待镜像构建完成后重新拉取

@wongsyrone
Copy link
Contributor

最新镜像提示 /iptv-api-entrypoint.sh: line 17: service: not found

一些参考

gliderlabs/docker-alpine#437 (comment)
gliderlabs/docker-alpine#437 (comment)

@go626201
Copy link

go626201 commented Feb 5, 2025

刚拉取最新镜像,完全全新建立的 也运行出现
/bin/sh: /iptv-api-entrypoint.sh: not found
应该是docker镜像复制有误。

已处理,待镜像构建完成后重新拉取

正常启动了。谢谢。 现在在进行第一次重跑 看看情况如何。

@Guovin Guovin closed this as completed Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants