Recherche avancée

Médias (0)

Mot : - Tags -/xmp

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (4)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • 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

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (3028)

  • ffmpeg unbale to initialize threading [closed]

    16 octobre 2020, par Sudipta Roy

    I have a JAVA service running in wildfly which is calling an external ffmpeg binary to convert .au files to .wav files. The actual command that is being executed is as follows :

    


    ffmpeg -y -i INPUT.au OUTPUT.wav


    


    It is running smoothly, except every once in a while it is creating an empty .wav file becasue of the following error :

    


    Error: ffmpeg version c6710aa Copyright (c) 2000-2017 the FFmpeg 
developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/tmp/ffmpeg-static/target --pkg-config-flags=- 
-static --extra-cflags=-I/tmp/ffmpeg-static/target/include --extra- 
ldflags=-L/tmp/ffmpeg-static/target/lib --extra-ldexeflags=-static -- 
bindir=/tmp/ffmpeg-static/bin --enable-pic --enable-ffplay --enable- 
ffserver --enable-fontconfig --enable-frei0r --enable-gpl --enable- 
version3 --enable-libass --enable-libfribidi --enable-libfdk-aac -- 
enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb -- 
enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus -- 
enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora - 
-enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis -- 
enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 -- 
enable-libxvid --enable-libzimg --enable-nonfree --enable-openssl
libavutil      55. 34.101 / 55. 34.101
libavcodec     57. 64.101 / 57. 64.101
libavformat    57. 56.101 / 57. 56.101
libavdevice    57.  1.100 / 57.  1.100
libavfilter     6. 65.100 /  6. 65.100
libswscale      4.  2.100 /  4.  2.100
libswresample   2.  3.100 /  2.  3.100
libpostproc    54.  1.100 / 54.  1.100

Input #0, ogg, from 'INPUT.au'
Duration: 00:00:34.08, start: 0.01500, bitrate: 15kb/s
Stream: #0.0: Audio: speex, 8000Hz, mono, s16, 15kb/s

[AVFilterGraph @ 0x43ec6e0] Error initializing threading.
[AVFilterGraph @ 0x43ec6e0] Error creating filter 'anull'


    


    If I try to manually convert the file from command line, it works. A brief internet search (this) shows that it might be due to the fact that ffmpeg is unable to create threads for internal use. Can anyone please elaborate ?

    


    The server where I am facing the problem have relatively high load. I have seen that wildfly is creating close to 1800 threads.

    


    Thanks

    


    P.s. I have managed to recreate the problem. Below is the code :

    


    SystemCommandExecutor.java

    


        import java.io.*;&#xA;    import java.util.List;&#xA;    public class SystemCommandExecutor {&#xA;        private List<string> commandInformation;&#xA;        private String adminPassword;&#xA;        private ThreadedStreamHandler inputStreamHandler;&#xA;        private ThreadedStreamHandler errorStreamHandler;&#xA;&#xA;        public SystemCommandExecutor(final List<string> commandInformation)&#xA;        {&#xA;        if (commandInformation==null) throw new NullPointerException("The commandInformation is required.");&#xA;        this.commandInformation = commandInformation;&#xA;        this.adminPassword = null;&#xA;        }&#xA;&#xA;    public int executeCommand()&#xA;            throws IOException, InterruptedException&#xA;    {&#xA;        int exitValue = -99;&#xA;&#xA;        try&#xA;        {&#xA;            ProcessBuilder pb = new ProcessBuilder(commandInformation);&#xA;            Process process = pb.start();&#xA;            OutputStream stdOutput = process.getOutputStream();&#xA;            InputStream inputStream = process.getInputStream();&#xA;            InputStream errorStream = process.getErrorStream();&#xA;            inputStreamHandler = new ThreadedStreamHandler(inputStream, stdOutput, adminPassword);&#xA;            errorStreamHandler = new ThreadedStreamHandler(errorStream);&#xA;            inputStreamHandler.start();&#xA;            errorStreamHandler.start();&#xA;            exitValue = process.waitFor();&#xA;            inputStreamHandler.interrupt();&#xA;            errorStreamHandler.interrupt();&#xA;            inputStreamHandler.join();&#xA;            errorStreamHandler.join();&#xA;        }&#xA;        catch (IOException e)&#xA;        {&#xA;            throw e;&#xA;        }&#xA;        catch (InterruptedException e)&#xA;        {&#xA;            throw e;&#xA;        }&#xA;        finally&#xA;        {&#xA;            return exitValue;&#xA;        }&#xA;    }&#xA;&#xA;    public StringBuilder getStandardOutputFromCommand()&#xA;    {&#xA;        return inputStreamHandler.getOutputBuffer();&#xA;    }&#xA;&#xA;    public StringBuilder getStandardErrorFromCommand()&#xA;    {&#xA;        return errorStreamHandler.getOutputBuffer();&#xA;    }&#xA;}&#xA;</string></string>

    &#xA;

    ThreadedStreamHandler.java

    &#xA;

    import java.io.*;&#xA;&#xA;class ThreadedStreamHandler extends Thread&#xA;{&#xA;    InputStream inputStream;&#xA;    String adminPassword;&#xA;    OutputStream outputStream;&#xA;    PrintWriter printWriter;&#xA;    StringBuilder outputBuffer = new StringBuilder();&#xA;    private boolean sudoIsRequested = false;&#xA;&#xA;    &#xA;    ThreadedStreamHandler(InputStream inputStream)&#xA;    {&#xA;        this.inputStream = inputStream;&#xA;    }&#xA;&#xA;    &#xA;    ThreadedStreamHandler(InputStream inputStream, OutputStream outputStream, String adminPassword)&#xA;    {&#xA;        this.inputStream = inputStream;&#xA;        this.outputStream = outputStream;&#xA;        this.printWriter = new PrintWriter(outputStream);&#xA;        this.adminPassword = adminPassword;&#xA;        this.sudoIsRequested = true;&#xA;    }&#xA;&#xA;    public void run()&#xA;    {&#xA;        &#xA;        if (sudoIsRequested)&#xA;        {&#xA;            printWriter.println(adminPassword);&#xA;            printWriter.flush();&#xA;        }&#xA;&#xA;        BufferedReader bufferedReader = null;&#xA;        try&#xA;        {&#xA;            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));&#xA;            String line = null;&#xA;            while ((line = bufferedReader.readLine()) != null)&#xA;            {&#xA;                outputBuffer.append(line &#x2B; "\n");&#xA;            }&#xA;        }&#xA;        catch (IOException ioe)&#xA;        {&#xA;            ioe.printStackTrace();&#xA;        }&#xA;        catch (Throwable t)&#xA;        {&#xA;            t.printStackTrace();&#xA;        }&#xA;        finally&#xA;        {&#xA;            try&#xA;            {&#xA;                bufferedReader.close();&#xA;            }&#xA;            catch (IOException e)&#xA;            {&#xA;                // ignore this one&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;    private void doSleep(long millis)&#xA;    {&#xA;        try&#xA;        {&#xA;            Thread.sleep(millis);&#xA;        }&#xA;        catch (InterruptedException e)&#xA;        {&#xA;            // ignore&#xA;        }&#xA;    }&#xA;&#xA;    public StringBuilder getOutputBuffer()&#xA;    {&#xA;        return outputBuffer;&#xA;    }&#xA;&#xA;}&#xA;

    &#xA;

    FfmpegRunnable.java

    &#xA;

    import java.io.IOException;&#xA;import java.util.List;&#xA;&#xA;public class FfmpegRunnable implements Runnable {&#xA;    private List<string> command;&#xA;    SystemCommandExecutor executor;&#xA;&#xA;    public FfmpegRunnable(List<string> command) {&#xA;        this.command = command;&#xA;        this.executor = new SystemCommandExecutor(command);&#xA;    }&#xA;&#xA;    @Override&#xA;    public void run() {&#xA;        try {&#xA;            int id = (int) Thread.currentThread().getId();&#xA;            int result = executor.executeCommand();&#xA;            if(result != 0) {&#xA;                StringBuilder err = executor.getStandardErrorFromCommand();&#xA;                System.out.println("[" &#x2B; id &#x2B; "]" &#x2B; "[ERROR] " &#x2B; err);&#xA;            } else {&#xA;                System.out.println("[" &#x2B; id &#x2B; "]" &#x2B; "[SUCCESS]");&#xA;            }&#xA;        } catch (IOException e) {&#xA;            e.printStackTrace();&#xA;        } catch (InterruptedException e) {&#xA;            e.printStackTrace();&#xA;        }&#xA;    }&#xA;}&#xA;</string></string>

    &#xA;

    FfmpegMain.java

    &#xA;

    import java.util.ArrayList;&#xA;import java.util.List;&#xA;import java.util.concurrent.Executor;&#xA;import java.util.concurrent.Executors;&#xA;import java.util.concurrent.ThreadPoolExecutor;&#xA;public class FfmpegMain {&#xA;    public static void main(String[] args) {&#xA;        //boolean threading = false;&#xA;        System.out.println(args[0]);&#xA;        int nrThread = Integer.parseInt(args[0]);&#xA;        boolean threading = Boolean.parseBoolean(args[1]);&#xA;        System.out.println("nrThread : " &#x2B; nrThread &#x2B; ", threading : " &#x2B; threading);&#xA;        if(threading) {&#xA;            System.out.println("ffmpeg threading enabled");&#xA;        } else {&#xA;            System.out.println("ffmpeg threading not enabled");&#xA;        }&#xA;        ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(nrThread);&#xA;        for(int i=0; i cmd = new ArrayList<string>();&#xA;            String dest = "/tmp/OUTPUT/output_" &#x2B; (Math.random()*1000) &#x2B; ".wav";&#xA;            String cmdStr = "/tmp/FFMPEG/ffmpeg" &#x2B; (threading ? " -threads 1 " : " ")&#xA;                    &#x2B; "-y -i /tmp/input.au " &#x2B; dest;&#xA;            cmd.add("/bin/sh");&#xA;            cmd.add("-c");&#xA;            cmd.add(cmdStr);&#xA;&#xA;            executor.submit(new FfmpegRunnable(cmd));&#xA;        }&#xA;        executor.shutdown();&#xA;    }&#xA;}&#xA;</string>

    &#xA;

    I have created a jar with the class files and run the jar from two seperate terminal with the following command

    &#xA;

    java -jar JAR.jar 40 true&#xA;

    &#xA;

    Here 40 is the number of threads, simulating varous users accessing the system. Every once in a while I get above mentioned error.

    &#xA;

  • Evolution #4567 : balise introduction

    4 octobre 2020, par RastaPopoulos ♥

    Il y a déjà le filtre |introduction pour ça (utilisé par la balise) (le première argument est le descriptif, qu’on met donc ici à vide) : [(#VAL|introduction#TEXTE, 1000)]

    https://code.spip.net/autodoc/tree/ecrire/public/fonctions.php.html#function_filtre_introduction_dist

  • Is there a way to batch split a file by chapter with ffmpeg and then reassemble with mkvmerge in windows ?

    13 avril, par Sipherdrakon

    So I made a batch script originally with the ability to relatively precision trim a video into chapters without having to run by keyframes, but the code looks horrible and I can't get it to loop through all mp4 files nor get mkvmerge to append the files after splitting them. Code is below but be gentle it is my first try.

    &#xA;

    @echo off&#xA;setlocal enableDelayedExpansion&#xA;&#xA;REM CODE BELOW CREATES JSON FILES FOR ALL MP4 FILES WITHIN THE SAME DIRECTORY&#xA;ffprobe -v quiet -print_format json -show_chapters -loglevel error "01x01.mp4" > "01x01.json"&#xA;&#xA;REM CODE BELOW SETS VARIABLES FROM EACH SPECIFIC JSON&#xA;FOR /F "delims=" %%i in (&#x27;jq .chapters[2].start ^&lt; 01x01.json&#x27;) DO SET /A start1=%%i&#xA;FOR /F "delims=" %%j in (&#x27;jq .chapters[2].end ^&lt; 01x01.json&#x27;) DO SET /A end1=%%j&#xA;&#xA;FOR /F "delims=" %%k in (&#x27;jq .chapters[4].start ^&lt; 01x01.json&#x27;) DO SET /A start2=%%k&#xA;FOR /F "delims=" %%l in (&#x27;jq .chapters[4].end ^&lt; 01x01.json&#x27;) DO SET /A end2=%%l&#xA;&#xA;FOR /F "delims=" %%m in (&#x27;jq .chapters[6].start ^&lt; 01x01.json&#x27;) DO SET /A start3=%%m&#xA;FOR /F "delims=" %%n in (&#x27;jq .chapters[6].end ^&lt; 01x01.json&#x27;) DO SET /A end3=%%n&#xA;&#xA;FOR /F "delims=" %%o in (&#x27;jq .chapters[8].start ^&lt; 01x01.json&#x27;) DO SET /A start4=%%o&#xA;FOR /F "delims=" %%p in (&#x27;jq .chapters[8].end ^&lt; 01x01.json&#x27;) DO SET /A end4=%%p&#xA;&#xA;REM SETS THE DURATION OF EACH FILE TO USE PRECISION TIMING FOR START AND STOP TIMES&#xA;CALL vbs (%end1%-%start1%)/1000&#xA;SET duration1=%val%&#xA;CALL vbs (%end2%-%start2%)/1000&#xA;SET duration2=%val%&#xA;CALL vbs (%end3%-%start3%)/1000&#xA;SET duration3=%val%&#xA;CALL vbs (%end4%-%start4%)/1000&#xA;SET duration4=%val%&#xA;&#xA;REM SETS THE START TIME IN SECONDS VS MILLISECONDS&#xA;CALL vbs (%start1%)/1000&#xA;SET start1=%val%&#xA;CALL vbs (%start2%)/1000&#xA;SET start2=%val%&#xA;CALL vbs (%start3%)/1000&#xA;SET start3=%val%&#xA;CALL vbs (%start4%)/1000&#xA;SET start4=%val%&#xA;&#xA;REM TRIM AND SPLIT ORIGINAL FILE INTO SEPERATE SECTIONS BASED ON CHAPTER MARKERS&#xA;ffmpeg -ss %START1% -i 01x01.mp4 -ss 0 -c copy -to %DURATION1% -avoid_negative_ts make_zero 01x01-1.mp4&#xA;ffmpeg -ss %START2% -i 01x01.mp4 -ss 0 -c copy -to %DURATION2% -avoid_negative_ts make_zero 01x01-2.mp4&#xA;ffmpeg -ss %START3% -i 01x01.mp4 -ss 0 -c copy -to %DURATION3% -avoid_negative_ts make_zero 01x01-3.mp4&#xA;ffmpeg -ss %START4% -i 01x01.mp4 -ss 0 -c copy -to %DURATION4% -avoid_negative_ts make_zero 01x01-4.mp4&#xA;&#xA;REM DELETES UNNEEDED JSON AFTER USE&#xA;del /s *.json&#xA;&#xA;REM APPEND ALL MP4 FILES INTO COHESIVE MKV&#xA;for /d /r %%D in (*) do (&#xA;    pushd %%D&#xA;    set files=&#xA;    for %%F in (*.mp4) do set files=!files! &#x2B; ^( "%%F" ^)&#xA;    if not "!files!"=="" %mkvmerge% -o "01x01-FINAL.mkv" !files:~2!&#xA;    popd&#xA;)&#xA;&#xA;REM DELETE UNNEEDED MP4 ORIGINALS AND SPLIT FILES&#xA;del /s *.mp4&#xA;

    &#xA;

    I know it is super long and every time I try to use a variable or a loop to run through all files it can't read the json file. I've been at this all day and I can use the script as is but I have to make a file for each iteration.

    &#xA;

    I was also hoping to be able to have it only pull chapters labeled as "video" but I haven't quite figured that one out yet.

    &#xA;

    I'll add the vbs batch file for the arithmetic section as well as the sample json if it will help.

    &#xA;

    @echo off&#xA;>"%temp%\VBS.vbs" echo Set fso = CreateObject("Scripting.FileSystemObject") : Wscript.echo (%*)&#xA;for /f "delims=" %%a in (&#x27;cscript /nologo "%temp%\VBS.vbs"&#x27;) do set "val=%%a"&#xA;del "%temp%\VBS.vbs"&#xA;

    &#xA;

    {&#xA;    "chapters": [&#xA;        {&#xA;            "id": 0,&#xA;            "time_base": "1/1000",&#xA;            "start": 0,&#xA;            "start_time": "0.000000",&#xA;            "end": 5590,&#xA;            "end_time": "5.590000",&#xA;            "tags": {&#xA;                "title": "Video"&#xA;            }&#xA;        },&#xA;        {&#xA;            "id": 1,&#xA;            "time_base": "1/1000",&#xA;            "start": 5590,&#xA;            "start_time": "5.590000",&#xA;            "end": 13994,&#xA;            "end_time": "13.994000",&#xA;            "tags": {&#xA;                "title": "Advertisement"&#xA;            }&#xA;        },&#xA;        {&#xA;            "id": 2,&#xA;            "time_base": "1/1000",&#xA;            "start": 13994,&#xA;            "start_time": "13.994000",&#xA;            "end": 163964,&#xA;            "end_time": "163.964000",&#xA;            "tags": {&#xA;                "title": "Video"&#xA;            }&#xA;        },&#xA;        {&#xA;            "id": 3,&#xA;            "time_base": "1/1000",&#xA;            "start": 163964,&#xA;            "start_time": "163.964000",&#xA;            "end": 195940,&#xA;            "end_time": "195.940000",&#xA;            "tags": {&#xA;                "title": "Advertisement"&#xA;            }&#xA;        },&#xA;        {&#xA;            "id": 4,&#xA;            "time_base": "1/1000",&#xA;            "start": 195940,&#xA;            "start_time": "195.940000",&#xA;            "end": 547849,&#xA;            "end_time": "547.849000",&#xA;            "tags": {&#xA;                "title": "Video"&#xA;            }&#xA;        },&#xA;        {&#xA;            "id": 5,&#xA;            "time_base": "1/1000",&#xA;            "start": 547849,&#xA;            "start_time": "547.849000",&#xA;            "end": 595850,&#xA;            "end_time": "595.850000",&#xA;            "tags": {&#xA;                "title": "Advertisement"&#xA;            }&#xA;        },&#xA;        {&#xA;            "id": 6,&#xA;            "time_base": "1/1000",&#xA;            "start": 595850,&#xA;            "start_time": "595.850000",&#xA;            "end": 1413588,&#xA;            "end_time": "1413.588000",&#xA;            "tags": {&#xA;                "title": "Video"&#xA;            }&#xA;        },&#xA;        {&#xA;            "id": 7,&#xA;            "time_base": "1/1000",&#xA;            "start": 1413588,&#xA;            "start_time": "1413.588000",&#xA;            "end": 1477569,&#xA;            "end_time": "1477.569000",&#xA;            "tags": {&#xA;                "title": "Advertisement"&#xA;            }&#xA;        },&#xA;        {&#xA;            "id": 8,&#xA;            "time_base": "1/1000",&#xA;            "start": 1477569,&#xA;            "start_time": "1477.569000",&#xA;            "end": 1529696,&#xA;            "end_time": "1529.696000",&#xA;            "tags": {&#xA;                "title": "Video"&#xA;            }&#xA;        }&#xA;    ]&#xA;}&#xA;

    &#xA;

    I also tried using the start_time so I didn't have to do extra calculations but jq didn't like that either.

    &#xA;

    mkvmerge doesn't even try to run when I have it in here and I still need to cut 7 seconds off the end and 12 seconds off the front of it once it is all one file again.

    &#xA;

    Any help would be appreciated, I know it's a lot but I seem to have hit a roadblock or just sleep deprived at this point.

    &#xA;

    UPDATE

    &#xA;

    This works amazing I just need to figure out how to use files with spaces and I'm all set. I guess I could run a batch before hand replacing all spaces with underscores. That would probably work but I would like to not change filenames if I can help it.

    &#xA;

    @echo off&#xA;&#xA;for %%i in (*.mp4) do (&#xA;FOR /F "delims=" %%A IN (&#x27;ffprobe -v quiet -print_format json -show_chapters -loglevel error "%%i" ^| xidel - -se "$json/(chapters)()[id!=0 and tags/title=&#x27;Video&#x27;]/concat(&#x27;ffmpeg -ss &#x27;,start div 1000,&#x27; -i %%i -to &#x27;,((end - start) div 1000),&#x27; -c copy -avoid_negative_ts make_zero %%~ni-&#x27;,position(),&#x27;.mp4&#x27;)"&#x27;) DO %%A&#xA;FOR /F "delims=" %%A IN (&#x27;xidel -s --xquery "concat(&#x27;mkvmerge -o &amp;quot;%%~ni-FINAL.mkv&amp;quot; &amp;quot;&#x27;,join(file:list(.,false(),&#x27;%%~ni-*.mp4&#x27;),&#x27;&amp;quot; &#x2B; &amp;quot;&#x27;),&#x27;&amp;quot;&#x27;)"&#x27;) DO %%A&#xA;)&#xA;

    &#xA;