Recherche avancée

Médias (1)

Mot : - Tags -/wave

Autres articles (96)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • 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 ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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 (4996)

  • Call bash function in Java

    16 mai 2023, par ilie alexandru

    I 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 :

    


    enter image description here

    


    The result of the cli command :

    


    enter image description here

    


    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&lt;>();&#xA;&#xA;MainSearch mainSearch = new MainSearch(this.array, this.search);&#xA;HashMap>>> map = new HashMap&lt;>();&#xA;        map = mainSearch.SearchInVideous();&#xA;&#xA;&#xA;HashMap>> file = new HashMap&lt;>();&#xA;file=map.get(this.array.get(1));&#xA;&#xA;file.forEach((k,v)->{&#xA;    StringBuilder stringBuilder = new StringBuilder(this.defaultpth);&#xA;    stringBuilder.append("/")&#xA;            .append(this.array.get(0))&#xA;            .append("/")&#xA;            .append(this.array.get(1))&#xA;            .append("/")&#xA;            .append(k)&#xA;            .append("/")&#xA;            .append("InfoVideo.txt");&#xA;&#xA;    GetVideoPath getVideoPath = new GetVideoPath();&#xA;    String videoPath = getVideoPath.GetVideoPathMethod(stringBuilder);&#xA;&#xA;    v.forEach((k1,v1)->{ // iterate though the words&#xA;        v1.forEach((k2,v2)->{ // iterate though the times&#xA;&#xA;            String doubleAsStringForKey = String.valueOf(k2);&#xA;            String[] arr = doubleAsStringForKey.split("\\.");&#xA;&#xA;            String doubleASStringForValue = String.valueOf(v2);&#xA;            String[] arr2 = doubleASStringForValue.split("\\.");&#xA;&#xA;            if(k2>10){&#xA;&#xA;                StringBuilder stringBuilder1 = new StringBuilder();&#xA;                stringBuilder1.append(" -ss ")&#xA;                        .append("00:00:")&#xA;                        .append(arr[0])&#xA;                        .append(".")&#xA;                        .append(arr[1])&#xA;                        .append(" -to ")&#xA;                        .append(" 00:00:")&#xA;                        .append(arr2[0])&#xA;                        .append(".")&#xA;                        .append(arr2[1])&#xA;                        .append(" -i ")&#xA;                        .append(videoPath);&#xA;                arrayList.add(String.valueOf(stringBuilder1));&#xA;            }&#xA;                else{&#xA;&#xA;                    StringBuilder stringBuilder1 = new StringBuilder();&#xA;                    stringBuilder1.append(" -ss ")&#xA;                            .append("00:00:0")&#xA;                            .append(arr[0])&#xA;                            .append(".")&#xA;                            .append(arr[1])&#xA;                            .append(" -to ")&#xA;                            .append("00:00:0")&#xA;                            .append(arr2[0])&#xA;                            .append(".")&#xA;                            .append(arr2[1])&#xA;                            .append(" -i ")&#xA;                            .append(videoPath);&#xA;                    arrayList.add(String.valueOf(stringBuilder1));&#xA;                }&#xA;&#xA;        });&#xA;    });&#xA;&#xA;});&#xA;&#xA;BashFIleForCreatingNewVideo bashFIleForCreatingNewVideo = new BashFIleForCreatingNewVideo();&#xA;bashFIleForCreatingNewVideo.BashFileForCreatingNewVideo(arrayList);&#xA;</string>

    &#xA;

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

    &#xA;

    public class BashFIleForCreatingNewVideo {&#xA;&#xA;    protected String BashFileForCreatingNewVideo(ArrayList<string> arrayList){&#xA;        try {&#xA;&#xA;        StringBuilder stringBuilder = new StringBuilder();&#xA;&#xA;        for(String str : arrayList){&#xA;            stringBuilder.append(str);&#xA;        }&#xA;        Process p = Runtime.getRuntime().exec(new String[]{"bash", "-c", "cd ~/IdeaProjects/Final-Year-Spring/src/main/java/com/FinalYearProjectServer/Get_Requests/CreateNewVideo &amp;&amp; ./createNewVideo.sh ", String.valueOf(stringBuilder), String.valueOf(arrayList.size()-1), "./maps/outputstream.mp4"});&#xA;        BufferedReader srdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));&#xA;        String s =srdInput.readLine();&#xA;&#xA;        if(s==null){&#xA;            return "Error";&#xA;        }else {&#xA;            System.out.println(s);&#xA;            return s;&#xA;        }&#xA;&#xA;        } catch (IOException e) {&#xA;            throw new RuntimeException(e);&#xA;        }&#xA;&#xA;    }&#xA;}&#xA;</string>

    &#xA;

    The script file :

    &#xA;

    #!/bin/bash&#xA;&#xA;arr=( "$@" )&#xA;&#xA;echo "${arr[*]}"&#xA;&#xA;ffmpeg "${arr[0]}" -filter_complex concat=n="${arr[1]}":v=1:a=1 "${arr[2]}"&#xA;

    &#xA;

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

    &#xA;

     -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&#xA;

    &#xA;

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

    &#xA;

    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.

    &#xA;

    Ok so I am trying to use ProcessBuilder :

    &#xA;

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

    &#xA;

  • Announcement : Piwik to focus on Reliability, Performance and Security

    7 octobre 2014, par Matthieu Aubry — About, Community

    To our valued team and community,

    Well, we have moved fast and achieved so much during the past few months. Relentlessly releasing major version after major version… We got a lot done including several major new features !

    The speed of adding new features was a great showcase of how agile our small teams and the larger community are. And I’m so proud to see automated testing becoming common practice among everyone hacking on Piwik !

    For the next few months until the new year we will focus on making what we have better. We will fix those rare but longstanding critical bugs, and aim to solve all Major issues and other must-have performance and general improvements. The core team and Piwik PRO will have the vision of making the existing Piwik and all plugins very stable and risk free. This includes edge cases, general bugs but also specific performance issues for high traffic or issues with edge case data payloads.

    We’ll be more pro-active and take Piwik platform to the next level of Performance, Security, Privacy & Reliability ! We will prove to the world that Free/Libre Web software can be of the highest standard of quality. By focusing on quality we will make Piwik even easier to maintain and improve in the future. We are building the best open platform that will let every user liberate their data and keep full control of it.

    If you have any feedback or questions get in touch or let’s continue the discussion in the forum.

    Thank you for your trust and for liberating your data with Piwik,

    Matthieu Aubry
    Piwik founder

    More information

    This is an amazing testament of the power of free/libre software and yet we think this is just the beginning. We hope more developers will join and contribute to the Piwik project !

  • End of Piwik Mobile 1 – Focus is on Piwik Mobile 2

    2 septembre 2014, par Piwik Core Team — Community, Piwik Mobile Releases

    More than four years after its initial release, we will remove Piwik Mobile 1 from the Apple App Store and Google Play Store in one week. During that time the app was downloaded more than 60.000 times with an average rating of 4.6 and over 2000 ratings. Thank you to our community of users for all of this !

    Why we must focus on Piwik Mobile 2

    Unfortunately we do not have the resources to maintain Piwik Mobile 1 to be compatible with the latest iOS and Android updates (namely iOS 8 and Android L). The last update of Piwik Mobile 1 was over one year ago and the underlying framework, which we are using to develop the app, is nearly two years old. Making the code compatible with the current version of the underlying framework to support the latest platform versions would take us many weeks. As a little background : From the beginning Piwik Mobile 1 has been a free app and was developed by a single person Thomas in his spare time who is now focussing on Piwik Mobile 2.

    Can I still get it ?

    We are announcing this today so you get a chance to install the app via the Apple App Store and Google Play Store while it is still available.

    If you are one of the 87% of our Piwik Mobile 1 users who are already using Android 4+ or iOS 7+ then you can install Piwik Mobile 2 (make sure you upgrade your Piwik platform to 1.12 or 2.x recommended).

    What happens after the app is removed ?

    If you have already installed the app it won’t be removed from your device and you will still be able to use it. Android users can still download Piwik Mobile 1 but we cannot guarantee it will work on all devices. Lastly the code our free software is available on GitHub and you can build it from the source if you have to.

    The future of Piwik Mobile

    Piwik Mobile version 2.1 is currently in beta testing phase. This new version includes several useful new features such as support for Segmentation. If you use Android, give it a try !