Recherche avancée

Médias (0)

Mot : - Tags -/médias

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (78)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le 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 (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

Sur d’autres sites (9056)

  • Using FFMPEG for Bidirectional Voice Communication with Symmetric RTP

    3 février 2024, par Batuhan Öksüz

    I am trying to make a voice communication between two peers. The first peer is my local machine which is behind a symmetric NAT. The second peer is my server running on an AWS EC2 device which has a public IP address. I want to use FFMPEG for sending the audio stream through RTP while at the same time listening to a known port to receive the audio stream the remote peer sends to my device. In order to not deal with NAT traversal issues, I want to be able to use the same IP address and port number I use for sending on my local device for receiving. Is this plausible ? I'm starting to think that this is not possible and here is my rationale :

    


      

    • If my understanding is correct UDP doesn't allow full-duplex communication ; that is, one cannot use one IP:port pair for both sending and receiving data packets at the same time. Is that correct ?
    • 


    • If one wants to bind a socket that is already been bound, the function throws a bind error saying "Address already in use.". I figured there is a UDP option to allow binding to the same port or address even if they are in use. These options are namely SO_REUSEADDR and SO_REUSEPORT. However, this page states that it is only possible if the port is in TIME_WAIT state. So this also supports my suspicion.
    • 


    


    On the other hand, there is symmetric RTP that clearly states a device can receive RTP streams from an address and port that it simultaneously uses to transmit RTP streams from. With exact words of the RFC :

    


    


    A device supports symmetric RTP if it selects, communicates, and uses
IP addresses and port numbers such that, when receiving a
bidirectional RTP media stream on UDP port "A" and IP address "a", it
also transmits RTP media for that stream from the same source UDP
port "A" and IP address "a". That is, it uses the same UDP port to
transmit and receive one RTP stream.

    


    


    


    A device that doesn't support symmetric RTP would transmit RTP from a
different port, or from a different IP address, than the port and IP
address used to receive RTP for that bidirectional media steam.

    


    


    So this is where I get confused. Is symmetric RTP somehow works around the limitations of UDP ? How am I getting this wrong ?

    


    Now going back to FFMPEG and the use of symmetric RTP, I see there is an rtp option we can use to set it up, the so called localrtpport=n. I can find almost no explanation to what it does and how it's useful though. Can anyone help me with that ? As far as I can tell, this option tells FFMPEG to use port "n" as the outbound port when transmitting an RTP stream. So if the receiver transmitted its stream to this port then the problem of symmetric NAT requirement would be resolved. Or so I thought...

    


    To draw you a better picture, here are my FFMPEG commands (I'm trying everything in my local host in these commands) :

    


    # My Mac with en0 IP of 192.168.1.64
ffmpeg \
-hide_banner \
-re \
-fflags +genpts \
-f lavfi -i aevalsrc="sin(400*2*PI*t)" \
-ar 8000 \
-f mulaw \
-f rtp -reuse 1 "rtp://192.168.1.72:9193?reuse=1&localrtpport=16386&localrtcpport=16387" \
-protocol_whitelist udp,rtp \
-i rtp://192.168.1.64:16386 \
audio_signal_with_symmetric_rtp.mp3


    


    Here I am simply generating a fixed sound signal and outputting it in mulaw format through rtp. I am using the 'localrtport' option to set my outbound port and I am expecting to receive the remote peer's stream on the same port. This command starts running and and waits for the incoming stream. As soon as I start transmitting the stream from my Raspberry Pi which is on the same wireless network, I get the dreaded "Address already in use." error and the process terminates. Here is the command I use on the Raspberry :

    


    # My Raspberry Pi with wlan0 IP of 192.168.1.72
ffmpeg \
-hide_banner \
-re \
-f lavfi -i aevalsrc="sin(400*2*PI*t)" \
-ar 8000 \
-f mulaw \
-f rtp "rtp://192.168.1.64:16386?reuse=1&localrtpport=16386"


    


    TLDR

    


    The short form of the question comes down to this : How can I make use of symmetric RTP with FFMPEG, receive a stream from the same port I am actively transmitting another stream from ? Is what I'm asking impossible ? Should I go for an alternate route and try to set up a TURN server for my system ? Any help would be appreciated.

    


  • FFmpeg - cannot find ExecuteBinaryResponseHandler - Android/Java

    20 juillet 2018, par pudility

    I am trying to make a module for react-native that will change a video into a gif. I have little to no experience with android studios/java, but I would love to learn more ! I am using this library to convert the video to a gif. Here is my code :

    package com.reactlibrary;

    import android.widget.Toast;
    import com.facebook.react.bridge.ReactApplicationContext;
    import com.facebook.react.bridge.ReactContextBaseJavaModule;
    import com.facebook.react.bridge.ReactMethod;
    import com.github.hiteshsondhi88.libffmpeg.FFmpeg;

    public class RNGifMakerModule extends ReactContextBaseJavaModule {

     private final ReactApplicationContext reactContext;

     public RNGifMakerModule(ReactApplicationContext reactContext) {
       super(reactContext);
       this.reactContext = reactContext;
     }

     @Override
     public String getName() {
       return "RNGifMakerModule";
     }

     @ReactMethod
     public void alert(String message) {
         Toast.makeText(getReactApplicationContext(), "Error", Toast.LENGTH_LONG).show();
         String[] cmd = {"-i"
                 , message
                 , "Image.gif"};
         conversion(cmd);
     }

     public void conversion(String[] cmd) {

       FFmpeg ffmpeg = FFmpeg.getInstance(this.reactContext);

       try {


         // to execute "ffmpeg -version" command you just need to pass "-version"
         ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {

           @Override
           public void onStart() {
           }

           @Override
           public void onProgress(String message) {
           }

           @Override
           public void onFailure(String message) {
           }

           @Override
           public void onSuccess(String message) {
           }

           @Override
           public void onFinish() {
           }
         });
       } catch (FFmpegCommandAlreadyRunningException e) {
         // Handle if FFmpeg is already running
         e.printStackTrace();
       }
     }
    }

    And I get this error :

    Error:(43, 31) error: cannot find symbol class ExecuteBinaryResponseHandler

    This seems odd to be, because in the documentation for ffmpeg-android-java it says to use almost exactly the same code.

    Bounty

    The bounty will be awarded to you if you can find a way to convert a video.mp4 into a gif. You do not necessarily have to use FFmpeg, but your solution has to work with java/android studios.

  • batch store %%f as variable

    22 juin 2017, par RyanMe321

    I’ve been trying to use %%f to operate a script on each file in a directory however however when referencing it through the script the %%f and %% nf don’t seem to be working. I’ve limited programming experience I’m trying to make a more useful version of this video formatting tutorial.

    So I’d like to store %%f and %% nf as variables to reference for the rest of the script though I can’t work out how.

    @echo off
    set /p FORMAT="Enter File Format: "
    FOR %%f IN (*.%FORMAT%) DO  echo %%f
    set TEST=%%f
    echo %TEST%
    cmd/k

    If I could store these it would resolve my issue, however this is the longer form of what I’m trying to do, this script works if I have the user enter the file manually into a variable (%VIDEO%=%%f and % nf). Though this is far from ideal.

    @echo off
    set /p FORMAT="Enter File Format: "

    FOR %%f IN (*.%FORMAT%) DO (
    ::IDFILE
    for /F "delims=" %%I in ('C:\ffmpeg\bin\ffprobe.exe -v error -show_entries format^=filename -of default^=noprint_wrappers^=1:nokey^=1 "%%f"') do set "FILENAME=%%I"

    for /F "delims=" %%I in ('C:\ffmpeg\bin\ffprobe.exe -v error -select_streams v:0 -show_entries stream^=codec_name -of default^=noprint_wrappers^=1:nokey^=1 "%%f"') do set "Vcodec=%%I"

    for /F "delims=" %%I in ('C:\ffmpeg\bin\ffprobe.exe -v error -select_streams a:0 -show_entries stream^=codec_name -of default^=noprint_wrappers^=1:nokey^=1 "%%f"') do set "Acodec=%%I"

    echo %FILENAME% is using %Vcodec% and %Acodec% codecs

    if %Vcodec% == h264 (echo DO NOT CONVERT VIDEO) else (echo CONVERT VIDEO)
    if %Acodec% == ac3 (echo DO NOT CONVERT AUDIO) else (echo CONVERT AUDIO)
    timeout /t 5

    :: COPY V FIX A
    if %Vcodec% == h264 if not %Acodec% == ac3 (echo Copying Video, Converting Audio
    timeout /t 5
    C:\ffmpeg\bin\ffmpeg.exe -i "%%f" -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640K "%%~nf"-AC3.mkv)

    :: FIX V COPY A
    if not %Vcodec% == h264 if  %Acodec% == ac3 (echo Converting Video, Copying Audio
    timeout /t 5
    C:\ffmpeg\bin\ffmpeg.exe -i "%%f" -map 0 -vcodec libx264 -scodec copy -acodec copy "%%~nf-"h264.mkv)

    :: FIX V FIX A
    if not %Vcodec% == h264 if not %Acodec% == ac3 (echo Converting Video, Converting Audio
    timeout /t 5
    C:\ffmpeg\bin\ffmpeg.exe -i "%%f" -map 0 -vcodec libx264 -scodec copy -acodec ac3 -b:a 640K "%%~nf"-h264-AC3.mkv)

    :: COPY V COPY A
    if %Vcodec% == h264 if %Acodec% == ac3 (echo "Doesn't require any Conversion")
    )
    pause
    cmd/k