
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (48)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (5256)
-
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)



-
aptx : implement the aptX HD bluetooth codec
6 janvier 2018, par Aurelien Jacobs -
lavc : add a libwavpack encoder wrapper
25 mai 2013, par Anton Khirnov