
Recherche avancée
Autres articles (65)
-
List of compatible distributions
26 avril 2011, parThe 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, parPré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, parMediaSPIP 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 ChrisI 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 Viranii 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 totzillarbeatsThis terminal script doesn't recognize bars / length right for cutting audio, maybe somebody knows what's wrong with the calculation ...


Would be happy about any help the cutting already works !


#!/bin/bash

# Function to extract BPM from filename

get_bpm() {
 local filename="$1"
 local bpm=$(echo "$filename" | grep -oE '[0-9]{1,3}' | head -n1)
 echo "$bpm"
}

# Function to cut audio based on BPM
cut_audio() {
 local input_file="$1"
 local bpm="$2"
 local output_file="${input_file%.*}_cut.${input_file##*.}" # Appends "_cut" to original filename

 # Define the number of beats per bar (assuming 4 beats per bar)
 beats_per_bar=4

 # Calculate the duration of each bar in seconds
 bar_duration=$((60 * beats_per_bar / bpm))

 # Define start and end times for each bar range
 start_times=(0 21 33 45 57 69 81 93 105 117 129 141)
 end_times=(20 29 41 53 65 77 89 101 113 125 137 149)

 # Iterate through each bar range
 for ((i = 0; i < ${#start_times[@]}; i++)); do
 start_time=${start_times[$i]}
 end_time=${end_times[$i]}
 echo "Cutting audio file $input_file at $bpm BPM for bar $((i + 1)) ($start_time-$end_time) for $bar_duration seconds..."

 # Cut audio for current bar range using ffmpeg
 ffmpeg -i "$input_file" -ss "$start_time" -to "$end_time" -c copy "$output_file"_"$((i + 1)).${input_file##*.}" -y
 done

 # Check if the output files are empty and delete them if so
 for output_file in "${output_file}"_*; do
 if [ ! -s "$output_file" ]; then
 echo "Output file $output_file is empty. Deleting..."
 rm "$output_file"
 fi
 done

 echo "Audio cut and saved as $output_file"
}


# Main script
if [ "$#" -eq 0 ]; then
 echo "Usage: $0 [audio_file1] [audio_file2] ..."
 exit 1
fi

for file in "$@"; do
 bpm=$(get_bpm "$file")
 if [ -z "$bpm" ]; then
 echo "Error: No BPM found in filename $file"
 else
 cut_audio "$file" "$bpm"
 fi
done



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


If you need more details just lmk