
Recherche avancée
Médias (2)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
Autres articles (24)
-
Utilisation et configuration du script
19 janvier 2011, parInformations spécifiques à la distribution Debian
Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
Récupération du script
Le script d’installation peut être récupéré de deux manières différentes.
Via svn en utilisant la commande pour récupérer le code source à jour :
svn co (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)
Sur d’autres sites (5930)
-
Merge commit 'bca41545b371efc34e38d1fa8bb12dba8b614da0'
12 février 2018, par James Almer -
input/output error with ffmpeg using an input URL in docker
12 décembre 2023, par GrimouI need to use ffmpeg to listen to an rtmp url within a running docker container using ffmpeg.
my ffmpeg command is quite simple :
ffmpeg -listen 1 -i rtmp://localhost:1935/live/app ./output.wav


ffmpeg seems to start correctly and listen to the url.


But, when I start the stream (using OBS Studio) I have an input/output error. Here is the logs (with debug log level)


❯ ffmpeg -loglevel debug -listen 1 -i rtmp://127.0.0.1:1935/live/app ./output.wav
ffmpeg version 5.1.4-0+deb12u1 Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 12 (Debian 12.2.0-14)
 configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
 libavutil 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 libpostproc 56. 6.100 / 56. 6.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-listen' ... matched as AVOption 'listen' with argument '1'.
Reading option '-i' ... matched as input url with argument 'rtmp://127.0.0.1:1935/live/app'.
Reading option './output.wav' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtmp://127.0.0.1:1935/live/app.
Successfully parsed a group of options.
Opening an input file: rtmp://127.0.0.1:1935/live/app.
[NULL @ 0x56288f8e7a00] Opening 'rtmp://127.0.0.1:1935/live/app' for reading
[rtmp @ 0x56288f8e8200] No default whitelist set
[tcp @ 0x56288f8e8d40] No default whitelist set
[rtmp @ 0x56288f8e8200] Proto = rtmp, path = /live/app, app = live, fname = app
[rtmp @ 0x56288f8e8200] New incoming chunk size = 4096
rtmp://127.0.0.1:1935/live/app: Input/output error



The last 3 lines only appear when I start the stream.


It doesn't seems to be a permission problem with the file system, since using
ffmpeg -i ./test.mp4 ./output.wav
works inside the container.

I also did not find any problem with the network. I am currently using
network_mode: "host"
in my docker_compose.yml and the logs show that it did receive data before the error appear.

It also doesn't seem to be a problem with the ffmpeg command, since the exact same command works when using it without docker involved.


What else could be the problem ?


here is my docker_compose.yml


version: '3'

services:
 ffmpeg-container:
 build:
 context: .
 network_mode: "host"
 tty: true # Allocate a pseudo-TTY for interactive use




Dockerfile


FROM python:3

# Install ffmpeg
RUN apt-get update && apt-get install -y ffmpeg

# Create a working directory
WORKDIR app

# Copy the Python script to the container
COPY app.py .
COPY test.mp4 .

# Run the Python script
CMD ["python", "app.py"]




-
Getting realtime output from ffmpeg to be used in progress bar (PyQt4, stdout)
8 septembre 2023, par Jason O'NeilI've looked at a number of questions but still can't quite figure this out. I'm using PyQt, and am hoping to run
ffmpeg -i file.mp4 file.avi
and get the output as it streams so I can create a progress bar.


I've looked at these questions :
Can ffmpeg show a progress bar ?
catching stdout in realtime from subprocess



I'm able to see the output of a rsync command, using this code :



import subprocess, time, os, sys

cmd = "rsync -vaz -P source/ dest/"
p, line = True, 'start'


p = subprocess.Popen(cmd,
 shell=True,
 bufsize=64,
 stdin=subprocess.PIPE,
 stderr=subprocess.PIPE,
 stdout=subprocess.PIPE)

for line in p.stdout:
 print("OUTPUT>>> " + str(line.rstrip()))
 p.stdout.flush()




But when I change the command to
ffmpeg -i file.mp4 file.avi
I receive no output. I'm guessing this has something to do with stdout / output buffering, but I'm stuck as to how to read the line that looks like


frame= 51 fps= 27 q=31.0 Lsize= 769kB time=2.04 bitrate=3092.8kbits/s




Which I could use to figure out progress.



Can someone show me an example of how to get this info from ffmpeg into python, with or without the use of PyQt (if possible)





EDIT :
I ended up going with jlp's solution, my code looked like this :



#!/usr/bin/python
import pexpect

cmd = 'ffmpeg -i file.MTS file.avi'
thread = pexpect.spawn(cmd)
print "started %s" % cmd
cpl = thread.compile_pattern_list([
 pexpect.EOF,
 "frame= *\d+",
 '(.+)'
])
while True:
 i = thread.expect_list(cpl, timeout=None)
 if i == 0: # EOF
 print "the sub process exited"
 break
 elif i == 1:
 frame_number = thread.match.group(0)
 print frame_number
 thread.close
 elif i == 2:
 #unknown_line = thread.match.group(0)
 #print unknown_line
 pass




Which gives this output :



started ffmpeg -i file.MTS file.avi
frame= 13
frame= 31
frame= 48
frame= 64
frame= 80
frame= 97
frame= 115
frame= 133
frame= 152
frame= 170
frame= 188
frame= 205
frame= 220
frame= 226
the sub process exited




Perfect !