Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (54)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

Sur d’autres sites (5604)

  • VLC RTSP HTML5 transcoding

    30 mai 2022, par Pierogi

    I'm trying to get audio streaming on an HTML page from an RTSP server.

    


    The RTSP server is the rtsp-simple-server running a command line below.
    
./rtsp-simple-server rtsp-simple-server.yml.
    
The configure file is the default.

    


    The stream player is FFmpeg running a command line below.
    
ffmpeg -re -stream_loop -1 -i myaudio.mp3 -c copy -f rtsp -rtsp_transport tcp rtsp://localhost:8554/mystream

    


    The console log at the time the rtsp-simple-server and the ffmpeg are started is below.

    


    2022/05/29 19:06:38 INF rtsp-simple-server v0.18.4
2022/05/29 19:06:38 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2022/05/29 19:06:38 INF [RTMP] listener opened on :1935
2022/05/29 19:06:38 INF [HLS] listener opened on :8888
2022/05/29 19:09:16 INF [RTSP] [conn [::1]:62737] opened
2022/05/29 19:09:16 INF [RTSP] [session 271690815] created by [::1]:62737
2022/05/29 19:09:16 INF [RTSP] [session 271690815] is publishing to path 'mystream', 1 track with TCP


    


    And the time the rtsp path(rtsp ://localhost:8554/mystream) is opened by VLC, the contents can be played properly. The additional console log at the time is below.

    


    2022/05/29 19:13:19 INF [RTSP] [conn 127.0.0.1:62780] opened
2022/05/29 19:13:19 INF [RTSP] [session 734209460] created by 127.0.0.1:62780
2022/05/29 19:13:19 INF [RTSP] [session 734209460] is reading from path 'mystream', 1 track with UDP
2022/05/29 19:13:29 INF [RTSP] [session 734209460] destroyed (teared down by 127.0.0.1:62780)
2022/05/29 19:13:29 INF [RTSP] [conn 127.0.0.1:62780] closed (EOF)
2022/05/29 19:13:29 INF [RTSP] [conn 127.0.0.1:62781] opened
2022/05/29 19:13:29 INF [RTSP] [session 445756113] created by 127.0.0.1:62781
2022/05/29 19:13:29 INF [RTSP] [session 445756113] is reading from path 'mystream', 1 track with TCP


    


    However, I open the rtsp streaming from the VLC's "Network" tab like below,
enter image description here

    


    and configure the "Stream output" like below,
enter image description here

    


    and I tried to get this streaming from an HTML page like below,

    


    &#xA;&#xA;  &#xA;    &#xA;    &#xA;  &#xA;  &#xA;    <h1>transcode test</h1>&#xA;    <audio src="http://localhost:9999/mystream" autoplay="autoplay"></audio>&#xA;  &#xA;&#xA;

    &#xA;

    the browser console displays Failed to load resource: the server responded with a status of 404 (Not found). I've already tried other ports(etc. 8080).

    &#xA;

    So, how can I get the rtsp stream from the RTSP server on an HTML page.&#xA;Any idea ?

    &#xA;

    My environment.

    &#xA;

      &#xA;
    • Browser : Microsoft edge
    • &#xA;

    • OS : MacOS 11.6.5
    • &#xA;

    • rtsp-simple-server : 0.18.4
    • &#xA;

    • FFmpeg : 5.0.1
    • &#xA;

    • VLC : 3.0.17.3
    • &#xA;

    &#xA;

  • How can I convert a mp4 file to webm using java only ?

    31 octobre 2023, par mir-shakir

    I am trying to convert a file from mp4 to webm. I am trying to use the JAVE wrapper of FFmpeg. I am getting the error.&#xA;Here is my code :

    &#xA;

    private String ConvertVideo(URL url) {&#xA;    File target =null;&#xA;    MultimediaObject multimediaObject = new MultimediaObject(url);&#xA;    try {&#xA;        target = File.createTempFile("target", ".webm");&#xA;&#xA;    } catch (IOException e1) {&#xA;        e1.printStackTrace();&#xA;    }&#xA;    AudioAttributes audio = new AudioAttributes();&#xA;    audio.setCodec(AudioAttributes.DIRECT_STREAM_COPY);&#xA;    audio.setBitRate(new Integer(128000));&#xA;    audio.setSamplingRate(new Integer(44100));&#xA;    audio.setChannels(new Integer(2));&#xA;    VideoAttributes video = new VideoAttributes();&#xA;    video.setBitRate(new Integer(160000));&#xA;    video.setFrameRate(new Integer(15));&#xA;    video.setCodec("libvpx-vp9");&#xA;    video.setCodec(VideoAttributes.DIRECT_STREAM_COPY);&#xA;    EncodingAttributes attrs = new EncodingAttributes();&#xA;    attrs.setFormat("webm");&#xA;    attrs.setAudioAttributes(audio);&#xA;    attrs.setVideoAttributes(video);&#xA;    &#xA;    try {&#xA;          Encoder encoder = new Encoder();  &#xA;          encoder.encode(multimediaObject, target, attrs);&#xA;        } catch (Exception e) {  &#xA;           e.printStackTrace();&#xA;        }&#xA;    &#xA;    return "success";&#xA;}&#xA;

    &#xA;

    I am getting the below error :

    &#xA;

    2022-Jun-13 11:12:55 AM [qtp1914526580-175] ERROR ws.schild.jave.Encoder - Process exit code: 1  to target2636257785060285182.webm&#xA;ws.schild.jave.EncoderException: Exit code of ffmpeg encoding run is 1&#xA;

    &#xA;

    What am I doing wrong here. Is there any other way around it ? I want to do it only using java.

    &#xA;

  • ProcessBuilder is not called when trying to start a process

    15 juin 2022, par xnok

    I am trying to understand more about the ffmpeg usage in JavaCV for android studio and for said task I am trying to use ProcessBuilder. I tried writting a simple program to debug the pb.start(); Although, I am not getting a response. What I did was to start a default/empty activity and pasted the following program :

    &#xA;

    package com.example.myapplication;&#xA;&#xA;import androidx.annotation.RequiresApi;&#xA;import androidx.appcompat.app.AppCompatActivity;&#xA;import java.io.BufferedReader;&#xA;import java.io.IOException;&#xA;import java.io.InputStreamReader;&#xA;import java.io.OutputStream;&#xA;&#xA;import org.bytedeco.javacpp.Loader;&#xA;&#xA;import android.os.Build;&#xA;import android.os.Bundle;&#xA;import android.util.Log;&#xA;&#xA;public class MainActivity extends AppCompatActivity {&#xA;    static final int cols = 192;&#xA;    static final int rows = 108;&#xA;    static final String ffmpeg = Loader.load(org.bytedeco.ffmpeg.ffmpeg.class);&#xA;    static final String rtmp_url = "test.flv";&#xA;    static final String[] command = {ffmpeg,&#xA;            "-y",&#xA;            "-f", "rawvideo",&#xA;            "-vcodec", "rawvideo",&#xA;            "-pix_fmt", "bgr24",&#xA;            "-s", (Integer.toString(cols) &#x2B; "x" &#x2B; Integer.toString(rows)),&#xA;            "-r", "10",&#xA;            "-i", "pipe:",&#xA;            "-c:v", "libx264",&#xA;            "-pix_fmt", "yuv420p",&#xA;            "-preset", "ultrafast",&#xA;            "-f", "flv",&#xA;            rtmp_url};&#xA;    @RequiresApi(api = Build.VERSION_CODES.O)&#xA;    @Override&#xA;    protected void onCreate(Bundle savedInstanceState) {&#xA;        super.onCreate(savedInstanceState);&#xA;        setContentView(R.layout.activity_main);&#xA;        new Thread(t1).start();&#xA;&#xA;    }&#xA;    private static Runnable t1 = () -> {&#xA;        Log.e("TAG", "void OnCreate called successfully!");&#xA;        ProcessBuilder pb = new ProcessBuilder(command).redirectErrorStream(true);&#xA;        pb.redirectErrorStream(true);&#xA;        try {&#xA;            Process process = pb.start();&#xA;            BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));&#xA;            OutputStream writer = process.getOutputStream();&#xA;            Log.e("TAG", "Something good happened here");&#xA;        } catch (IOException e) {&#xA;            e.printStackTrace();&#xA;            Log.e("TAG", "Nothing good happened here");&#xA;        }&#xA;    };&#xA;&#xA;&#xA;}&#xA;

    &#xA;

    My current problem is that I can't seem to start properly the processBuilder process via pb.start() ;

    &#xA;

    I get the following logs from the logcat panel :

    &#xA;

    2022-06-14 17:24:46.328 13371-13371/com.example.myapplication E/TAG: void OnCreate called successfully!&#xA;2022-06-14 17:24:46.333 13371-13371/com.example.myapplication E/TAG: Nothing good happened here&#xA;

    &#xA;

    I'd like to understand why is it skipping the try/catch block and not starting the process ?

    &#xA;

    EDIT : I made some changes as per @g00se's suggestions and I got the following stack trace from the code above :

    &#xA;

    2022-06-15 00:32:26.700 29787-29787/? E/USNET: USNET: appName: com.example.myapplication&#xA;2022-06-15 00:32:29.328 29787-29828/com.example.myapplication E/TAG: void OnCreate called successfully!&#xA;2022-06-15 00:32:29.330 29787-29828/com.example.myapplication E/AndroidRuntime: FATAL EXCEPTION: Thread-4&#xA;    Process: com.example.myapplication, PID: 29787&#xA;    java.lang.NullPointerException&#xA;        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1012)&#xA;        at com.example.myapplication.MainActivity.lambda$static$0(MainActivity.java:48)&#xA;        at com.example.myapplication.MainActivity$$ExternalSyntheticLambda0.run(Unknown Source:0)&#xA;        at java.lang.Thread.run(Thread.java:920)&#xA;

    &#xA;