inovector / mixpost

Mixpost - Self-hosted social media management software (Buffer alternative)
https://mixpost.app
MIT License
899 stars 143 forks source link

Error uploading mp4 media #63

Closed 81reap closed 5 months ago

81reap commented 7 months ago

Steps to reproduce the problem

  1. Run docker compose
  2. Create new post
  3. Try to upload a mp4 file
  4. fail

Expected behaviour

.mp4 file should upload

Actual behaviour

it failed

Detailed description

Images seem to upload fine but videos [EXAMPLE] fail. I see no logs for mixpost nor from cloudflared that would indicate that the network failed.

Specifications

[reap@apollo docker]$ cat mixpost.yml 
version: '3.1'

services:
    # admin@example.com // changeme
    mixpost:
        image: inovector/mixpost:latest
        environment:
            APP_NAME: 'Mixpost'
            APP_KEY: base64:Yt7UPpH71ABdT31NAGjPZkqOGbmjgGekbLR8HRIBZ7k=
              # Generate a base64 secret with this tool: https://mixpost.app/encryption-key-generator
            APP_URL: https://example.com
            DB_DATABASE: 'example_db_name'
            DB_USERNAME: 'example_db_user'
            DB_PASSWORD: 'example_db_password'
        ports:
            - 89:80
        volumes:
            - mixpost-storage:/var/www/html/storage/app
            - mixpost-logs:/var/www/html/storage/logs
        depends_on:
            - mysql
            - redis 
        restart: unless-stopped
    mysql:
        image: 'mysql/mysql-server:8.0'
        ports:
            - '3306:3306'
        environment:
            MYSQL_DATABASE: 'example_db_name'
            MYSQL_USER: 'example_db_user'
            MYSQL_PASSWORD: 'example_db_password'
        volumes:
            - 'mixpost-mysql:/var/lib/mysql'
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p example_db_password"]
            retries: 3
            timeout: 5s
        restart: unless-stopped
    redis:
        image: 'redis:6.2.11'
        command: redis-server --appendonly yes --replica-read-only no --protected-mode no
        ports:
          - '6379:6379'
        volumes:
            - 'mixpost-redis:/data'
        healthcheck:
            test: ["CMD", "redis-cli", "ping"]
            retries: 3
            timeout: 5s
        restart: unless-stopped  
volumes:
    mixpost-mysql:
        driver: local
    mixpost-redis:
        driver: local
    mixpost-storage:
        driver: local
    mixpost-logs:
        driver: local
81reap commented 7 months ago
Screenshot 2023-11-25 at 17 31 15
lao9s commented 7 months ago

@81reap What size is your video?

81reap commented 7 months ago

It's about 1.5 MB. To keep the test consistent I used the smallest file size on this page.

https://file-examples.com/index.php/sample-video-files/sample-mp4-files/

81reap commented 7 months ago

I am trying to schedule a video upload to Twitter/X

lao9s commented 7 months ago

@81reap Are you doing the proxy with Nginx?

If yes, add this:

client_max_body_size 200M;

before location /

kurucu commented 5 months ago

I get a similar problem, same outcome as above, but with the following error logged:

File does not exist at path /home/forge/mixpost/storage/mixpost-media/temp/XXX/YYY/uploads/01-2024/ZZZ-thumb.jpg

At vendor/inovector/mixpost-pro-team/src/Support/MediaFilesystem.php(17)

The mp4 file ZZZ.mp4 is found in storage at the same location.

kurucu commented 5 months ago

I tried with another video, and it worked. Both run on the computer fine, so not corrupt. Perhaps different encodings? (MP4 is just a wrapper).

So maybe a smarter detection is needed, or better handling of FFmpeg errors when it fails to decode.

lao9s commented 5 months ago

@kurucu Hi Eliot, Thank you for the report. Please, send me the video that has not been uploaded. I'd want to reproduce this bug.

kurucu commented 5 months ago

This one opens on my computer locally and as a hosted video. But does not work with ffmpeg.

https://github.com/inovector/mixpost/assets/1073323/5fdafae1-7c72-4213-8847-9fc2e2ceebd8

ffmpeg version 4.4.2-0ubuntu0.22.04.1