
Recherche avancée
Médias (3)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (29)
-
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 -
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 -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...)
Sur d’autres sites (3552)
-
Build ffmpeg on a build machine
18 juillet 2019, par RDIBuild ffmpeg on build PC using libx264 and shared libraries (not static).
I am building on a Red Hat 6.6 Server and final target machine is CentOS 6.6.
I am trying, as said, to build ffmpeg with encoding enabled (with libx264) and shared libraries ; of course I do not want to install the libraries on the build PC, they should be only extracted and then delivered together with the final RPM.
After the "./configure" I get all RPMs (related to ffmpeg) but when trying to installing ffmpeg-libs on the build pc it fails because the libx264.so.157 is not found, even if as test I installed it (configure/make/make install) and present at /usr/local/lib.Where am I wrong ?
Thanks
This is my SPEC file at the moment :
ldconfig /usr/local/lib
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# configure
./configure \
--enable-gpl --disable-static --enable-shared --extra-cflags="-I/usr/local/include" --extra-ldflags="-L/usr/local/lib" --extra-libs=-ldl --disable-autodetect --disable-doc --disable-postproc --disable-ffplay --disable-everything --enable-encoder=aac --enable-encoder=png --enable-encoder=mjpeg --enable-encoder=libx264 --enable-decoder=aac --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=rawvideo --enable-decoder=png --enable-muxer=mp4 --enable-muxer=stream_segment --enable-muxer=image2 --enable-demuxer=aac --enable-demuxer=h264 --enable-demuxer=mov --enable-demuxer=rtp --enable-parser=aac --enable-parser=h264 --enable-parser=mpeg4video --enable-bsf=aac_adtstoasc --enable-protocol=file --enable-protocol=http --enable-protocol=tcp --enable-protocol=rtp --enable-protocol=udp --enable-indev=xcbgrab --disable-alsa --enable-libxcb --enable-libxcb-xfixes --enable-libxcb-shape --enable-zlib --prefix=%{_prefix} --bindir=%{_bindir} --datadir=%{_datadir}/%{name} --shlibdir=%{_libdir} --enable-alsa --enable-avfilter --enable-avresample --enable-libx264 --enable-filter=scale \ -
Decode audio using ffmpeg (packet-by-packet) in Java
27 mai 2022, par quad478In my application, I receive an audio stream from an IP-camera via RTP using NETTY.
The stream from IP-camera comes in the "G.711 mulaw" format, I would like to recode it to the "AAC" format.
I can't use files in this task as it's a live stream, and each packet needs to be decoded and delivered to the client (browser) immediately.
For this task, I wanted to use the ffmpeg child process :
when connecting to the camera, create a ffmpeg process and send to stdin (ffmpeg) each received packet, then I would like to receive the decoded packet from stdout.
Here is the command I run ffmeg with :


"ffmpeg.exe -f mulaw -re -i - -f adts -"



I'm not sure if "-re" should be used here, but without this option, ffmpeg outputs the decode result only after stdin is closed and the process exits.
The problem is that I don't get anything on stdout after sending the packet to ffmpeg.


Decoder code :


package ru.ngslab.insentry.web.video.protocols.rtp;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;

import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class RtpFfmpegDecoder extends MessageToMessageDecoder<rtppacket> implements Closeable {

 private final Process ffmegProcess;
 private final OutputStream ffmpegOutput;
 private final InputStream ffmegInput;
 private final ExecutorService ffmpegInputReaderService = Executors.newSingleThreadExecutor();

 public RtpFfmpegDecoder() {

 //Start Ffmpeg process
 ProcessBuilder ffmpegBuilder = new ProcessBuilder("ffmpeg.exe", "-f", "mulaw",
 "-re", "-i", "-", "-f", "adts", "-").redirectError(ProcessBuilder.Redirect.INHERIT);
 try {
 ffmegProcess = ffmpegBuilder.start();
 ffmpegOutput = ffmegProcess.getOutputStream();
 ffmegInput = ffmegProcess.getInputStream();
 } catch (IOException e) {
 throw new IllegalStateException(e);
 }
 }

 @Override
 protected void decode(ChannelHandlerContext channelHandlerContext, RtpPacket rtpPacket, List list) throws Exception {

 //start read ffmpeg output in another thread
 Future future = ffmpegInputReaderService.submit(this::startReadFFmpegOutput);

 //write rtp- packet bytes to ffmpeg-input
 ByteBuf data = rtpPacket.getData();
 byte[] rtpData = new byte[data.readableBytes()];
 data.getBytes(data.readerIndex(), rtpData);
 ffmpegOutput.write(rtpData);
 ffmpegOutput.flush();

 //waiting here for the decoding result from ffmpeg
 //blocks here
 byte[] result = future.get();
 //then process result...
 }

 private byte[] startReadFFmpegOutput() {
 try {
 //I don't know how many bytes to expect here, for test purposes I use 1024
 var bytes = new byte[1024];
 ffmegInput.read(bytes);
 return bytes;
 } catch (IOException e) {
 throw new IllegalStateException(e);
 }
 }

 @Override
 public void close() throws IOException {
 //Close streams code...
 }
}
</rtppacket>


This doesn't work because ffmpeg doesn't send anything after receiving the packet.
No errors in log, no output data.
Just wait for result here :


byte[] result = future.get();



Normally, ffmpeg only outputs after stdin is closed and the process stops.
It may be necessary to run ffmpeg with some special
parameters so that it outputs each received packet at once ?


I would be very grateful for any help


-
Android FFMPEG : images to mp4 video converting
19 juillet 2017, par Giorgi AsaturyanI have tried many possible command line options with ffmpeg, however not getting this to work. Heres is my command file generator method :
private String[] generateCommandFile() {
ArrayList<string> cmd = new ArrayList<>();
cmd.add("-y");
cmd.add("-f");
cmd.add("concat");
cmd.add("-safe");
cmd.add("0");
cmd.add("-i");
String picturesTextFile = generateMergingFilesTexts();
if (picturesTextFile == null) {
return null;
}
cmd.add(picturesTextFile);
cmd.add("-i");
String audioTextFile;
if (numberOfAudioFiles > 1) {
audioTextFile = generateAudioFilesTexts();
} else {
audioTextFile = getAudioFilePath(audioRecordingFileName + Integer.toString(1));
}
cmd.add(audioTextFile);
cmd.add("-vsync");
cmd.add("vfr");
cmd.add("-pix_fmt");
cmd.add("yuv420p");
String currentDateTimeString = new SimpleDateFormat("dd MMMM yyyy", Locale.US).format(Calendar.getInstance().getTime());
File dirOut = new File(this.getExternalFilesDir(null), "D:T:" + currentDateTimeString);
if (!dirOut.exists()) {
dirOut.mkdirs();
}
directoryPath = dirOut.getAbsolutePath();
File fileOut = new File(dirOut, "T__" + Long.toString(totalTime) + "__P__" + Integer.toString(picturesModelInfo.getNumberOfShots()) + ".mp4");
cmd.add(fileOut.getAbsolutePath());
Log.d(TAG, "Saving File At " + fileOut.getAbsolutePath());
String[] finalCommand = new String[cmd.size()];
for (int i = 0; i < cmd.size(); i++) {
finalCommand[i] = cmd.get(i);
}
String finalString = "";
for (String command : finalCommand) {
finalString += command;
}
Log.d(TAG, "Final Command Is " + finalString);
return finalCommand;
}
</string>and here is my Final Command
-y-fconcat-safe0-i/storage/emulated/0/Android/data/com.essentialsln.memtalk/files/pictures_merging.txt-i/storage/emulated/0/Android/data/com.essentialsln.memtalk/files/AudioRecording1.3gp-vsyncvfr-pix_fmtyuv420p/storage/emulated/0/Android/data/com.essentialsln.memtalk/files/D:T:19 July 2017/T__2__P__3.mp4
The main problem is that video not playing in android default player - displays ("Cannot Play video, unsupported file type"), but it works with VLC program. ))
Anu Suggestions ?
Thanks