Recherche avancée

Médias (3)

Mot : - Tags -/image

Autres articles (45)

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

  • ANNEXE : Les extensions, plugins SPIP des canaux

    11 février 2010, par

    Un plugin est un ajout fonctionnel au noyau principal de SPIP. MediaSPIP consiste en un choix délibéré de plugins existant ou pas auparavant dans la communauté SPIP, qui ont pour certains nécessité soit leur création de A à Z, soit des ajouts de fonctionnalités.
    Les extensions que MediaSPIP nécessite pour fonctionner
    Depuis la version 2.1.0, SPIP permet d’ajouter des plugins dans le répertoire extensions/.
    Les "extensions" ne sont ni plus ni moins que des plugins dont la particularité est qu’ils se (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (7612)

  • Bash script to automate FFmpeg operations fails when calling the command, but copy-pasting the generated command into the terminal works [duplicate]

    28 février, par GaboScharff99

    I wrote a bash script which automates a number of conversion operations on video files using FFmpeg. Oddly enough, the FFmpeg call itself now fails when running the script, with a very confusing error message, I might add, but when I copy the command generated by the script into the terminal and run it, it works flawlessly. I'm sorry to insert such a long code block here, but considering how strange this error is, it might be anywhere in the script, so here it is :

    


    #!/bin/bash

audioTrack=1
subSource=1
subTrack=0
transcodeVideo=1
transcodeAudio=1
volumeMultiplier=1
degradeToStereo=0
subLanguage="Japanese"

while getopts "t:ns:vam:dl:h" opt; do
    case "$opt" in
        t) audioTrack=${OPTARG};;
        n) subSource=0;;
        s) subTrack=${OPTARG};;
        v) transcodeVideo=0;;
        a) transcodeAudio=0;;
        m) volumeMultiplier=${OPTARG};;
        d) degradeToStereo=1;;
        l) subLanguage=${OPTARG};;
        h)
            echo "Options:"
            echo "-t [integer]: Audio track number. Default: 1."
            echo "-n: If included, subtitles will be taken from internal source."
            echo "-s [integer]: Subtitles track number. Default: 0."
            echo "-v: If included, video source will be copied without transcoding."
            echo "-a: If included, audio source will be copied without transcoding."
            echo "-m [number]: Volume multiplier. If 1, volume is unaffected. Default: 1"
            echo "-d: If included, audio will be degraded to stereo."
            echo "-l [language]: Subtitles language. Only used for external subtitles source. Default: Japanese."
            exit 0
        ;;
    esac
done

echo "Audio track: $audioTrack."
echo "Subtitles track: $subTrack."
params="-map 0:0 -map 0:$audioTrack -map $subSource:$subTrack -c:v"

if [[ $transcodeVideo -eq 1 ]]; then
    echo "Video will be transcoded."
    params="$params hevc"
elif [[ $transcodeVideo -eq 0 ]]; then
    echo "Video will be copied without transcoding."
    params="$params copy"
fi

params="$params -c:a"

if [[ $transcodeAudio -eq 1 ]]; then
    echo "Audio will be transcoded."
    params="$params libopus"
elif [[ $transcodeAudio -eq 0 ]]; then
    echo "Audio will be copied without transcoding."
    params="$params copy"
fi

if [[ $volumeMultiplier -ne 1 ]]; then
    echo "Volume will be multiplied by a factor of $volumeMultiplier."
    params="$params -filter:a 'volume=$volumeMultiplier'"
else
    echo "Volume will be unaffected."
fi

if [[ $degradeToStereo -eq 1 ]]; then
    echo "Audio will be degraded to stereo."
    params="$params -ac 2"
elif [[ $degradeToStereo -eq 0 ]]; then
    echo "Audio will not be degraded to stereo."
fi

params="$params -c:s copy"

if [[ $subSource -eq 1 ]]; then
    echo "Subtitles source is external."
    echo "Subtitles language is $subLanguage."
    params="$params -metadata:s:s:0 title='' -metadata:s:s:0 language='$subLanguage'"
else
    echo "Subtitles source is internal."
fi

if [[ -f titles.txt ]]; then
    echo "A titles.txt file was found. Titles will be changed according to it."
    echo "Please check titles.txt to make sure the titles are correct."
    changeTitles=1
    counter=0
else
    echo "A titles.txt file was not found. Titles will not be changed."
    changeTitles=0
fi

read -p "Are these options correct? (y/n) " choice

case "$choice" in
    y|Y)
        echo "Initiating conversion sequence. This may take a while..."

        mkdir output
        currentParams=""

        shopt -s nullglob
        for i in *.mp4 *.mkv; do
            currentParams=$params
            fileNameNoExtension=$(echo $i | rev | cut -f 2- -d '.' | rev)

            if [[ $subSource -eq 1 ]]; then
                currentParams="-f srt -i $fileNameNoExtension.srt $currentParams"
            fi

            if [[ $changeTitles -eq 1 ]]; then
                ((counter++))
                currentParams="$currentParams -metadata title='$(awk "NR==$counter" titles.txt)'"
            fi

            ffmpeg -i "$i" $currentParams "output/$fileNameNoExtension.mkv"
        done

        echo "Conversion finished!"
    ;;
    n|N) echo "Operation canceled. Exiting.";;
    *) echo "Invalid input. Try again.";;
esac


    


    The directory I'm running this in contains six video files :

    


      

    1. E1 - The Pirates of Orion.mkv
    2. 


    3. E2 - Bem.mkv
    4. 


    5. E3 - The Practical Joker.mkv
    6. 


    7. E4 - Albatross.mkv
    8. 


    9. E5 - How Sharper Than a Serpent's Tooth.mkv
    10. 


    11. E6 - The Counter-Clock Incident.mkv
    12. 


    


    Here's the titles.txt file, for completion's sake :

    


    Star Trek: The Animated Series - Season 2, Episode 1 - The Pirates of Orion
Star Trek: The Animated Series - Season 2, Episode 2 - Bem
Star Trek: The Animated Series - Season 2, Episode 3 - The Practical Joker
Star Trek: The Animated Series - Season 2, Episode 4 - Albatross
Star Trek: The Animated Series - Season 2, Episode 5 - How Sharper Than a Serpent's Tooth
Star Trek: The Animated Series - Season 2, Episode 6 - The Counter-Clock Incident


    


    And finally, here's the error message given by FFmpeg on the terminal for every video file when running the command :

    


    Unable to find a suitable output format for 'Trek:'
Trek:: Invalid argument


    


    Maybe there are better ways to handle all of this, but first and foremost, I would like to figure out why the command fails with such a confusing error message. The only place where the string 'Trek :' is found is in the title taken from titles.txt, but I don't understand why that's seemingly being passed to the name of the output file instead of the title, and apparently only when running the script.

    


    Thanks a lot for your answers ! I know this is quite a bit of text, so I really appreciate you taking your time to read through this.

    


  • Is it possible to concatenate few videos together, setting their timings and displaying background image, if no video for the current frame ?

    13 juillet 2020, par Valeryi Cherdakov

    I have an audio track, say, a few minutes long, as well as several short videos of several tens of seconds. For each of these videos I have a timing - the video should start at a certain second. The audio tracks of these videos are not needed.
The output video should last exactly as long as the audio lasts.
If at the moment there is no video to display, a picture should be displayed (as if the picture is on layer #1, and the rest of the videos are on layer #2).

    


    Is it possible to complete this task using a command or a series of ffmpeg commands ?

    


  • Firefox says some files converted from mkv to mp4 in ffmpeg are corrupt

    14 janvier 2018, par EpicKnarvik97

    I have recently converted many videos for web playback, but all videos from one "series" all show up in firefox as "Video can’t be played because the file is corrupt." (They work for google chrome and VLC. Not for firefox or edge.) All files have been converted with this command :

    ffmpeg -i "file.mkv" -vcodec h264 -movflags +faststart -map 0 -vf subtitles="file.mkv" "file.mp4"

    ffmpeg output from one of the non-working files :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Episode_7.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf58.3.100
     Duration: 00:23:53.52, start: -0.001333, bitrate: 1900 kb/s
       Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 1920x1080 [SAR 1:1 DAR 16:9], 1763 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 130 kb/s (default)
       Metadata:
         handler_name    : SoundHandler

    ffmpeg output from a working file :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Episode_7.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf58.3.100
     Duration: 00:23:40.06, start: 0.000000, bitrate: 1848 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1710 kb/s, 23.81 fps, 23.81 tbr, 16k tbn, 47.62 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(jpn): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 131 kb/s (default)
       Metadata:
         handler_name    : SoundHandler

    Of a collection of over 100 files, only 12 episodes of a single series show up as corrupted in firefox. I see some differences in the information about the two files, but I don’t know why one file works and the other does not. What do I need to tell ffmpeg to make the videos playable in firefox ?