Recherche avancée

Médias (91)

Autres articles (62)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

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

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

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

  • Amélioration de la version de base

    13 septembre 2013

    Jolie 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 (6311)

  • How to use trap to terminate while loop containing ffmpeg fed by redirect from /dev/null ?

    15 février 2017, par Lorccan

    I discovered here Loop calls process that takes a long time to complete. How do I break out of it ? that piping from find to a while loop that calls an ffmpeg cli [HandBrakeCLI] will not process more than one input file because ffmpeg has a quirk that it ’eats’ all the input list in one go and ’starves’ the loop.

    The solution was to redirect from /dev/null per http://mywiki.wooledge.org/BashFAQ/089 and that works fine. However, it brings me back to the original problem and the question I set out to solve :

    Because /dev/null now has a complete list of all the files feeding HandBrakeCLI, ctrl-c on its own is not enough to quit the loop.

    I have tried various permutations of trap, but I can’t get it to do anything other than stop HandBrakeCLI processing the current input before it moves on to the next one. Instead of terminating the loop immediately, it also processes the mv right after the HandBrakeCLI line.

    So, there are two things I am not getting here : 1. How do I terminate everything with a ctrl-c or kill command ? 2. If not dealt with by (1.), how do I prevent the mv inside the loop from being executed ?

    For the sake of addressing the question, this is the simplified version of the code :

    #!/bin/bash

    source_dir="/Volumes/Volumename"
    dest_dir="/Volumes/Volumename/Converted/"
    finished_dir="Volumes/Volumename/Processed/"


    find "$source_dir" -type d -name "VIDEO_TS" | while read -r dir; do
     name=${dir%/VIDEO_TS}
     mov_dir=${dir%/*}
     name=${name##*/}
     ./HandBrakeCLI -i "$dir" -o "$dest_dir/$name.m4v" null
     mv "$mov_dir" "finished_dir"
    done
  • lavc/ccaption_dec : clear all unused rows during rollup

    13 janvier 2016, par Aman Gupta
    lavc/ccaption_dec : clear all unused rows during rollup
    

    Sometimes rollup captions can move around the screen. This fixes "ghost"
    captions from below the current rollup area from continuing to be
    captured when a rollup moves higher up on the screen.

    • [DH] libavcodec/ccaption_dec.c
  • passing script variable of filename with spaces in bash to external program (ffmpeg) fails

    13 janvier 2016, par BostonScott

    Short story : I’m trying to write a script that will use FFmpeg to convert the many files stored in one directory to a "standard" mp4 format and save the converted files in another directory. It’s been a learning experience (a fun one !) since I haven’t done any real coding since using Pascal and FORTRAN on an IBM 370 mainframe was in vogue.

    Essentially the script takes the filename, strips the path and extension off it, reassembles the filename with the path and an mp4 extension and calls FFmpeg with some set parameters to do the conversion. If the directory contains only video files with without spaces in the names, then everything works fine. If the filenames contain spaces, then FFmpeg is not able to process the file and moves on to the next one. The error indicates that FFMpeg is only seeing the filename up to the first space. I’ve included both the script and output below.

    Thanks for any help and suggestions you may have. If you think I should be doing this in another way, please by all means, give me your suggestions. As I said, it’s been a long time since I did anything like this. I’m enjoying it though.

    I’ve include the code first followed by example output.

    for file in ./TBC/*.mp4
       do

       echo "Start of iteration"
       echo "Full text of file name:" $file

       #Remove everything up to  "C/" (filename without path)
       fn_orig=${file#*C/}
       echo "Original file name:" $fn_orig

       #Length of file name
       fn_len=${#fn_orig}
       echo "Filename Length:" $fn_len

       #file name without path or extension
       fn_base=${fn_orig:0:$fn_len-4}
       echo "Base file name:" $fn_base

       #new filename suffix
       newsuffix=".conv.mp4"

       fn_out=./CONV/$fn_base$newsuffix
       echo "Converted file name:" $fn_out

       ffmpeg -i $file -metadata title="$fn_orig" -c:v libx264 -c:a libfdk_aac -b:a 128k $fn_out

       echo "End of iteration"
       echo
       done
    echo "Script completed"

    With the ffmpeg line commented out, and two files in the ./TBC directory, this is the output that I get

       Start of iteration
       Full text of file name: ./TBC/Test file with spaces.mp4
       Original filename: Test file with spaces.mp4
       Filename Length: 25
       Base filename: Test file with spaces
       Converted file name: ./CONV/Test file with spaces.conv.mp4
       End of iteration

       Start of iteration
       Full text of file name: ./TBC/Test_file_with_NO_spaces.mp4
       Original file name: Test_file_with_NO_spaces.mp4
       Filename Length: 28
       Base file name: Test_file_with_NO_spaces
       Converted file name: ./CONV/Test_file_with_NO_spaces.conv.mp4
       End of iteration

       Script completed

    I won’t bother to post the results when ffmpeg is uncommented, other than to state that it fails with the error :
    ./TBC/Test : No such file or directory

    The script then continues to the next file which completes successfully because it has no spaces in its name. The actual filename is "Test file with spaces.mp4" so you can see that ffmpeg stops after the word "Test" when it encounters a space.

    I hope this has been clear and concise and hopefully someone will be able to point me in the right direction. There is a lot more that I want to do with this script such as parsing subdirectories and ignoring non-video files, etc.

    I look forward to any insight you can give !