
Recherche avancée
Autres articles (73)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (13273)
-
Best way to pipe audio and video chunks from within python to ffmpeg
8 mai 2016, par basilikumProblem
I’m getting audio and video chunks from a third-party server and I would like to pipe those chunks to ffmpeg to create a WebM live stream according to these instructions :
http://wiki.webmproject.org/adaptive-streaming/instructions-to-do-webm-live-streaming-via-dash
Here they are using input from webcam and microphone but I need to use the data chunks, so the ffmpeg command would look somehow like this :
cmd = [
"ffmpeg",
"-f", "flv", "-i", "video.fifo",
"-f", "s16le", "-ar", "16000", "-ac", "1", "-i", "audio.fifo",
"-map", "0:0",
"-pix_fmt", "yuv420p",
"-c:v", "libvpx-vp9",
"-s", "640x480", "-keyint_min", "40", "-g", "40", "-speed", "6",
"-tile-columns", "4", "-frame-parallel", "1", "-threads", "8",
"-static-thresh", "0", "-max-intra-rate", "300",
"-deadline", "realtime", "-lag-in-frames", "0",
"-error-resilient", "1",
"-b:v", "3000k",
"-f", "webm_chunk",
"-header", self.video_header,
"-chunk_start_index", "1",
"video_360_%d.chk",
"-map", "1:0",
"-c:a", "libvorbis",
"-b:a", "16k", "-ar", "16000",
"-f", "webm_chunk",
"-audio_chunk_duration", "2000",
"-header", self.audio_header,
"-chunk_start_index", "1",
"audio_171_%d.chk"
]As you can see, I am using a "video.fifo" and "audio.fifo" file, because I thought it would be a good idea to pipe the chunks in via a named pipe, but I can’t get it to work. Here is what I’m doing :
p = subprocess.Popen(cmd)
fa = os.open("video.fifo", os.O_WRONLY)
fv = os.open("audio.fifo", os.O_WRONLY)So I’m starting the subprocess first, so that it opens the fifo files for reading. After that, I should be able to open them for writing but I am not. More specifically, I am able to open the first one, but not the second one. So maybe that has something to do with how ffmpeg handles its inputs if there are more than one, but I just don’t know.
Question
How can I either solve the problem of non openable named pipes or how can I achieve what I wanted to achieve without named pipes.
-
lavf/img2dec : add pnm pipe demuxers
8 juin 2016, par Clément Bœsch -
Getting 'av_interleaved_write_frame() : Broken pipe' error
2 juillet 2016, par PoornanI am trying this blog post.I am new to python, numpy as well as FFMPEG. I could not figure out what causes this issue.
http://zulko.github.io/blog/2013/09/27/read-and-write-video-frames-in-python-using-ffmpeg/
here is the code :
import subprocess as sp
import numpy
print ("Hello World!");
FFMPEG_BIN = "ffmpeg" # on Linux ans Mac OS
#FFMPEG_BIN = "ffmpeg.exe" # on Windows
command = [ FFMPEG_BIN,
'-i', '/Users/eananthaneshan/Movies/myvideo.mp4',
'-f', 'image2pipe',
'-pix_fmt', 'yuv444p',
'-s', '420x360',
'-r', '24',
'-vcodec', 'h264', '-']
pipe = sp.Popen(command, stdout = sp.PIPE, bufsize=-1)
# read 420*360*3 bytes (= 1 frame)
raw_image = pipe.stdout.read(420*360*3)
# transform the byte read into a numpy array
image = numpy.fromstring(raw_image, dtype='uint8')
image = image.reshape((360,420,3) )
# throw away the data in the pipe's buffer.
pipe.stdout.flush()This is the output :
ffmpeg version 2.8 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 7.0.0 (clang-700.0.72)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 ' --enable-nonfree --enable-vda
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/eananthaneshan/Movies/myvideo.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isom
creation_time : 2014-04-07 02:02:31
Duration: 01:00:10.03, start: 0.000000, bitrate: 1024 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 111 kb/s (default)
Metadata:
creation_time : 2014-04-07 02:02:31
handler_name : GPAC ISO Audio Handler
Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/unknown/unknown), 720x404, 909 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Metadata:
creation_time : 2014-04-07 01:14:58
handler_name : L-SMASH Video Media Handler
encoder : AVC Coding
Output #0, image2pipe, to 'pipe:':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isom
encoder : Lavf56.40.101
Stream #0:0(und): Video: rawvideo (444P / 0x50343434), yuv444p, 420x360, q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
Metadata:
creation_time : 2014-04-07 01:14:58
handler_name : L-SMASH Video Media Handler
encoder : Lavc56.60.100 rawvideo
Stream mapping:
Stream #0:1 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
av_interleaved_write_frame(): Broken pipe
frame= 2 fps=0.0 q=-0.0 Lsize= 886kB time=00:00:00.08 bitrate=87003.8kbits/s
video:886kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Conversion failed!