
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (34)
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
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 ;
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (6185)
-
How to stop perl buffering ffmpeg output
4 février 2017, par Sebastian KingI am trying to have a Perl program process the output of an ffmpeg encode, however my test program only seems to receive the output of ffmpeg in periodic chunks, thus I am assuming there is some sort of buffering going on. How can I make it process it in real-time ?
My test program (the
tr
command is there because I thought maybe ffmpeg’s carriage returns were causing perl to see one big long line or something) :#!/usr/bin/perl
$i = "test.mkv"; # big file, long encode time
$o = "test.mp4";
open(F, "-|", "ffmpeg -y -i '$i' '$o' 2>&1 | tr '\r' '\n'")
or die "oh no";
while(<f>) {
print "A12345: $_"; # some random text so i know the output was processed in perl
}
</f>Everything works fine when I replace the
ffmpeg
command with this script :#!/bin/bash
echo "hello";
for i in `seq 1 10`; do
sleep 1;
echo "hello $i";
done
echo "bye";When using the above script I see the output each second as it happens. With
ffmpeg
it is some 5-10 seconds or so until it outputs and will output sometimes 100 lines each output.I have tried using the program
unbuffer
ahead offfmpeg
in the command call but it seems to have no effect. Is it perhaps the2>&1
that might be buffering ?
Any help is much appreciated.If you are unfamiliar with ffmpeg’s output, it outputs a bunch of file information and stuff to
STDOUT
and then during encoding it outputs lines likeframe= 332 fps= 93 q=28.0 size= 528kB time=00:00:13.33 bitrate= 324.2kbits/s speed=3.75x
which begin with carriage returns instead of new lines (hence
tr
) onSTDERR
(hence2>&1
). -
Adding audio to an OpenCV video
21 février 2019, par pcrunnI’m trying to make a script that automates the process of making a video and i’m stuck on the part that i add the audio, I’m not sure if i’ll need to use ffmpeg for that and if so, i’m not sure how to use it the proper way to work with OpenCV (Which I use for rendering the video).
Thanks for your time, Here is my current code (that I found from a website)
# Creating the video... The worst part. Literally
width = 1920
height = 1080
FPS = 30
length = 0
for song in songs:
length+=song.info.length
length = int(length)
fourcc = VideoWriter_fourcc(*'MP42')
video = VideoWriter('result.avi', fourcc, float(FPS), (width, height))
for _ in range(FPS*length):
frame = np.random.randint(0, 256,
(height, width, 3),
dtype=np.uint8)
video.write(frame)
video.release() -
How to cut out first 5 seconds with youtube_dl and ffmpeg in python
23 février 2021, par SvenXPi have a python script to download and save a MP3 and i would like to add code to cut out 5 seconds from the beginning of the MP3.


def download():
 ydl_opts = {
 'format': 'bestaudio/best',
 'outtmpl': 'c:/MP3/%(title)s.%(ext)s',
 'cookiefile': 'cookies.txt',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }],
 }
 with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 ydl.download([inpYTLinkSong.get()])



I found some code for command line to cut x seconds :


ffmpeg -ss 00:00:15.00 -i "OUTPUT-OF-FIRST URL" -t 00:00:10.00 -c copy out.mp4


So i think i have to get the -ss part into the postprocessor part in my script, something like :


'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 'ss':'00:00:05.00'
 }],



But of course its not working with 'ss' or 'duration' (found in ffmpeg docu).


So any ideas what i have to put there instead of 'ss' ?