
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (61)
-
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)
Sur d’autres sites (6366)
-
ffmpeg unbale to initialize threading in some cases
16 octobre 2020, par Sudipta RoyI am posting this again since the earlier question I posted has been closed


I have a JAVA service running in wildfly which is calling an external ffmpeg binary to convert .au files to .wav files. The actual command that is being executed is as follows :


ffmpeg -y -i INPUT.au OUTPUT.wav



It is running smoothly, except every once in a while it is creating an empty .wav file becasue of the following error :


Error: ffmpeg version c6710aa Copyright (c) 2000-2017 the FFmpeg 
developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/tmp/ffmpeg-static/target --pkg-config-flags=- 
-static --extra-cflags=-I/tmp/ffmpeg-static/target/include --extra- 
ldflags=-L/tmp/ffmpeg-static/target/lib --extra-ldexeflags=-static -- 
bindir=/tmp/ffmpeg-static/bin --enable-pic --enable-ffplay --enable- 
ffserver --enable-fontconfig --enable-frei0r --enable-gpl --enable- 
version3 --enable-libass --enable-libfribidi --enable-libfdk-aac -- 
enable-libfreetype --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 --enable-nonfree --enable-openssl
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

Input #0, ogg, from 'INPUT.au'
Duration: 00:00:34.08, start: 0.01500, bitrate: 15kb/s
Stream: #0.0: Audio: speex, 8000Hz, mono, s16, 15kb/s

[AVFilterGraph @ 0x43ec6e0] Error initializing threading.
[AVFilterGraph @ 0x43ec6e0] Error creating filter 'anull'



If I try to manually convert the file from command line, it works. A brief internet search (this) shows that it might be due to the fact that
ffmpeg
is unable to create threads for internal use. Can anyone please elaborate ?

The server where I am facing the problem have relatively high load. I have seen that wildfly is creating close to 1800 threads.


Thanks


P.s. I have managed to recreate the problem. Below is the code :


SystemCommandExecutor.java


import java.io.*;
 import java.util.List;
 public class SystemCommandExecutor {
 private List<string> commandInformation;
 private String adminPassword;
 private ThreadedStreamHandler inputStreamHandler;
 private ThreadedStreamHandler errorStreamHandler;

 public SystemCommandExecutor(final List<string> commandInformation)
 {
 if (commandInformation==null) throw new NullPointerException("The commandInformation is required.");
 this.commandInformation = commandInformation;
 this.adminPassword = null;
 }

 public int executeCommand()
 throws IOException, InterruptedException
 {
 int exitValue = -99;

 try
 {
 ProcessBuilder pb = new ProcessBuilder(commandInformation);
 Process process = pb.start();
 OutputStream stdOutput = process.getOutputStream();
 InputStream inputStream = process.getInputStream();
 InputStream errorStream = process.getErrorStream();
 inputStreamHandler = new ThreadedStreamHandler(inputStream, stdOutput, adminPassword);
 errorStreamHandler = new ThreadedStreamHandler(errorStream);
 inputStreamHandler.start();
 errorStreamHandler.start();
 exitValue = process.waitFor();
 inputStreamHandler.interrupt();
 errorStreamHandler.interrupt();
 inputStreamHandler.join();
 errorStreamHandler.join();
 }
 catch (IOException e)
 {
 throw e;
 }
 catch (InterruptedException e)
 {
 throw e;
 }
 finally
 {
 return exitValue;
 }
 }

 public StringBuilder getStandardOutputFromCommand()
 {
 return inputStreamHandler.getOutputBuffer();
 }

 public StringBuilder getStandardErrorFromCommand()
 {
 return errorStreamHandler.getOutputBuffer();
 }
}
</string></string>


ThreadedStreamHandler.java


import java.io.*;

class ThreadedStreamHandler extends Thread
{
 InputStream inputStream;
 String adminPassword;
 OutputStream outputStream;
 PrintWriter printWriter;
 StringBuilder outputBuffer = new StringBuilder();
 private boolean sudoIsRequested = false;

 
 ThreadedStreamHandler(InputStream inputStream)
 {
 this.inputStream = inputStream;
 }

 
 ThreadedStreamHandler(InputStream inputStream, OutputStream outputStream, String adminPassword)
 {
 this.inputStream = inputStream;
 this.outputStream = outputStream;
 this.printWriter = new PrintWriter(outputStream);
 this.adminPassword = adminPassword;
 this.sudoIsRequested = true;
 }

 public void run()
 {
 
 if (sudoIsRequested)
 {
 printWriter.println(adminPassword);
 printWriter.flush();
 }

 BufferedReader bufferedReader = null;
 try
 {
 bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
 String line = null;
 while ((line = bufferedReader.readLine()) != null)
 {
 outputBuffer.append(line + "\n");
 }
 }
 catch (IOException ioe)
 {
 ioe.printStackTrace();
 }
 catch (Throwable t)
 {
 t.printStackTrace();
 }
 finally
 {
 try
 {
 bufferedReader.close();
 }
 catch (IOException e)
 {
 // ignore this one
 }
 }
 }

 private void doSleep(long millis)
 {
 try
 {
 Thread.sleep(millis);
 }
 catch (InterruptedException e)
 {
 // ignore
 }
 }

 public StringBuilder getOutputBuffer()
 {
 return outputBuffer;
 }

}



FfmpegRunnable.java


import java.io.IOException;
import java.util.List;

public class FfmpegRunnable implements Runnable {
 private List<string> command;
 SystemCommandExecutor executor;

 public FfmpegRunnable(List<string> command) {
 this.command = command;
 this.executor = new SystemCommandExecutor(command);
 }

 @Override
 public void run() {
 try {
 int id = (int) Thread.currentThread().getId();
 int result = executor.executeCommand();
 if(result != 0) {
 StringBuilder err = executor.getStandardErrorFromCommand();
 System.out.println("[" + id + "]" + "[ERROR] " + err);
 } else {
 System.out.println("[" + id + "]" + "[SUCCESS]");
 }
 } catch (IOException e) {
 e.printStackTrace();
 } catch (InterruptedException e) {
 e.printStackTrace();
 }
 }
}
</string></string>


FfmpegMain.java


import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
public class FfmpegMain {
 public static void main(String[] args) {
 //boolean threading = false;
 System.out.println(args[0]);
 int nrThread = Integer.parseInt(args[0]);
 boolean threading = Boolean.parseBoolean(args[1]);
 System.out.println("nrThread : " + nrThread + ", threading : " + threading);
 if(threading) {
 System.out.println("ffmpeg threading enabled");
 } else {
 System.out.println("ffmpeg threading not enabled");
 }
 ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(nrThread);
 for(int i=0; i cmd = new ArrayList<string>();
 String dest = "/tmp/OUTPUT/output_" + (Math.random()*1000) + ".wav";
 String cmdStr = "/tmp/FFMPEG/ffmpeg" + (threading ? " -threads 1 " : " ")
 + "-y -i /tmp/input.au " + dest;
 cmd.add("/bin/sh");
 cmd.add("-c");
 cmd.add(cmdStr);

 executor.submit(new FfmpegRunnable(cmd));
 }
 executor.shutdown();
 }
}
</string>


I have created a jar with the class files and run the jar from two seperate terminal with the following command


java -jar JAR.jar 40 true



Here 40 is the number of threads, simulating varous users accessing the system. Every once in a while I get above mentioned error.


-
How to paint in Qt using hardware acceleration ?
19 octobre 2020, par FennecFixI need to do some quite intensive drawing processes in my appliation - I'm recording a camera and a desktop. I'm using
ffmpeg
to capture and encode/decode my videos. Those processes are quite fast and they working in a separate thread, but when it comes to render - perfomance drops drastically. I'm usingQLabel
to display captured frames viasetPixmap()
method and I see that Qt not using any GPU power even if a matrix operation, such as scaling an image to fit the window is clearly implied. Is there any way to paint images in Qt using hardware acceleration ? Or is there another ways to speed up painting process ?

-
How do I configure ffmpeg & openh264 so that the video file can be opened in Windows Media Player 12
10 mars 2017, par Sacha GuyerI have successfully created h264/mp4 movie files with ffmpeg and the x264 library.
Now I would like to change the h264 library from x264 to openH264. I could replace the x264 library with openH264, recompile ffmpeg and produce movie files, without changing my sources that produce the movie. The resulting movie opens fine in Quicktime on Mac, but on Windows, Windows Media Player 12 cannot play it.
The documentation about Windows Media Player support for h264 is unclear. File types supported by Windows Media Player states in the table that Windows Media Player 12 supports mp4, but the text below says :
Windows Media Player does not support the playback of the .mp4 file format.
From what I have observed, Windows Media Player 12 IS capable of playing h264/mp4 files, but only when created with x264.
Does anyone know how I need to adjust the configuration of the codec/context so that the movie plays in Windows Media Player ? Does Windows Media Player only support certain h264 profiles ?
I noticed the warning :
[libopenh264 @ 0x...] [OpenH264] this = 0x..., Warning:bEnableFrameSkip = 0,bitrate can’t be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame
With the configuration :
av_dict_set(&options, "allow_skip_frames", "1", 0);
I could get rid of this warning, but the movie still does not play. Are there other options that need to be set so that the movie plays in Windows Media Player ?
Thank you for your help
ffprobe output of the file that does play fine in Windows Media Player :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_x264.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : retina
encoder : Lavf57.56.100
comment : Creation Date: 2017-03-10 07:47:39.601
Duration: 00:00:04.17, start: 0.000000, bitrate: 17497 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661),
yuv420p, 852x754, 17495 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandlerffprobe output of the file that does not play in Windows Media Player :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_openh264.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : retina
encoder : Lavf57.56.100
comment : Creation Date: 2017-03-10 07:49:27.024
Duration: 00:00:04.17, start: 0.000000, bitrate: 17781 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661),
yuv420p, 852x754, 17779 kb/s, 24 fps, 24 tbr, 24k tbn, 48k tbc (default)
Metadata:
handler_name : VideoHandler