
Recherche avancée
Médias (29)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (105)
-
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
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 (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (12150)
-
merge multiple ffmpeg commands into one line to make the whole process faster
8 septembre 2020, par user1hjgjhgjhggjhgI want to merge multiple commands into one so that whole processing time would be fastest. What I am doing so far is


- 

-
A video file is uploaded from a webform and and server upload into a temp directory.


if (move_uploaded_file($_FILES[$param]['tmp_name'], $filePath)) {


 return $filePath;
 }



-
add black borders around the video(through ffmpeg command) - video uploads again to a directory


$command_new = "ffmpeg -i $filePath -vf 'scale=720:1280:force_original_aspect_ratio=decrease,pad=720:1280:(ow-iw)/2:(oh-ih)/2,setsar=1' $video_file";
 exec($command_new);



-
optimizing the video(ffmpeg command) - video uploads again to a directory


$cmd_new = "ffmpeg -i $video_file -c:v libx264 -crf 28 $optimizeResultFile";



-
merging the uploaded file with the existing video file present in the database into one and uploading that file into directory(through ffmpeg command)


$command_new = "ffmpeg -i $optimizeResultFile -i $second_video_path -filter_complex '[0:v]pad=iw*2:ih[int];[int][1:v]overlay=W/2:0[vid]' -map [vid] -c:v libx264 -crf 23 -preset veryfast $videomerge";



-
//add custom sound in that final merged video


$cmd_new = "ffmpeg -i $videomerge -i $audio -c:v copy -c:a aac -shortest -map 0:v:0 -map 1:a:0 $with_new_audio";















Is it possible to do all at one command and not in multiple commands. This process takes 1 min to upload a final file. want to make it faster


-
-
Call bash function in Java
16 mai 2023, par ilie alexandruI have been using Java with bash in order to make some things easier, some examples :


From the main class to call a subclass in order to use bash commands :


Main classs :


//Checking if the server already has the user or not
 CheckUser checkUser = new CheckUser();
 int checuser= checkUser.CheckUserMethod(user);
 if( 1 != checuser) { // Yoda notation

 //Making the directory for the user
 File userDirectory = new File(this.directory);
 userDirectory.mkdir();
 }



The class that will call the ".sh" file :


public class CheckUser {

protected int CheckUserMethod(String user){
 try {

 Process p = Runtime.getRuntime().exec(new String[]{"bash", "-c", "cd ~/Final-Year-Spring/src/main/java/query && ./checkuser.sh " + user});
 BufferedReader srdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
 String s =srdInput.readLine();
 if(s==null){
 return 0;
 }else {
 return Integer.parseInt(s);
 }
 }catch (Exception e){
 throw new RuntimeException(e);
 }
}





The bash file :


#!/bin/bash

# shellcheck disable=SC2237
if ! [ -z "$1" ]
then
 cd ~/Final-Year-Spring/maps/ && find "$1" -maxdepth 0 -type d -printf 1
fi



Now you have a context.


I am trying to call a bash file that will execute a ffmpeg command. For instance, the same command when I am using the terminal :


ffmpeg -ss 00:00:00.75 -to 00:00:00.93 -i ~/IdeaProjects/Final-Year-Spring/datassets/Alex/check/5535415699068794046/00009.mp4 -ss 00:00:01.71 -to 00:00:01.82 -i ~/IdeaProjects/Final-Year-Spring/datassets/Alex/check/5535415699068794046/00009.mp4 ~/IdeaProjects/Final-Year-Spring/maps/output.mp4S



Also a screenshot with the command in the cli :




The result of the cli command :




Now I am trying to do the same thing for multiple videos using Java and Bash.


The class that will create the input and the time :


public String CreateNewVideoMethod()


ArrayList<string> arrayList = new ArrayList<>();

MainSearch mainSearch = new MainSearch(this.array, this.search);
HashMap>>> map = new HashMap<>();
 map = mainSearch.SearchInVideous();


HashMap>> file = new HashMap<>();
file=map.get(this.array.get(1));

file.forEach((k,v)->{
 StringBuilder stringBuilder = new StringBuilder(this.defaultpth);
 stringBuilder.append("/")
 .append(this.array.get(0))
 .append("/")
 .append(this.array.get(1))
 .append("/")
 .append(k)
 .append("/")
 .append("InfoVideo.txt");

 GetVideoPath getVideoPath = new GetVideoPath();
 String videoPath = getVideoPath.GetVideoPathMethod(stringBuilder);

 v.forEach((k1,v1)->{ // iterate though the words
 v1.forEach((k2,v2)->{ // iterate though the times

 String doubleAsStringForKey = String.valueOf(k2);
 String[] arr = doubleAsStringForKey.split("\\.");

 String doubleASStringForValue = String.valueOf(v2);
 String[] arr2 = doubleASStringForValue.split("\\.");

 if(k2>10){

 StringBuilder stringBuilder1 = new StringBuilder();
 stringBuilder1.append(" -ss ")
 .append("00:00:")
 .append(arr[0])
 .append(".")
 .append(arr[1])
 .append(" -to ")
 .append(" 00:00:")
 .append(arr2[0])
 .append(".")
 .append(arr2[1])
 .append(" -i ")
 .append(videoPath);
 arrayList.add(String.valueOf(stringBuilder1));
 }
 else{

 StringBuilder stringBuilder1 = new StringBuilder();
 stringBuilder1.append(" -ss ")
 .append("00:00:0")
 .append(arr[0])
 .append(".")
 .append(arr[1])
 .append(" -to ")
 .append("00:00:0")
 .append(arr2[0])
 .append(".")
 .append(arr2[1])
 .append(" -i ")
 .append(videoPath);
 arrayList.add(String.valueOf(stringBuilder1));
 }

 });
 });

});

BashFIleForCreatingNewVideo bashFIleForCreatingNewVideo = new BashFIleForCreatingNewVideo();
bashFIleForCreatingNewVideo.BashFileForCreatingNewVideo(arrayList);
</string>


The class that must call the ".sh" file :


public class BashFIleForCreatingNewVideo {

 protected String BashFileForCreatingNewVideo(ArrayList<string> arrayList){
 try {

 StringBuilder stringBuilder = new StringBuilder();

 for(String str : arrayList){
 stringBuilder.append(str);
 }
 Process p = Runtime.getRuntime().exec(new String[]{"bash", "-c", "cd ~/IdeaProjects/Final-Year-Spring/src/main/java/com/FinalYearProjectServer/Get_Requests/CreateNewVideo && ./createNewVideo.sh ", String.valueOf(stringBuilder), String.valueOf(arrayList.size()-1), "./maps/outputstream.mp4"});
 BufferedReader srdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
 String s =srdInput.readLine();

 if(s==null){
 return "Error";
 }else {
 System.out.println(s);
 return s;
 }

 } catch (IOException e) {
 throw new RuntimeException(e);
 }

 }
}
</string>


The script file :


#!/bin/bash

arr=( "$@" )

echo "${arr[*]}"

ffmpeg "${arr[0]}" -filter_complex concat=n="${arr[1]}":v=1:a=1 "${arr[2]}"



What is passed to the script, small exaple, this is a string :


-ss 00:00:00.75 -to 00:00:00.93 -i ~/IdeaProjects/Final-Year-Spring/datassets/Alex/check/5535415699068794046/00009.mp4 -ss 00:00:01.71 -to 00:00:01.82 -i ~/IdeaProjects/Final-Year-Spring/datassets/Alex/check/5535415699068794046/00009.mp4 -ss 00:00:00.09 -to 00:00:00.34 -i ~/IdeaProjects/Final-Year-Spring/datassets/Alex/check/5535415699068794046/00027.mp4



The next parameter is the number of videos that must concatenate and the last parameter is where the output must be.


My problem is the Bash file is not executing even the echo command or doing something. Do you have any suggestion, because I thing is about the way of how I am passing the array to the Bash file.


Ok so I am trying to use ProcessBuilder :


String[] command = {"bash","ffmpeg", String.valueOf(stringBuilder), "-filter_complex concat=n="+String.valueOf(arrayList.size()-1)+":v=1:a=1", "~/IdeaProjects/Final-Year-Spring/maps/output1.mp4"};
 ProcessBuilder p = new ProcessBuilder(command);
 Process p2 = p.start();
 BufferedReader srdInput;
 srdInput = new BufferedReader(new InputStreamReader(p2.getInputStream()));
 String s =srdInput.readLine();



-
Révision 19837 : Correction et amélioration dans l’importation d’une sauvegarde :
24 août 2012, par esj@rezo.netle test final de nécessité de reconnexion était faux, le résultat de auth_retrouve_login n’étant pas un tableau ; corrigé, ce test apparaît peu utile car l’étape finale étant provoquée par une redirection, il y a eu à l’entrée une vérification du cookie qui a provoqué un renouvellement de session qui a (...)