Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

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

Autres articles (64)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

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

  • ffmpeg with "-pattern_type glob" and variable in bash script

    20 juin 2019, par KlausPeter

    I’m trying to let ffmpeg make a video of all pictures in a directory using the -pattern_type glob switch and "/foo/bar/*.jpg". This works well, if I execute the command manually für just one directory. For example :

    ffmpeg -framerate 35 -pattern_type glob -i '/root/webcam_test/2018-07-21/*.jpg' -vf scale=1280:-1 -c -c:v libx264 -pix_fmt yuv420p /root/clips/out01_cut.mp4

    However, if I do it in a bash script and set the path via a variable, according to ffmpegs output, the variable gets substituted correctly, but ffmpeg states that

    ’/root/webcam_test/2018-07-21/*.jpg’ : No such file or directory

    The part of the script looks like this :

    for D in `find /root/webcam_test/ -type d`
    do
       [...]
       cmd="ffmpeg -framerate 35 -pattern_type glob -i '$D/*.jpg' -vf scale=1280:-1 -c -c:v libx264 -pix_fm                                 t yuv420p /root/clips/$d_cut.mp4"
       echo $cmd
    [...]
    done

    Does anyone know how to make ffmpeg do its wildcard interpretation even if the path is constructed by a script and not just try to plainly use the given path ?
    Best regards and thanks in advance

  • Running a py script in the Cloud

    12 janvier 2018, par Anay Bose

    I’m new to Google’s cloud & Virtual Machine(VM) instances, and I need some clarifications on a couple of points. I have a python script ; it imports a long range of functions. I need to run those functions in parallel. I’m using multiprocessing and Process, not threads. These functions are basically image and media processors, and they use many other tools like FFMPEG, imagemagick and Avisynth in addition to a wide range of python modules, including moviepy. Now, I would like to run some 50 functions in parallel assigning a CPU for each process. Images, media and avi files are stored in seperate folders. I’m on Windows7 Core-i7 machine. So, need cloud computing power.

    Now, my question can I run such a python script/app in the cloud that requires a very complicated file system and non-python tools i.e. ffmpeg, avisynth and avi files ?

    Can Google VMs emulate my local machine and empower me with more cores and memory to run such a program ? if not, then what are my options ? Is their any tutorials that I can follow ? I need your suggestions. I have given below an example script and some codes to help facilitate your understanding about my situation.

    from __future__ import unicode_literals
    import youtube_dl
    import os
    import time
    import sys
    reload(sys)  
    sys.setdefaultencoding('utf-8')
    from multiprocessing import Process
    from utils import *

    from clip31 import VIDEO31
    from clip32 import VIDEO32
    from clip189 import VIDEO189
    from clip16 import VIDEO16
    from clip39 import VIDEO39


    if __name__== '__main__':

       # 1. CALLING A FUNCTION
       folder = "bodyforce3\\16"
       serial = "16"
       images = get_filepaths("../16")
       videos = get_filepaths("12__media")
       pngs = get_filepaths("../pngs")

       Process(target=VIDEO192, args=(folder, serial, color1, color2, color3, images, videos)).start()


       # 2. CALLING A FUNCTION
       folder = "bodyforce3\\20"
       serial = "20"
       images = get_filepaths("../20")
       videos = get_filepaths("18__media")

       Process(target=VIDEO32, args=(folder, serial, color1, color2, color3, images, videos)).start()


       # 3. CALLING A FUNCTION
       folder = "bodyforce3\\14"
       serial = "14"
       images = get_filepaths("../14")
       videos = get_filepaths("16__media")

       Process(target=VIDEO91, args=(folder, serial, color1, color2, color3, images, videos)).start()

    I copy avi files in functions like this :

    src = "clip50_files"
    src_files = os.listdir(src)
    for file_name in src_files:
       full_file_name = os.path.join(src, file_name)
       if (os.path.isfile(full_file_name)):
           shutil.copy(full_file_name, folder)

    I call ffmpeg commands like this, and they are included within py functions.

    ###########################
    #### FFMPEG OPERATIONS ####
    ###########################

    print "Starting FFMPEG operations ..."

    if os.path.isfile(os.path.join(folder, "bounce-(3).avi")):
       os.remove(os.path.join(folder, "bounce-(3).avi"))


    infile = folder + "/bounce-(3).avs"
    outfile = folder + "/bounce-(3).avi"
    codec = "rawvideo"
    pix_fmt = "bgra"

    try:
       subprocess.call(["ffmpeg",
                        "-i" ,infile,
                        "-c:v" ,codec,
                        "-pix_fmt", pix_fmt,
                        outfile],
                       stdout=open(os.devnull, 'w'),
                       stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError as e:  
       #except subprocess.CalledProcessError as e:
       sys.exit(e.output)
    except OSError as e:
       sys.exit(e.strerror)


    print "FFMPEG operations ended"
  • ffmpeg not working in script - moov atom not found

    2 juin 2016, par user1490563

    I made a simple script that divides a flv file into multiple parts, converts them all to .mp4 individually and then merge all of them to form a final mp4 file. I did this to save time and convert large files in parallel.

    However, I am stuck because the command that normally runs on command line for ffmpeg, doesn’t run via script.

    I am kind of stuck here and will like to have some assistance.

    #!/bin/bash


    #sleep 5


    filenametmp=$1;

    filename=`echo "$filenametmp" | awk '{split($0,a,"."); print a[1]}'`


    echo $filename

    output="$filename-output"

    filenamewithoutpath=`echo "$output" | awk '{split($0,a,"/"); print a[4]}'`

    echo $output $filenamewithoutpath

    /usr/bin/ffmpeg -i $filenametmp -c copy -map 0 -segment_time $2 -f segment $output%01d.flv

    #sleep 10


    #echo "/bin/ls -lrt /root/storage/ | /bin/grep $filenamewithoutpath | /usr/bin/wc -l"
    filecounttmp=`/bin/ls -lrt /opt/storage/ | /bin/grep $filenamewithoutpath | /usr/bin/wc -l`

    filecount=`expr $filecounttmp - 1`

    echo $filecount

    for i in `seq 0 $filecount`
    do


    suffix=`expr 0000 + $i`

    filenametoconvert="$output$suffix.flv"
    convertedfilename="$output$suffix.mp4"
    echo $filenametoconvert

    /usr/bin/ffmpeg -i $filenametoconvert -c:v libx264 -crf 23 -preset medium -vsync 1 -r 25 -c:a aac -strict -2 -b:a 64k -ar 44100 -ac 1 $convertedfilename > /dev/null 2>&1 &


    done





    sleep 5

    concatstring=""

    for j in `seq 0 $filecount`
    do


    suffix=`expr 0000 + $j`

    convertedfilenamemp4="$output$suffix.mp4"

    #concatstring=`concat:$concatstring|$convertedfilenamemp4`

    echo "file" $convertedfilenamemp4 >> $filename.txt

    #ffmpeg -i concat:"$concatstring" -codec copy $filename.mp4

    #ffmpeg -f concat -i $filename.txt -c copy $filename.mp4


    done

    echo $concatstring

    ffmpeg -f concat -i $filename.txt -c copy $filename.mp4


    rm $output*
    rm $filename.txt

    I run any flv file like this :

    ./ff.sh /opt/storage/tttttssssssssss_573f5b1cd473202daf2bf694.flv 20

    I get this error message :

    moov atom not found

    I am on Ubuntu 14.04 LTS version, standard installation of ffmpeg.