
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (100)
-
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...) -
Que fait exactement ce script ?
18 janvier 2011, parCe script est écrit en bash. Il est donc facilement utilisable sur n’importe quel serveur.
Il n’est compatible qu’avec une liste de distributions précises (voir Liste des distributions compatibles).
Installation de dépendances de MediaSPIP
Son rôle principal est d’installer l’ensemble des dépendances logicielles nécessaires coté serveur à savoir :
Les outils de base pour pouvoir installer le reste des dépendances Les outils de développements : build-essential (via APT depuis les dépôts officiels) ; (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (9248)
-
Read, process and save video and audio with FFMPEG
3 mai 2017, par sysseonI want to open a video resource with ffmpeg on Python, get the read frames from the pipe, modify them (e.g. put the timestamp with OpenCV) and write the result to an output video file. I also want to save the audio source with no changes.
My code (with no audio and two processes) :
import subprocess as sp
import numpy as np
# import time
# import cv2
FFMPEG_BIN = "C:/ffmpeg/bin/ffmpeg.exe"
INPUT_VID = 'input.avi'
res = [320, 240]
command_in = [FFMPEG_BIN,
'-y', # (optional) overwrite output file if it exists
'-i', INPUT_VID,
'-f', 'image2pipe', # image2pipe or rawvideo?
'-pix_fmt', 'bgr24',
'-vcodec', 'rawvideo',
'-']
command_out = [FFMPEG_BIN,
'-y', # (optional) overwrite output file if it exists
'-f', 'rawvideo',
'-vcodec', 'rawvideo',
'-s', '320x240',
'-pix_fmt', 'bgr24',
'-r', '25',
'-i', '-',
# '-i', INPUT_VID, # Audio
'-vcodec', 'mpeg4',
'output.mp4']
pipe_in = sp.Popen(command_in, stdout=sp.PIPE, stderr=sp.PIPE)
pipe_out = sp.Popen(command_out, stdin=sp.PIPE, stderr=sp.PIPE)
while True:
# Read 320*240*3 bytes (= 1 frame)
raw_image = pipe_in.stdout.read(res[0] * res[1] * 3)
# Transform the byte read into a numpy array
image = np.fromstring(raw_image, dtype=np.uint8)
image = image.reshape((res[1], res[0], 3))
# Draw some text in the image
# draw_text(image)
# Show the image with OpenCV (not working, gray image, why?)
# cv2.imshow("VIDEO", image)
# Write image to output process
pipe_out.stdin.write(image.tostring())
print 'done'
pipe_in.kill()
pipe_out.kill()- Could it be done with just a process ? (Read the input from a file,
put it in the input pipe, get the image, process it, and put it in
the output pipe to be saved into a video file) - How can I save the audio ? In this example, I could use ’-i
INPUT_VID’ in the second process to get the audio channel, but my
source will be a RTSP, and I don’t want to create a connection for
each process. Could I put video+audio in the pipe and rescue and
separate it with numpy ? How ? - I use a loop to process the frames and wait until I get an error.
How can I check if all frames are already read ? - Not important, but if I try to show the images with OpenCV
(cv2.imshow(...)), I only see a gray screen. Why ?
- Could it be done with just a process ? (Read the input from a file,
-
AppRTC : Google’s WebRTC test app and its parameters
23 juillet 2014, par silviaIf you’ve been interested in WebRTC and haven’t lived under a rock, you will know about Google’s open source testing application for WebRTC : AppRTC.
When you go to the site, a new video conferencing room is automatically created for you and you can share the provided URL with somebody else and thus connect (make sure you’re using Google Chrome, Opera or Mozilla Firefox).
We’ve been using this application forever to check whether any issues with our own WebRTC applications are due to network connectivity issues, firewall issues, or browser bugs, in which case AppRTC breaks down, too. Otherwise we’re pretty sure to have to dig deeper into our own code.
Now, AppRTC creates a pretty poor quality video conference, because the browsers use a 640×480 resolution by default. However, there are many query parameters that can be added to the AppRTC URL through which the connection can be manipulated.
Here are my favourite parameters :
- hd=true : turns on high definition, ie. minWidth=1280,minHeight=720
- stereo=true : turns on stereo audio
- debug=loopback : connect to yourself (great to check your own firewalls)
- tt=60 : by default, the channel is closed after 30min – this gives you 60 (max 1440)
For example, here’s how a stereo, HD loopback test would look like : https://apprtc.appspot.com/?r=82313387&hd=true&stereo=true&debug=loopback .
This is not the limit of the available parameter, though. Here are some others that you may find interesting for some more in-depth geekery :
- ss=[stunserver] : in case you want to test a different STUN server to the default Google ones
- ts=[turnserver] : in case you want to test a different TURN server to the default Google ones
- tp=[password] : password for the TURN server
- audio=true&video=false : audio-only call
- audio=false : video-only call
- audio=googEchoCancellation=false,googAutoGainControl=true : disable echo cancellation and enable gain control
- audio=googNoiseReduction=true : enable noise reduction (more Google-specific parameters)
- asc=ISAC/16000 : preferred audio send codec is ISAC at 16kHz (use on Android)
- arc=opus/48000 : preferred audio receive codec is opus at 48kHz
- dtls=false : disable datagram transport layer security
- dscp=true : enable DSCP
- ipv6=true : enable IPv6
AppRTC’s source code is available here. And here is the file with the parameters (in case you want to check if they have changed).
Have fun playing with the main and always up-to-date WebRTC application : AppRTC.
UPDATE 12 May 2014
AppRTC now also supports the following bitrate controls :
- arbr=[bitrate] : set audio receive bitrate
- asbr=[bitrate] : set audio send bitrate
- vsbr=[bitrate] : set video receive bitrate
- vrbr=[bitrate] : set video send bitrate
Example usage : https://apprtc.appspot.com/?r=&asbr=128&vsbr=4096&hd=true
The post AppRTC : Google’s WebRTC test app and its parameters first appeared on ginger’s thoughts.
-
ffmpeg python subprocess error only on ubuntu
19 avril 2017, par WongerIm working on an application that is splitting videos from youtube into images. I work on a macbook pro for development, but our app servers run on an ubuntu 12.04 server. The current code on our servers running right now is the following
ffmpeg -i {video_file} -vf fps={fps}
which we run via a subprocess Popen function call in python. This has very slow performance because it is essentially playing back the whole video file to get the frames. I found another SO post that said you could use -accurate_seek -ss to grab single frames at a specific time, but I am facing some issues with that. When i run the command via command line when SSH into our dev server, it works fine, but when i run it via a subprocess Popen call in python, i get the following error :
(standard_in) 1: syntax error
ffmpeg version 3.2.4-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-5) 20170205
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 34.101 / 55. 34.101
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.101 / 57. 56.101
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Option accurate_seek (enable/disable accurate seeking with -ss) cannot be applied to output url test.mkv -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for output file test.mkv.
Error opening output files: Invalid argumentpython code :
import subprocess
command = "for i in {0..3} ; do ffmpeg -accurate_seek -ss `echo $i*60.0 | bc` -i test.mkv -frames:v 1 images/test_img_$i.jpg ; done"
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr = subprocess.STDOUT, shell=True)
output = process.communicate()
print output[0].replace('\\n' , '\n')The thing is, when i run this on my OSX terminal, it works fine, but there is some issue with doing it in ubuntu. Does anyone have experience with this issue ?
Output when i run the same exact code in osx :
ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.31)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.2 --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-libxvid --enable-libvpx --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, matroska,webm, from 'test.mkv':
Metadata:
COMPATIBLE_BRANDS: iso6avc1mp41
MAJOR_BRAND : dash
MINOR_VERSION : 0
ENCODER : Lavf57.25.100
Duration: 00:02:10.20, start: 0.007000, bitrate: 2729 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
HANDLER_NAME : VideoHandler
DURATION : 00:02:10.172000000
Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Metadata:
DURATION : 00:02:10.201000000
[swscaler @ 0x7f9b4b008000] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'images/test_img_0.jpg':
Metadata:
COMPATIBLE_BRANDS: iso6avc1mp41
MAJOR_BRAND : dash
MINOR_VERSION : 0
encoder : Lavf57.25.100
Stream #0:0: Video: mjpeg, yuvj420p(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
Metadata:
HANDLER_NAME : VideoHandler
DURATION : 00:02:10.172000000
encoder : Lavc57.24.102 mjpeg
Side data:
unknown side data type 10 (24 bytes)
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=7.2 Lsize=N/A time=00:00:00.04 bitrate=N/A speed= 1x
video:73kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
....One thing i forgot to mention is that on my mac i used homebrew to install ffmpeg, where as on Ubuntu i used a static build
other stack overflow reference : Fastest way to extract frames using ffmpeg ?