
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (94)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (6598)
-
Killing cmd processes in Bravobit FFmpeg
10 octobre 2018, par katarotyI am using
Bravobit FFmpeg
Bravobit FFmpeg github toconvert
some audio files. There are more convertion than these 2 but I do not think they are necessary to add here.My question is, is it possible to kill or stop these commands once they are started.
At the moment when I start the first method
convertPCMToWav()
and then callfinish()
in theMain method
which stops all other processes but these. They just keep on going like nothing has happened.public class AudioProcessor {
private Context context;
private FFmpeg ffmpeg;
private File micPcmFile;
private File pcmtowavTempFile;
private File mp3towavTempFile;
public AudioProcessor(Context context, Activity activity) {
ffmpeg = null;
ffmpeg = FFmpeg.getInstance(context);
this.context = context;
prepare();
}
/**
* Program main method. Starts running program
* @throws Exception
*/
public void process() throws Exception {
if (!ffmpeg.isSupported()) {
Log.e("AudioProcessor", "FFMPEG not supported! Cannot convert audio!");
throw new Exception("FFMPeg has to be supported");
}
if (!checkIfAllFilesPresent()) {
Log.e("AudioProcessor", "All files are not set yet. Please set file first");
throw new Exception("Files are not set!");
}
Log.e("AudioProcessor", "Start processing audio");
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
convertPCMToWav();
}
}, 200);
}
/**
* Prepares program
*/
private void prepare() {
prepareTempFiles();
}
/**
* Converts PCM to wav file. Automatically create new file.
*/
private void convertPCMToWav() {
String[] cmd = { "-f" , "s16le", "-ar", "44.1k", "-i", micPcmFile.toString(), "-y", pcmtowavTempFile.toString()};
ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {
@Override
public void onStart() {
super.onStart();
}
@Override
public void onSuccess(String message) {
super.onSuccess(message);
convertMP3ToWav();
}
@Override
public void onFailure(String message) {
super.onFailure(message);
}
});
}
/**
* Converts mp3 file to wav file.
* Creates Wav file
*/
private void convertMP3ToWav() {
String[] cmd = { "-i" , backgroundMp3File.toString(), "-y", mp3towavTempFile.toString() };
ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {
@Override
public void onStart() {
super.onStart();
}
@Override
public void onSuccess(String message) {
super.onSuccess(message);
changeMicAudio();
}
@Override
public void onFailure(String message) {
super.onFailure(message);
}
});
}
/**
* Prepares temp required files by deleteing them if they exsist.
* Files cannot exists before ffmpeg actions. FFMpeg automatically creates those files.
*/
private void prepareTempFiles() {
pcmtowavTempFile = new File(context.getFilesDir()+ Common.TEMP_LOCAL_DIR + "/" + "_pcm.wav");
mp3towavTempFile = new File(context.getFilesDir()+ Common.TEMP_LOCAL_DIR + "/" + "_mp3.wav");
destroyTempFiles();
}
/**
* Destroys temp required files
*/
private void destroyTempFiles() {
pcmtowavTempFile.delete();
mp3towavTempFile.delete();
}
} -
How to deal ffplay bein too slow playing iPhone's videos ?
21 janvier 2019, par Mikhail T.Trying to play a 3840x2160 video recorded by an iPhone 7 (@30fps), I get frequent pauses — in the video, music keeps playing.
This happens both in firefox and when
ffplay
is invoked to play the file directly — from command-line. The CPU is a dual E6700 @3.20GHz — not super fast, but it should be able to play smoothly, shouldn’t it ? Video is Intel’s "series 4" integrated chipset — again, not a speed-daemon, but it should be adequate... Support for Intel’s VA API is included.I build ffmpeg-4.1 from source using FreeBSD port. As you can see, the port has a maddening amount of options — including several different ones for the 264-codec.
Any suggestions for improving the decoding speed to the point, where it is watchable by a human ? Thank you !
-
Dynamically created QImage frames to ffmpeg stdin using QThread
11 mai 2021, par musicamanteI am trying to create video files with ffmpeg using frames dynamically created on a separate thread.


While I can create those frames and store them on disk/memory, I'd like to avoid that passage since the amount/size of the frames can be high and many "jobs" could be created with different format or options. But, also importantly, I'd like to better understand the logic behind this, as I admit I've not a very deep knowledge on how thread/processing actually works.


Right now I'm trying to create the QProcess in the QThread object, and then run the image creation thread as soon as the process is started, but it doesn't seem to work : no file is created, and I don't even get any output from standard error (but I know I should, since I can get it if I don't use the thread).


Unfortunately, due to my little knowledge on how QProcess deals with threads and piping (and, obviously, all possible ffmpeg options), I really don't understand how can achieve this.


Besides obviously getting the output file created, the expected result is to be able to launch the encoding (and possibly queue more encodings in the meantime) while keeping the UI responding and get notifications of the current processing state.


import re
from PyQt5 import QtCore, QtGui, QtWidgets

logRegExp = r'(?:(n:\s+)(?P\d+)\s).*(?:(pts_time:\s*)(?P<time>\d+.\d*))'

class Encoder(QtCore.QThread):
 completed = QtCore.pyqtSignal()
 frameDone = QtCore.pyqtSignal(object)
 def __init__(self, width=1280, height=720, frameCount=100):
 super().__init__()
 self.width = width
 self.height = height
 self.frameCount = frameCount

 def start(self):
 self.currentLog = ''
 self.currentData = bytes()
 self.process = QtCore.QProcess()
 self.process.setReadChannel(self.process.StandardError)
 self.process.finished.connect(self.completed)
 self.process.readyReadStandardError.connect(self.stderr)
 self.process.started.connect(super().start)
 self.process.start('ffmpeg', [
 '-y', 
 '-f', 'png_pipe', 
 '-i', '-', 
 '-c:v', 'libx264', 
 '-b:v', '800k', 
 '-an', 
 '-vf', 'showinfo',
 '/tmp/test.h264', 
 ])

 def stderr(self):
 self.currentLog += str(self.process.readAllStandardError(), 'utf-8')
 *lines, self.currentLog = self.currentLog.split('\n')
 for line in lines:
 print('STDERR: {}'.format(line))
 match = re.search(logRegExp, line)
 if match:
 data = match.groupdict()
 self.frameDone.emit(int(data['frame']))

 def run(self):
 font = QtGui.QFont()
 font.setPointSize(80)
 rect = QtCore.QRect(0, 0, self.width, self.height)
 for frame in range(1, self.frameCount + 1):
 img = QtGui.QImage(QtCore.QSize(self.width, self.height), QtGui.QImage.Format_ARGB32)
 img.fill(QtCore.Qt.white)
 qp = QtGui.QPainter(img)
 qp.setFont(font)
 qp.setPen(QtCore.Qt.black)
 qp.drawText(rect, QtCore.Qt.AlignCenter, 'Frame {}'.format(frame))
 qp.end()
 img.save(self.process, 'PNG')
 print('frame creation complete')


class Test(QtWidgets.QWidget):
 def __init__(self):
 super().__init__()
 layout = QtWidgets.QVBoxLayout(self)
 self.startButton = QtWidgets.QPushButton('Start')
 layout.addWidget(self.startButton)

 self.frameLabel = QtWidgets.QLabel()
 layout.addWidget(self.frameLabel)

 self.process = Encoder()
 self.process.completed.connect(lambda: self.startButton.setEnabled(True))
 self.process.frameDone.connect(self.frameLabel.setNum)
 self.startButton.clicked.connect(self.create)

 def create(self):
 self.startButton.setEnabled(False)
 self.process.start()


import sys
app = QtWidgets.QApplication(sys.argv)
test = Test()
test.show()
sys.exit(app.exec_())
</time>


If I add the following lines at the end of
run()
, then the file is actually created and I get the stderr output, but I can see that it's processed after the completion of the for cycle, which obviously is not the expected result :

self.process.closeWriteChannel()
 self.process.waitForFinished()
 self.process.terminate()



Bonus : I'm on Linux, I don't know if it works differently on Windows (and I suppose it would work similarly on MacOS), but in any case I'd like to know if there are differences and how to possibly deal with them.