Recherche avancée

Médias (0)

Mot : - Tags -/content

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

Autres articles (83)

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

  • Java shelling out to FFMPEG not running nor giving error

    4 janvier, par Todd

    I'm writing a Podcast downloader where I want to be able to download one or more podcasts then run them through FFMPEG.

    


    It does run when I run the program in Windows.
    
It does not run when I run the program in Linux - Meaning FFMPEG may or may not have been called. I have no way of knowing. I get a -1 back from process.waitfor() but no error in my Java logs and no entries at all in the ffmpeg.log file. And there is no file in the processed file directory that FFMPEG would have created.
    
It does run in Linux if I run the same command that fails in Java from the command line.

    


    FFMPEG has the permissions : rwxr-xr-x , so it doesn't seem as if it'd be a permission error. The Java code looks like :

    


        ProcessBuilder processBuilder = new ProcessBuilder( commands );
    processBuilder.redirectErrorStream( true );
    //  Added the next line to see if I could log an error from ffmpeg
    processBuilder.redirectOutput( ProcessBuilder.Redirect.appendTo( new File( "./ffmpeg.log" ) ) );

    Process process = processBuilder.start();
    BufferedReader bufferedOutputReader = new BufferedReader( new InputStreamReader( process.getInputStream() ) );
    do {
        outputString = bufferedOutputReader.readLine();
        if ( outputString != null ) {
            LOGGER.trace( outputString );
        }
    } while ( outputString != null );
    results = process.waitFor();
    LOGGER.debug( "Exit value: " + results );


    


    The commands are :

    


    2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: /bin/ffmpeg 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: -y 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: -i 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: "/home/todd/aggregator/incoming/Downrange Radio/Downrange_Radio_2023-02-15_The_Avidity_PD-10_Delivers_.mp3" 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: -ac 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: 1 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: -af 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: "atempo=1.4,volume=1.4" 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: "/home/todd/aggregator/processed/Downrange Radio/Downrange_Radio_2023-02-15_The_Avidity_PD-10_Delivers_.mp3"


    


    And the manually constructed and run command line that DOES work is :

    


    /bin/ffmpeg -y -i "/home/todd/aggregator/incoming/Downrange Radio/Downrange_Radio_2023-02-15_The_Avidity_PD-10_Delivers_.mp3" -ac 1 -af "atempo=1.4,volume=1.4" "/home/todd/aggregator/processed/Downrange Radio/Downrange_Radio_2023-02-15_The_Avidity_PD-10_Delivers_.mp3"


    


    The ffmpeg.log file is empty, so I'm doubting whether FFMPEG is ever being reached.

    


    What am I doing wrong ?

    


    EDIT :
I changed the commands to be

    


    "/bin/ffmpeg 2> foo.txt" 


    


    and the execution code to :

    


        ProcessBuilder processBuilder = new ProcessBuilder( commands );
//        processBuilder.redirectErrorStream( true );
    //  Added the next line to see if I could log an error from ffmpeg
//        processBuilder.redirectOutput( ProcessBuilder.Redirect.appendTo( new File( "./ffmpeg.log" ) ) );
        Process process = processBuilder.start();
        results = process.waitFor();


    


    Running that command from the command line displays a list of MMPEG commands that can be run within foo.txt. Upon running from within the Java app, the foo.txt file is empty, so it doesn't appear that FFMPEG ever gets reached. But, I'm clueless why not.

    


    EDIT 2 :
I converted the /bin/ffmpeg path to uppercase to see if that would return an error and it did.

    


    ERROR org.mrpc.utilities.ShellUtils - Cannot run program "/BIN/FFMPEG": error=2, No such file or directory


    


    This seems to confirm that the Java Process object can locate ffmpeg successfully when it is properly cased (i.e. my original code) as I don't see an error message when the case is incorrect. Still not sure why nothing happens when it is called.

    


    EDIT 3 :
I punted on this a year ago, but recently had to revisit. This time I found the answer. It is because I included double quotes around some of the command parameters. That caused the files to not be found. This link states that the Process class handles embedded spaces without any intervention required by you : ProcessBuilder adds extra quotes to command line

    


  • Cropping a video from Sony A7 Camera using ffmpeg

    23 octobre 2023, par Mike Slinn

    I want to crop a video file created by a Sony A7iii camera, so only the portion from 0:51 through 2:45 is extracted.
The camera adds streams that need to be ignored.

    


    ffprobe shows the error on input stream 2, however the problem I am reporting deals with input stream 3, which is a data stream, and is not required. I want to exclude input stream 3, then deal with input stream 2.

    


    $ ffprobe myfile.mp4
ffprobe version 3.0-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 5.3.1 (Debian 5.3.1-8) 20160205
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --enable-librtmp --enable-libmfx --cc=gcc
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'myfile.mp4':
  Metadata:
    major_brand     : XAVC
    minor_version   : 16785407
    compatible_brands: XAVCmp42iso2
    creation_time   : 2023-01-05 00:52:24
  Duration: 00:10:58.16, start: 0.000000, bitrate: 51445 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-4), 1920x1080 [SAR 1:1 DAR 16:9], 49370 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)
    Metadata:
      creation_time   : 2023-01-05 00:52:24
      handler_name    : Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2023-01-05 00:52:24
      handler_name    : Sound Media Handler
    Stream #0:2(und): Data: none (rtmd / 0x646D7472), 491 kb/s (default)
    Metadata:
      creation_time   : 2023-01-05 00:52:24
      handler_name    : Timed Metadata Media Handler
Unsupported codec with id 0 for input stream 2


    


    Predictably, ffmpeg fails because ffprobe failed.

    


    $ ffmpeg -y -i 'myfile.mp4' -ss 51 -to 2:45 -acodec copy 'myfile.crop.mp4'
ffmpeg version 5.1.2-3ubuntu1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12 (Ubuntu 12.2.0-14ubuntu2)
  configuration: --prefix=/usr --extra-version=3ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55d61a97fc80] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1001
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55d61a97fc80] st: 0 edit list 1 Cannot find an index entry before timestamp: 1001.
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'myfile.mp4':
  Metadata:
    major_brand     : XAVC
    minor_version   : 16785407
    compatible_brands: XAVCmp42iso2
    creation_time   : 2023-01-05T00:52:24.000000Z
  Duration: 00:10:58.16, start: 0.000000, bitrate: 51445 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-4, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 49370 kb/s, 59.94 fps, 59.94 tbr, 60k tbn (default)
    Metadata:
      creation_time   : 2023-01-05T00:52:24.000000Z
      handler_name    : Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : AVC Coding
  Stream #0:1[0x2](und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2023-01-05T00:52:24.000000Z
      handler_name    : Sound Media Handler
      vendor_id       : [0][0][0][0]
  Stream #0:2[0x3](und): Data: none (rtmd / 0x646D7472), 491 kb/s (default)
    Metadata:
      creation_time   : 2023-01-05T00:52:24.000000Z
      handler_name    : Timed Metadata Media Handler
      timecode        : 03:52:30:26
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[libx264 @ 0x55d61aa58a80] using SAR=1/1
[libx264 @ 0x55d61aa58a80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x55d61aa58a80] profile High, level 4.2, 4:2:0, 8-bit
[libx264 @ 0x55d61aa58a80] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=34 lookahead_threads=5 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[mp4 @ 0x55d61aa57cc0] Could not find tag for codec pcm_s16be in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Conversion failed!


    


    I tried various incantations that specified permutations of -map options, but only dug myself a deeper hole.

    


    How might I perform the extraction ? I am not interested in preserving extra streams, I just want the main video and stereo audio streams.

    


  • Convert mp4/mov/... to mp4 with fluent-ffmpeg

    13 octobre 2023, par Sam Leurs

    I have a lambda function which reads a video from s3, converts it with fluent-ffmpeg and streams the video back to (another bucket in) s3.

    


    This is the code so far :

    


        ffmpeg()
        .input(readstream.Body)
        .format('mp4')
        .addOutputOption("-preset veryfast")
        .addOutputOption("-movflags frag_keyframe+empty_moov")
        .addOutputOption("-crf 28")
        .output(writestream, { end: true })
        .on('error', (err, stdout, stderr) => {
            console.log(err);
            console.log('Stdout: %o', stdout);
            console.log('Stderr: %o', stderr);
        })
        .run();


    


    With an input mp4 file, this code works, but with a mov-file it fails. I get the following error :

    


    Error: ffmpeg exited with code 1: Error demuxing input file 0: Invalid data found when processing input&#xA;pipe:0: Invalid data found when processing input&#xA;Cannot determine format of input stream 0:0 after EOF&#xA;Error marking filters as finished&#xA;Conversion failed!&#xA;&#xA;    at ChildProcess.<anonymous> (/opt/nodejs/node_modules/fluent-ffmpeg/lib/processor.js:182:22)&#xA;    at ChildProcess.emit (node:events:514:28)&#xA;    at ChildProcess._handle.onexit (node:internal/child_process:291:12)&#xA;2023-10-13T20:10:01.978Z    32c55766-476f-41e9-873a-038341f5630a    INFO    Stdout: &#x27;&#x27;&#xA;2023-10-13T20:10:01.978Z    32c55766-476f-41e9-873a-038341f5630a    INFO    Stderr: &#x27;ffmpeg version 6.0-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2023 the FFmpeg developers\n&#x27; &#x2B;&#xA;  &#x27;  built with gcc 8 (Debian 8.3.0-6)\n&#x27; &#x2B;&#xA;  &#x27;  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg\n&#x27; &#x2B;&#xA;  &#x27;  libavutil      58.  2.100 / 58.  2.100\n&#x27; &#x2B;&#xA;  &#x27;  libavcodec     60.  3.100 / 60.  3.100\n&#x27; &#x2B;&#xA;  &#x27;  libavformat    60.  3.100 / 60.  3.100\n&#x27; &#x2B;&#xA;  &#x27;  libavdevice    60.  1.100 / 60.  1.100\n&#x27; &#x2B;&#xA;  &#x27;  libavfilter     9.  3.100 /  9.  3.100\n&#x27; &#x2B;&#xA;  &#x27;  libswscale      7.  1.100 /  7.  1.100\n&#x27; &#x2B;&#xA;  &#x27;  libswresample   4. 10.100 /  4. 10.100\n&#x27; &#x2B;&#xA;  &#x27;  libpostproc    57.  1.100 / 57.  1.100\n&#x27; &#x2B;&#xA;  &#x27;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5f71b00] stream 0, offset 0x24: partial file\n&#x27; &#x2B;&#xA;  &#x27;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5f71b00] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1920x1080, 447 kb/s): unspecified pixel format\n&#x27; &#x2B;&#xA;  "Consider increasing the value for the &#x27;analyzeduration&#x27; (0) and &#x27;probesize&#x27; (5000000) options\n" &#x2B;&#xA;  "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;pipe:0&#x27;:\n" &#x2B;&#xA;  &#x27;  Metadata:\n&#x27; &#x2B;&#xA;  &#x27;    major_brand     : qt  \n&#x27; &#x2B;&#xA;  &#x27;    minor_version   : 512\n&#x27; &#x2B;&#xA;  &#x27;    compatible_brands: qt  \n&#x27; &#x2B;&#xA;  &#x27;    encoder         : Lavf57.19.100\n&#x27; &#x2B;&#xA;  &#x27;  Duration: 00:00:30.53, start: 0.000000, bitrate: N/A\n&#x27; &#x2B;&#xA;  &#x27;  Stream #0:0[0x1](eng): Video: h264 (avc1 / 0x31637661), none, 1920x1080, 447 kb/s, 30 fps, 30 tbr, 15360 tbn (default)\n&#x27; &#x2B;&#xA;  &#x27;    Metadata:\n&#x27; &#x2B;&#xA;  &#x27;      handler_name    : VideoHandler\n&#x27; &#x2B;&#xA;  &#x27;      vendor_id       : FFMP\n&#x27; &#x2B;&#xA;  &#x27;      encoder         : Lavc57.16.101 libx264\n&#x27; &#x2B;&#xA;  &#x27;  Stream #0:1[0x2](eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 139 kb/s (default)\n&#x27; &#x2B;&#xA;  &#x27;    Metadata:\n&#x27; &#x2B;&#xA;  &#x27;      handler_name    : SoundHandler\n&#x27; &#x2B;&#xA;  &#x27;      vendor_id       : [0][0][0][0]\n&#x27; &#x2B;&#xA;  &#x27;Stream mapping:\n&#x27; &#x2B;&#xA;  &#x27;  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))\n&#x27; &#x2B;&#xA;  &#x27;  Stream #0:1 -> #0:1 (aac (native) -> aac (native))\n&#x27; &#x2B;&#xA;  &#x27;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5f71b00] stream 0, offset 0x24: partial file\n&#x27; &#x2B;&#xA;  &#x27;Error demuxing input file 0: Invalid data found when processing input\n&#x27; &#x2B;&#xA;  &#x27;pipe:0: Invalid data found when processing input\n&#x27; &#x2B;&#xA;  &#x27;Cannot determine format of input stream 0:0 after EOF\n&#x27; &#x2B;&#xA;  &#x27;Error marking filters as finished\n&#x27; &#x2B;&#xA;  &#x27;Conversion failed!\n&#x27;&#xA;</anonymous>

    &#xA;

    Is it possible to convert multiple filetypes with one fluent-ffmpeg chain. If not, can someone help me to make a chain for mov ?

    &#xA;