Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

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

Autres articles (65)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (6501)

  • How to programmatically read an audio RTP stream using javacv and ffmpeg ?

    21 mai 2019, par Chris

    I am trying to read an audio RTP stream coming from ffmpeg in command line using javaCV. I create a DatagramSocket that listens to a specified port but can’t get the audio frames.

    I have tried with different types of buffer to play the audio to my speakers but I am getting a lot of "Invalid return value 0 for stream protocol" error messages with no audio in my speakers.

    I am running the following command to stream an audio file :

    ffmpeg -re -i /some/file.wav -ar 44100 -f mulaw -f rtp rtp ://127.0.0.1:7780

    And an excerpt of my code so far :

    public class FrameGrabber implements Runnable

    private static final TimeUnit SECONDS = TimeUnit.SECONDS;
    private InetAddress ipAddress;
    private DatagramSocket serverSocket;

    public FrameGrabber(Integer port) throws UnknownHostException, SocketException {
       super();

       this.ipAddress = InetAddress.getByName("192.168.44.18");
       serverSocket = new DatagramSocket(port, ipAddress);

    }

    public AudioFormat getAudioFormat() {
       float sampleRate = 44100.0F;
       // 8000,11025,16000,22050,44100
       int sampleSizeInBits = 16;
       // 8,16
       int channels = 1;
       // 1,2
       boolean signed = true;
       // true,false
       boolean bigEndian = false;
       // true,false
       return new AudioFormat(sampleRate, sampleSizeInBits, channels, signed, bigEndian);
    }

    @Override
    public void run() {


       byte[] buffer = new byte[2048];
       DatagramPacket packet = new DatagramPacket(buffer, buffer.length);

       DataInputStream dis = new DataInputStream(new ByteArrayInputStream(packet.getData(), packet.getOffset(), packet.getLength()));


       FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(dis);
       grabber.setFormat("mulaw");
       grabber.setSampleRate((int) getAudioFormat().getSampleRate());
       grabber.setAudioChannels(getAudioFormat().getChannels());

       SourceDataLine soundLine = null;


       try {
           grabber.start();


           if (grabber.getSampleRate() > 0 && grabber.getAudioChannels() > 0) {

               AudioFormat audioFormat = new AudioFormat(grabber.getSampleRate(), 16, grabber.getAudioChannels(), true, true);

               DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);
               soundLine = (SourceDataLine) AudioSystem.getLine(info);
               soundLine.open(audioFormat);

               soundLine.start();
           }

           ExecutorService executor = Executors.newSingleThreadExecutor();


           while (true) {

               try {
                   serverSocket.receive(packet);
               } catch (IOException e) {
                   e.printStackTrace();
               }

               Frame frame = grabber.grab();

               //if (frame == null) break;


               if (frame != null && frame.samples != null) {

                   ShortBuffer channelSamplesFloatBuffer = (ShortBuffer) frame.samples[0];
                   channelSamplesFloatBuffer.rewind();

                   ByteBuffer outBuffer = ByteBuffer.allocate(channelSamplesFloatBuffer.capacity() * 2);
                   float[] samples = new float[channelSamplesFloatBuffer.capacity()];

                   for (int i = 0; i < channelSamplesFloatBuffer.capacity(); i++) {
                       short val = channelSamplesFloatBuffer.get(i);
                       outBuffer.putShort(val);
                   }

                   if (soundLine == null) return;
                   try {
                       SourceDataLine finalSoundLine = soundLine;
                       executor.submit(() -> {
                           finalSoundLine.write(outBuffer.array(), 0, outBuffer.capacity());
                           outBuffer.clear();
                       }).get();
                   } catch (InterruptedException interruptedException) {
                       Thread.currentThread().interrupt();
                   }
               }

           }

           /*
           executor.shutdownNow();
           executor.awaitTermination(1, SECONDS);

           if (soundLine != null) {
               soundLine.stop();
           }

           grabber.stop();
           grabber.release();*/

           } catch (ExecutionException ex) {
           System.out.println("ExecutionException");
           ex.printStackTrace();
       } catch (org.bytedeco.javacv.FrameGrabber.Exception ex) {
           System.out.println("FrameGrabberException");
           ex.printStackTrace();
       } catch (LineUnavailableException ex) {
           System.out.println("LineUnavailableException");
           ex.printStackTrace();
       }/* catch (InterruptedException e) {
           System.out.println("InterruptedException");
           e.printStackTrace();
       }*/


    }

    public static void main(String[] args) throws SocketException, UnknownHostException {
       Runnable apRunnable = new FrameGrabber(7780);
       Thread ap = new Thread(apRunnable);
       ap.start();
    }

    At this stage, I am trying to play the audio file in my speakers but I am getting the following logs :

    Task :FrameGrabber.main()
    Invalid return value 0 for stream protocol
    Invalid return value 0 for stream protocol
    Input #0, mulaw, from ’java.io.DataInputStream@474e6cea’ :
    Duration : N/A, bitrate : 352 kb/s
    Stream #0:0 : Audio : pcm_mulaw, 44100 Hz, 1 channels, s16, 352 kb/s
    Invalid return value 0 for stream protocol
    Invalid return value 0 for stream protocol
    Invalid return value 0 for stream protocol
    Invalid return value 0 for stream protocol
    ...

    What am I doing wrong ?

    Thanks in advance !

  • java.lang.UnsatisfiedLinkError : org.bytedeco.javacpp.avutil in start FFmpegFrameGrabber

    27 février 2018, par Ashish Virani

    i have creating slowmotion video app in android and i can try to set video motion speed in any start and ending postion in total video length.

    but some error occur in start FFmpegFrameGrabber.

    here my code :

    private class PrepareMedia extends AsyncTask {
       private PrepareMedia() {
       }

       protected Void doInBackground(Void... params) {
           FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(viewSource);
           try {
               grabber.start();
               grabber.stop();
               grabber.release();
           } catch (Exception e) {
               Log.e(TAG, "doInBackground: ");
           }
           return null;
       }
    }

    view my error.

    01-12 15:59:16.374 14990-14990/com.example.slowmotiondemo E/AndroidRuntime: FATAL EXCEPTION: main
       Process: com.example.slowmotiondemo, PID: 14990
       java.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.avutil
           at java.lang.Class.classForName(Native Method)
           at java.lang.Class.forName(Class.java:324)
           at org.bytedeco.javacpp.Loader.load(Loader.java:585)
           at org.bytedeco.javacpp.Loader.load(Loader.java:530)
           at org.bytedeco.javacpp.avformat$AVFormatContext.<clinit>(avformat.java:2819)
           at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:468)
           at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:462)
           at com.example.slowmotiondemo.ActivityCutMergeVideo.prepareMediaForOreantation(ActivityCutMergeVideo.java:687)
           at com.example.slowmotiondemo.ActivityCutMergeVideo.onCreate(ActivityCutMergeVideo.java:507)
           at android.app.Activity.performCreate(Activity.java:6904)
           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
           at android.app.ActivityThread.access$1100(ActivityThread.java:229)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
           at android.os.Handler.dispatchMessage(Handler.java:102)
           at android.os.Looper.loop(Looper.java:148)
           at android.app.ActivityThread.main(ActivityThread.java:7331)
           at java.lang.reflect.Method.invoke(Native Method)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    </clinit>

    please tell me how to solve error.

  • Script doesnt recognize bars / length right for cutting audio , ffmpeg terminal

    14 avril 2024, par totzillarbeats

    This terminal script doesn't recognize bars / length right for cutting audio, maybe somebody knows what's wrong with the calculation ...

    &#xA;

    Would be happy about any help the cutting already works !

    &#xA;

    #!/bin/bash&#xA;&#xA;# Function to extract BPM from filename&#xA;&#xA;get_bpm() {&#xA;    local filename="$1"&#xA;    local bpm=$(echo "$filename" | grep -oE &#x27;[0-9]{1,3}&#x27; | head -n1)&#xA;    echo "$bpm"&#xA;}&#xA;&#xA;# Function to cut audio based on BPM&#xA;cut_audio() {&#xA;    local input_file="$1"&#xA;    local bpm="$2"&#xA;    local output_file="${input_file%.*}_cut.${input_file##*.}" # Appends "_cut" to original filename&#xA;&#xA;    # Define the number of beats per bar (assuming 4 beats per bar)&#xA;    beats_per_bar=4&#xA;&#xA;    # Calculate the duration of each bar in seconds&#xA;    bar_duration=$((60 * beats_per_bar / bpm))&#xA;&#xA;    # Define start and end times for each bar range&#xA;    start_times=(0 21 33 45 57 69 81 93 105 117 129 141)&#xA;    end_times=(20 29 41 53 65 77 89 101 113 125 137 149)&#xA;&#xA;    # Iterate through each bar range&#xA;    for ((i = 0; i &lt; ${#start_times[@]}; i&#x2B;&#x2B;)); do&#xA;        start_time=${start_times[$i]}&#xA;        end_time=${end_times[$i]}&#xA;        echo "Cutting audio file $input_file at $bpm BPM for bar $((i &#x2B; 1)) ($start_time-$end_time) for $bar_duration seconds..."&#xA;&#xA;        # Cut audio for current bar range using ffmpeg&#xA;        ffmpeg -i "$input_file" -ss "$start_time" -to "$end_time" -c copy "$output_file"_"$((i &#x2B; 1)).${input_file##*.}" -y&#xA;    done&#xA;&#xA;    # Check if the output files are empty and delete them if so&#xA;    for output_file in "${output_file}"_*; do&#xA;        if [ ! -s "$output_file" ]; then&#xA;            echo "Output file $output_file is empty. Deleting..."&#xA;            rm "$output_file"&#xA;        fi&#xA;    done&#xA;&#xA;    echo "Audio cut and saved as $output_file"&#xA;}&#xA;&#xA;&#xA;# Main script&#xA;if [ "$#" -eq 0 ]; then&#xA;    echo "Usage: $0 [audio_file1] [audio_file2] ..."&#xA;    exit 1&#xA;fi&#xA;&#xA;for file in "$@"; do&#xA;    bpm=$(get_bpm "$file")&#xA;    if [ -z "$bpm" ]; then&#xA;        echo "Error: No BPM found in filename $file"&#xA;    else&#xA;        cut_audio "$file" "$bpm"&#xA;    fi&#xA;done&#xA;

    &#xA;

    Maybe its only the math calc in the beginning but idk :)

    &#xA;

    If you need more details just lmk

    &#xA;