
Recherche avancée
Autres articles (44)
-
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (11394)
-
ProcessBuilder is not called when trying to start a process
15 juin 2022, par xnokI 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 :

package com.example.myapplication;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;

import org.bytedeco.javacpp.Loader;

import android.os.Build;
import android.os.Bundle;
import android.util.Log;

public class MainActivity extends AppCompatActivity {
 static final int cols = 192;
 static final int rows = 108;
 static final String ffmpeg = Loader.load(org.bytedeco.ffmpeg.ffmpeg.class);
 static final String rtmp_url = "test.flv";
 static final String[] command = {ffmpeg,
 "-y",
 "-f", "rawvideo",
 "-vcodec", "rawvideo",
 "-pix_fmt", "bgr24",
 "-s", (Integer.toString(cols) + "x" + Integer.toString(rows)),
 "-r", "10",
 "-i", "pipe:",
 "-c:v", "libx264",
 "-pix_fmt", "yuv420p",
 "-preset", "ultrafast",
 "-f", "flv",
 rtmp_url};
 @RequiresApi(api = Build.VERSION_CODES.O)
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 new Thread(t1).start();

 }
 private static Runnable t1 = () -> {
 Log.e("TAG", "void OnCreate called successfully!");
 ProcessBuilder pb = new ProcessBuilder(command).redirectErrorStream(true);
 pb.redirectErrorStream(true);
 try {
 Process process = pb.start();
 BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
 OutputStream writer = process.getOutputStream();
 Log.e("TAG", "Something good happened here");
 } catch (IOException e) {
 e.printStackTrace();
 Log.e("TAG", "Nothing good happened here");
 }
 };


}



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


I get the following logs from the logcat panel :


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



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


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


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



-
wait for node server to start up in php
22 février 2015, par Ortix92I have a php script which does the following :
- Start peerflix (node server)
- Get PID
- FFProbe* the server (http://127.0.0.1:8888)
All of this is done in PHP but there is a slight issue. It seems that after having received the PID, the server is not fully initialized yet, or so it seems. The problem is that
FFProbe
cannot probe the server. In other words, it’s not accessible at the time of probing.What are some possibilities to probe the server when it is actually initialized ? I don’t want to use the arbitrary
sleep()
method because waiting for 2 seconds on a slow vagrant machine is now the same as waiting for 2 seconds on a blazing vast server.FFProbe throws an exception when it can’t probe the server. Perhaps use a
try-catch
and return back to thetry
if an exception is thrown ? How would I implement that ?*FFProbe is a companion of FFMpeg to get the information of a video file such as duration and codec.
-
libavcodec/dynamic_hdr_vivid : fix start code check
17 mars 2023, par Zhao Zhili