
Recherche avancée
Médias (91)
-
Valkaama DVD Cover Outside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Valkaama DVD Cover Inside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (105)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
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 (...) -
MediaSPIP Player : problèmes potentiels
22 février 2011, parLe lecteur ne fonctionne pas sur Internet Explorer
Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)
Sur d’autres sites (12949)
-
proc_open hangs when trying to read from a stream
7 juillet 2015, par eithedogI’ve encountered the issue with
proc_open
on Windows, when trying to convert a wmv file (to flv), usingffmpeg
, however I suspect I’ll encounter the same scenario whenever certain conditions occur.
Basically my code is as follows :$descriptorspec = array
(
array("pipe", "r"),
array("pipe", "w"),
array("pipe", "w")
);
$pipes = array();
$procedure = proc_open('cd "C:/Program Files/ffmpeg/bin" && "ffmpeg.exe" -i "C:/wamp/www/project/Wildlife.wmv" -deinterlace -qdiff 2 -ar 22050 "C:/wamp/www/project/Wildlife.flv"', $descriptorspec, $pipes);
var_dump(stream_get_contents($pipes[1]));Now, this code will cause PHP to hang indefinitely (it doesn’t matter if instead of
stream_get_contents
I’ll usefgets
orstream_select
, the behavior is consistent).The reason for it (I suspect) is that, while STDOUT stream is open succesfully, the process doesn’t write anything to it (even though running the same command in cmd displays output) and as such, trying to read from such stream, would cause the same issue as described here, so - PHP waits for the stream to have anything in it, process doesn’t write anything to it.
However (additional fun), setting
stream_set_timeout
orstream_set_blocking
doesn’t have any effect.As such - can somebody confirm/deny on what is going on, and, if possible, show how can I cater for such situation ? I’ve looked at PHP bugs, and all
proc_open hangs
ones seem to be fixed.For time being I’ve implemented such solution :
$timeout = 60;
while (true) {
sleep(1);
$status = proc_get_status($procedure);
if (!$status['running'] || $timeout == 0) break;
$timeout--;
}However, I’d really not like to rely on something like this as :
- I will have processes that run for longer than a minute - such processes will be falsely reported to be of the above mentioned type
- I want to know when the ffmpeg has finished converting the video - currently I’ll only know that process is still running after a minute, and I can’t really do anything to check if there’s any output (as it will hang PHP).
Also, I don’t really want to wait a full minute for the process to be checked (for example - converting the given video from command line takes <10s), and I’ll have videos that take more time to be converted.
Per comment from @Sjon, here’s
stream_select
I was using, which blocks due to same issue - STDOUT not being written to :$descriptorspec = array
(
array("pipe", "r"),
array("pipe", "w"),
array("pipe", "w")
);
$pipes = array();
$procedure = proc_open('cd "C:/Program Files/ffmpeg/bin" && "ffmpeg.exe" -i "C:/wamp/www/sandbox/Wildlife.wmv" -deinterlace -qdiff 2 -ar 22050 "C:/wamp/www/sandbox/Wildlife.flv"', $descriptorspec, $pipes);
$read = array($pipes[0]);
$write = array($pipes[1], $pipes[2]);
$except = array();
while(true)
if(($num_changed_streams = stream_select($read, $write, $except, 10)) !== false)
{
foreach($write as $stream)
var_dump(stream_get_contents($stream));
exit;
}
else
break;
Per conversation with @Sjon - reading from buffered streams on Windows is broken. The solution in the end is to use stream redirection via shell, and then read the created files - as such
$descriptorspec = array
(
array("pipe", "r"),
array("pipe", "w"),
array("pipe", "w")
);
$pipes = array();
$procedure = proc_open('cd "C:/Program Files/ffmpeg/bin" && "ffmpeg.exe" -i "C:/wamp/www/sandbox/Wildlife.mp4" -deinterlace -qdiff 2 -ar 22050 "C:/wamp/www/sandbox/Wildlife.flv" > C:/stdout.log 2> C:/stderr.log', $descriptorspec, $pipes);
proc_close($procedure);
$output = file_get_contents("C:/stdout.log");
$error = file_get_contents("C:/stderr.log");
unlink("C:/stdout.log");
unlink("C:/stderr.log");As the stream is buffered, in the file we will get unbuffered output (something I was after as well). And we don’t need to check if the file changes, because the result from shell is unbuffered and synchronous.
-
ffmpeg exported file is broken
11 août 2020, par Zhanho ShingI am using using ffmpeg to trim and join several audio files. The ouput audio file can be played as a normal file, but when I open it in some C# codes, exceptions are always throwing, says "
MP3 Header is missing
". I am new to ffmpeg and I googled for many times but seems no one is encountering this problem.

Here is my ffmpeg command to trim an audio file :


ffmpeg -i input_1.mp3 -ss 00:00:00.000 -to 00:00:01.000 -acodec libmp3lame 1.mp3



(The input audio format can be mp3/wma/wav/m4a/aac)


And the following is for joining all the audio files :


ffmpeg -safe 0 -f concat -i list.txt -acodec libmp3lame join.mp3



The
list.txt
contents :

file C:\\1.mp3
file C:\\2.mp3
file C:\\3.mp3



-
Python and ffmpeg audio sync and screen recording issues
9 août 2020, par odddollarI'm using ffmpeg and python to record my desktop screen. When the program is run, it starts recording, then when I press a key-combo it cuts off the last x amount of seconds and saves it then starts recording again ; similar to the "record that" functionality of windows game bar.


I have it working so it records video just fine, but then I change the ffmpeg command to record audio from my desktop and I get an error saying
ValueError: could not convert string to float: 'N/A'
occurring when I try to calculate the length of the recorded video. It appears as though the recording isn't being stopped until after I try to calculate the video length, even though this exact same code works fine when not recording audio.

Additionally, I also have an issue when recording audio in that the audio is a couple hundred milliseconds in front of the video. It's not a lot but it's enough to be noticeable.


What I'm overall asking, is there a way I can modify the ffmpeg command to prevent the audio desync issues, and what might be causing the problems I'm getting when attempting to find the length of the video with audio ?


import keyboard, signal
from os import remove
from os.path import isfile
from subprocess import Popen, getoutput
from datetime import datetime
import configparser

class Main:
 def __init__(self, save_location, framerate, duration):
 self.save_location = save_location
 self.framerate = int(framerate)
 self.duration = int(duration)
 self.working = self.save_location + '\\' + 'working.avi'
 self.start_recording()

 def start_recording(self):
 if isfile(self.working):
 remove(self.working)

 # start recording to working file at set framerate
 self.process = Popen(f'ffmpeg -thread_queue_size 578 -f gdigrab -video_size 1920x1080 -i desktop -f dshow -i audio="Stereo Mix (Realtek High Definition Audio)" -b:v 7M -minrate 4M -framerate {self.framerate} {self.working}')
 #self.process = Popen(f'ffmpeg -f gdigrab -framerate {self.framerate} -video_size 1920x1080 -i desktop -b:v 7M -minrate 2M {self.working}')

 def trim_video(self):
 # stop recording working file
 self.process.send_signal(signal.CTRL_C_EVENT)

 # call 'cause I have to
 getoutput(f"ffprobe -i {self.working}")

 # get length of working video
 length = getoutput(f'ffprobe -i {self.working} -show_entries format=duration -v quiet -of csv="p=0"')

 # get time before desired recording time
 start = float(length) - self.duration

 # get save location and title
 title = self.save_location+'\\'+self.get_time()+'.avi'

 # cut to last amount of desired time
 Popen(f"ffmpeg -ss {start} -i {self.working} -c copy -t {self.duration} {title}")
 getoutput(f"ffprobe -i {self.working}")

 self.start_recording()

 def get_time(self):
 now = datetime.now()
 return now.strftime("%Y_%m_%d#%H-%M-%S")


if __name__ == "__main__":
 config = configparser.ConfigParser()
 config.read("settings.ini")
 config = config["DEFAULT"]

 run = Main(config["savelocation"].replace("\\", "\\\\"), config["framerate"], config["recordlast"])
 keyboard.add_hotkey("ctrl+shift+alt+g", lambda:run.trim_video())

 while True:
 try:
 keyboard.wait()
 except KeyboardInterrupt:
 pass



The contents of the settings.ini file are listed below


[DEFAULT]
savelocation = C:\
framerate = 30
recordlast = 10



In the code block, the first line with
self.process = Popen
is the one that records audio and has the issues, the second line (the commented out one below) is the one that works fine.