Closed t-chab closed 6 months ago
Creating /tmp/vhs-882877197...
I think the attempt to use these constants for .gif
, .mp4
and .webm
here conflicts with the variable declaration here, so the tempfile value never actually gets the .gif
extension.
As such, ffmpeg cannot infer the output type from the filename and would need the additional -f gif
option passed to it (which serve
does not give the option to do).
If the tmpfile manipulation in this switch is changed to use the string literals ".gif"
, ".mp4"
and/or ".webm"
, then these would be included in the tempfile, and ffmpeg would infer the output type without needing the additional -f gif
argument.
(Just a drive-by analysis, I don't know enough about the project to PR...)
@jimbobmcgee : thanks a lot for the explanation. I tried to submit a PR, let's see what happens.
Great catch @jimbobmcgee and thank you for the PR @t-chab, I will merge.
The Docker container is still broken since a new image hasn't been cut since this PR was merged.
@nwithan8 : you can build an image from main branch as a workaround (this Dockerfile is a quick hack over the official one) :
FROM tsl0922/ttyd:alpine as ttyd
FROM alpine:latest as fontcollector
# Install Fonts
RUN apk add --no-cache \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
font-adobe-source-code-pro font-source-code-pro-nerd \
font-dejavu font-dejavu-sans-mono-nerd \
font-fira-code font-fira-code-nerd \
font-hack font-hack-nerd \
font-ibm-plex-mono-nerd \
font-inconsolata font-inconsolata-nerd \
font-jetbrains-mono font-jetbrains-mono-nerd \
font-liberation font-liberation-mono-nerd \
font-noto \
font-roboto-mono \
font-ubuntu font-ubuntu-mono-nerd \
font-noto-emoji
FROM golang:1.22.2 as builder
RUN git clone https://github.com/charmbracelet/vhs \
&& cd vhs \
&& go build -o /tmp/vhs .
FROM debian:stable-slim
RUN apt-get update
# Add fonts
COPY --from=fontcollector /usr/share/fonts/ /usr/share/fonts
# Install latest ttyd
COPY --from=ttyd /usr/bin/ttyd /usr/bin/ttyd
# Expose port
EXPOSE 1976
# Create volume
VOLUME /vhs
WORKDIR /vhs
# Install Dependencies
RUN apt-get -y install ffmpeg chromium bash
# Create user
RUN useradd -u 1976 -U -s /bin/false vhs
# Mimic alpine default color option
RUN echo 'alias ls="ls --color"' >> ~/.bashrc
# Install
COPY --from=builder /tmp/vhs /usr/bin/
ENV VHS_PORT "1976"
ENV VHS_HOST "0.0.0.0"
ENV VHS_GID "1976"
ENV VHS_UID "1976"
ENV VHS_KEY_PATH "/vhs/vhs"
ENV VHS_AUTHORIZED_KEYS_PATH ""
ENV VHS_NO_SANDBOX "true"
ENTRYPOINT ["/usr/bin/vhs"]
@t-chab No dice, need an prebuilt image, can't build it manually. Trying to set up an Unraid app template.
@nwithan8 : Meanwhile you can fork this repo, and replace the Dockerfile with the one in previous comment. Then set up a Github Action, and you'll have a working image available on a public docker registry.
Eh, I'd rather not have to maintain a fork of this project. Just wanted to make the maintainers aware that this patch (and I'm sure others) hasn't made its way into production yet because a new release hasn't been cut in a while.
Hey @t-chab @nwithan8! Thanks for the comments, just cut a new release of VHS with all the bug fixes.
@maaslalani Thanks for putting out the new release. As a result, I was able to build an app template so Unraid users can easily run a VHS server on their Unraid machines: https://unraid.net/community/apps?q=vhs#r
When I try to use vhs "serve" mode from the docker container, it fails with an ffmpeg error :
Setup
To Reproduce Steps to reproduce the behavior:
Expected behavior
I was expecting to get a usable /tmp/demo.gif file instead of an empty file (because ffmpeg command failed as explained)