Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (25)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Changer son thème graphique

    22 février 2011, par

    Le thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
    Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
    Modifier le thème graphique utilisé
    Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
    Il suffit ensuite de se rendre dans l’espace de configuration du (...)

Sur d’autres sites (4032)

  • Transcode each stream in a different thread with ffmpeg

    30 mai 2018, par hedgar2017

    Is there a way of forcing ffmpeg to encode each audio stream in a different thread ?

    ffmpeg
       -i audio1.ac3 -c:a libopus
       -i audio2.ac3 -c:a libopus
       -i audio3.ac3 -c:a libopus
       output.mkv

    I mean only ffmpeg’s own instruments, without multiple processes and other OS features.

    Normally, there is only one core saturated, so encoding a file with many audio streams is very long.

    Exact command :

    ffmpeg -loglevel verbose
       -i 'Ярость (Fury).mkv'
       -i 'Fury (2014) [Ukr & Eng, Sub Eng] BDRip-AVC [Hurtom & HELLYWOOD].mkv'
       -threads 0 -max_muxing_queue_size 65536 -avoid_negative_ts 1 -metadata title=2014.Fury.BDRip.HEVC.1080p
       -map 0:0 -c:v copy -metadata:s:v:0 title=2014.Fury.BDRip.HEVC.1080p -disposition:v:0 +defaug-[forced
       -map 0:2 -c:a libopus -application audio -vbr on -packet_loss 0 -frame_duration 20 -mapping_family 255 -compression_level 10 -metadata:s:a:0 language=eng -metadata:s:a:0 title=Original -disposition:a:0 +defaug-[forced
       -map 1:1 -c:a libopus -application audio -vbr on -packet_loss 0 -frame_duration 20 -mapping_family 255 -compression_level 10 -metadata:s:a:1 language=ukr -disposition:a:1 -default-forced
       -map 0:1 -c:a libopus -application audio -vbr on -packet_loss 0 -frame_duration 20 -mapping_family 255 -compression_level 10 -metadata:s:a:2 language=rus -metadata:s:a:2 title=Dub -disposition:a:2 -default-forced
       -map 0:10 -c:s copy -metadata:s:s:0 language=eng -metadata:s:s:0 title=Original -disposition:s:0 -default-forced
       -f matroska ./2014.Fury.BDRip.HEVC.1080p.mkv

    Log :

    ... inputs ...
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:2 -> #0:1 (dts (dca) -> opus (libopus))
     Stream #1:1 -> #0:2 (ac3 (native) -> opus (libopus))
     Stream #0:1 -> #0:3 (ac3 (native) -> opus (libopus))
     Stream #0:10 -> #0:4 (copy)
    Press [q] to stop, [?] for help
    [graph_2_in_0_1 @ 0000019ca2cb29c0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x60f
    [format_out_0_3 @ 0000019ca2cb20c0] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_3'
    [auto_resampler_0 @ 0000019ca2cb27c0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:6 chl:5.1(side) fmt:flt r:48000Hz
    [libopus @ 0000019ca2c9f3c0] No bit rate set. Defaulting to 384000 bps.
    [graph_0_in_0_2 @ 0000019ca2cb1ac0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x60f
    [format_out_0_1 @ 0000019ca2cb1bc0] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'
    [auto_resampler_0 @ 0000019ca2cb14c0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:6 chl:5.1(side) fmt:flt r:48000Hz
    [libopus @ 0000019ca292c980] No bit rate set. Defaulting to 384000 bps.
    [graph_1_in_1_1 @ 0000019ca2cb2bc0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x60f
    [format_out_0_2 @ 0000019ca2cb26c0] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_2'
    [auto_resampler_0 @ 0000019ca2cb0dc0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:6 chl:5.1(side) fmt:flt r:48000Hz
    [libopus @ 0000019ca292e980] No bit rate set. Defaulting to 384000 bps.
    Output #0, matroska, to './2014.Fury.BDRip.HEVC.1080p.mkv':
     Metadata:
       DATE_RELEASED   : 2014
       title           : 2014.Fury.BDRip.HEVC.1080p
       Released by     : Buba5473 for NNM-Club
       Copyright       : Encoded by Goor80
       encoder         : Lavf58.12.100
       Chapter #0:0: start 0.000000, end 478.228000
       Metadata:
         title           : Chapter 01
       ... chapters ...
       Stream #0:0: Video: hevc (Main 10), 1 reference frame, yuv420p10le(tv), 1920x800 (0x0) [SAR 1:1 DAR 12:5], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
       Stream #0:1(eng): Audio: opus (libopus) ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, 5.1(side), flt, delay 312, 384 kb/s (default)
       Stream #0:2(ukr): Audio: opus (libopus) ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, 5.1(side), flt, delay 312, 384 kb/s
       Stream #0:3(rus): Audio: opus (libopus) ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, 5.1(side), flt, delay 312, 384 kb/s
       Stream #0:4(eng): Subtitle: subrip
    [matroska @ 0000019ca2d17f00] Starting new cluster due to timestamp=6175.5kbits/s speed=10.2x
    [matroska @ 0000019ca2d17f00] Starting new cluster due to timestamp=7530.8kbits/s speed=8.74x
    [matroska @ 0000019ca2d17f00] Starting new cluster due to timestamp=7955.1kbits/s speed=9.02x
    frame=156607 fps=205 q=-1.0 size= 8321971kB time=01:48:51.85 bitrate=10437.1kbits/s speed=8.55x
    ... not finished yet ...

    fps is always around 3000/number_of_audio_channels, meaning all audio transcoding is done with the only thread.

  • 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

    


  • lavc : use a separate field for exporting audio encoder padding

    23 août 2014, par Anton Khirnov
    lavc : use a separate field for exporting audio encoder padding
    

    Currently, the amount of padding inserted at the beginning by some audio
    encoders, is exported through AVCodecContext.delay. However
    - the term ’delay’ is heavily overloaded and can have multiple different
    meanings even in the case of audio encoding.
    - this field has entirely different meanings, depending on whether the
    codec context is used for encoding or decoding (and has yet another
    different meaning for video), preventing generic handling of the codec
    context.

    Therefore, add a new field — AVCodecContext.initial_padding. It could
    conceivably be used for decoding as well at a later point.

    • [DBH] doc/APIchanges
    • [DBH] libavcodec/aacenc.c
    • [DBH] libavcodec/ac3enc.c
    • [DBH] libavcodec/audio_frame_queue.c
    • [DBH] libavcodec/avcodec.h
    • [DBH] libavcodec/g722enc.c
    • [DBH] libavcodec/libfaac.c
    • [DBH] libavcodec/libfdk-aacenc.c
    • [DBH] libavcodec/libmp3lame.c
    • [DBH] libavcodec/libopencore-amr.c
    • [DBH] libavcodec/libopusenc.c
    • [DBH] libavcodec/libspeexenc.c
    • [DBH] libavcodec/libtwolame.c
    • [DBH] libavcodec/libvo-aacenc.c
    • [DBH] libavcodec/libvo-amrwbenc.c
    • [DBH] libavcodec/libvorbis.c
    • [DBH] libavcodec/mpegaudioenc.c
    • [DBH] libavcodec/nellymoserenc.c
    • [DBH] libavcodec/ra144enc.c
    • [DBH] libavcodec/utils.c
    • [DBH] libavcodec/version.h
    • [DBH] libavcodec/wmaenc.c