Recherche avancée

Médias (21)

Mot : - Tags -/Nine Inch Nails

Autres articles (37)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP 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" (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (7425)

  • Decode audio using ffmpeg (packet-by-packet) in Java

    27 mai 2022, par quad478

    In 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;&#xA;&#xA;import io.netty.buffer.ByteBuf;&#xA;import io.netty.channel.ChannelHandlerContext;&#xA;import io.netty.handler.codec.MessageToMessageDecoder;&#xA;&#xA;import java.io.Closeable;&#xA;import java.io.IOException;&#xA;import java.io.InputStream;&#xA;import java.io.OutputStream;&#xA;import java.util.List;&#xA;import java.util.concurrent.ExecutorService;&#xA;import java.util.concurrent.Executors;&#xA;import java.util.concurrent.Future;&#xA;&#xA;public class RtpFfmpegDecoder extends MessageToMessageDecoder<rtppacket> implements Closeable {&#xA;&#xA;    private final Process ffmegProcess;&#xA;    private final OutputStream ffmpegOutput;&#xA;    private final InputStream ffmegInput;&#xA;    private final ExecutorService ffmpegInputReaderService = Executors.newSingleThreadExecutor();&#xA;&#xA;    public RtpFfmpegDecoder() {&#xA;&#xA;        //Start Ffmpeg process&#xA;        ProcessBuilder ffmpegBuilder = new ProcessBuilder("ffmpeg.exe", "-f", "mulaw",&#xA;                "-re", "-i", "-", "-f", "adts", "-").redirectError(ProcessBuilder.Redirect.INHERIT);&#xA;        try {&#xA;            ffmegProcess = ffmpegBuilder.start();&#xA;            ffmpegOutput = ffmegProcess.getOutputStream();&#xA;            ffmegInput = ffmegProcess.getInputStream();&#xA;        } catch (IOException e) {&#xA;            throw new IllegalStateException(e);&#xA;        }&#xA;    }&#xA;&#xA;    @Override&#xA;    protected void decode(ChannelHandlerContext channelHandlerContext, RtpPacket rtpPacket, List list) throws Exception {&#xA;&#xA;        //start read ffmpeg output in another thread&#xA;        Future future = ffmpegInputReaderService.submit(this::startReadFFmpegOutput);&#xA;&#xA;        //write rtp- packet bytes to ffmpeg-input&#xA;        ByteBuf data = rtpPacket.getData();&#xA;        byte[] rtpData = new byte[data.readableBytes()];&#xA;        data.getBytes(data.readerIndex(), rtpData);&#xA;        ffmpegOutput.write(rtpData);&#xA;        ffmpegOutput.flush();&#xA;&#xA;        //waiting here for the decoding result from ffmpeg&#xA;        //blocks here&#xA;        byte[] result = future.get();&#xA;        //then process result...&#xA;    }&#xA;&#xA;    private byte[] startReadFFmpegOutput() {&#xA;        try {&#xA;            //I don&#x27;t know how many bytes to expect here, for test purposes I use 1024&#xA;            var bytes = new byte[1024];&#xA;            ffmegInput.read(bytes);&#xA;            return bytes;&#xA;        } catch (IOException e) {&#xA;            throw new IllegalStateException(e);&#xA;        }&#xA;    }&#xA;&#xA;    @Override&#xA;    public void close() throws IOException {&#xA;        //Close streams code...&#xA;    }&#xA;}&#xA;</rtppacket>

    &#xA;

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

    &#xA;

    byte[] result = future.get();&#xA;

    &#xA;

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

    &#xA;

    I would be very grateful for any help

    &#xA;

  • Android FFMPEG : images to mp4 video converting

    19 juillet 2017, par Giorgi Asaturyan

    I 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&lt;>();

       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 &lt; 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

  • Repeat/loop the video till audio file using ffmpeg

    18 mars 2014, par M. Usman Afzal

    I am using this command to generate the video from silent video and audio but the problem is video is 3 sec and audio is 20 sec and final video generating is 20 sec but video is for 3 sec and the last frame of that video is repeat till end.

    ffmpeg -i v.mp4 -i a.m4a -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 output.mp4

    I just want to repeat the whole video