Recherche avancée

Médias (0)

Mot : - Tags -/flash

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

Autres articles (66)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Diogene : création de masques spécifiques de formulaires d’édition de contenus

    26 octobre 2010, par

    Diogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
    A quoi sert ce plugin
    Création de masques de formulaires
    Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
    Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)

Sur d’autres sites (5367)

  • ffmpeg concatenating videos of different fps while keeping the total length not changed

    23 novembre 2017, par A_Matar

    I wanna pad an mp4 video stream with another video clip of a static image that I created using :

    def generate_white_vid (duration):
       output_filename = os.path.join(p_path,'white_vid_'+" 0:.2f}".format(duration)+'.mp4')
       ffmpeg_create_vid_from_static_img = 'ffmpeg -loop 1 -i /path/WhiteBackground.jpg -c:v libx264 -t %f -pix_fmt yuv420p -vf scale=1920:1080 %s' % (duration, output_filename)
       p = subprocess.Popen(ffmpeg_create_vid_from_static_img, shell=True)
       p.communicate()
       return output_filename

    I use the following to concatenate :

    def concat_vids(clip_paths):
       filenames_txt = open('clips_to_join.txt','w')
       for clip in clip_paths:
           filenames_txt.write ('file \''+ clip+'\'\n')
       filenames_txt.close()
       output_filename = clip_paths[0].split('.', 2)[0]
       output_file_path = os.path.join(root_path, output_filename+'-padded.mp4')
       # join the clips
       ffmpeg_command = ["ffmpeg", "-f", "concat", "-safe", "0", "-i", "clips_to_join.txt", "-codec", "copy", output_file_path] # output_filename = ch0X-start_time-end_time
       p = subprocess.Popen(ffmpeg_command)
       p.communicate() # wait till the subprocess finishes. You can send commands to process as well.
       return output_file_path

    When I check the length of the resulting video after concatenation, I find that it is not equal to the sum of the two segments that I concatenated, and sometimes it is even less by some seconds !!

    Here is how I get the video length in seconds :

    def ffmpeg_len(vid_path):
       '''
       Returns length in seconds using ffmpeg
       '''
       ffmpeg_get_mediafile_length = ['sh', '-c', 'ffmpeg -i "$1" 2>&1 | grep Duration', '_', vid_path]
       p = subprocess.Popen(ffmpeg_get_mediafile_length, stdout=subprocess.PIPE, stderr=subprocess.PIPE)    
       output, err = p.communicate()
       length_regexp = 'Duration: (\d{2}):(\d{2}):(\d{2})(\.\d+),'
       re_length = re.compile(length_regexp)
       matches = re_length.search(output)
       if matches:
           video_length = int(matches.group(1)) * 3600 + \
                           int(matches.group(2)) * 60 + \
                           int(matches.group(3)) + float(matches.group(4))
           return video_length
       else:
           print("Can't determine video length.")
           print err
           raise SystemExit

    My guess is that maybe the concatenation unifies the fps rate for the all the clips to be joined, if this is the case, how to prevent this from happening ? How can I get a video of the desired length exactly.

    Maybe it worth mentioning that the video to padded is very short 0.42 second, the original video is 210.58 and the resultant video is 210.56 !

    I have verified that ffmpeg does generate the desired padding region and it is of the desired length 0.42 I got a 0.43 segment when I forced 30 fps but it is okay.

  • Restart ffmpeg process using monit if TOTAL CPU is less than 1%

    28 mai 2017, par user2201239

    I have used kind of similar solution like this Restarting ffmpeg process using monit to restart my ffmpeg stream in case it fails for some reason. Remember its not duplicate problem/question, because I have other issues unlike the example question/solution Restarting ffmpeg process using monit, which I’m gonna explain below. So here is my monit configuration :

       check process FFMPEGStream with pidfile PATH-to-file/streampid.pid
       start program = "PATH-to-file/streambash.sh restart"
       stop program = "PATH-to-file/streambash.sh stop"
       if TOTAL CPU is less than 1% for 10 cycles then restart

    Here is my streambash.sh file :

       #!/bin/bash
       pid_file="PATH-to-file/streampid.pid"

       case "$1" in
        restart)
           PATH-to-file/streambash.sh stop
           PATH-to-file/streambash.sh start
              ;;

        start)
           rm $pid_file
           /usr/bin/ffmpeg -i "INPUT-PATH" -c:v libx264 -b:v 900k -preset ultrafast -aspect 16:9 -s 640x376 -strict experimental -c:a aac -b:a 96k -f flv "RTMP-PATH" &> /dev/null &
           ch_pid=$!
           echo "Start Stream1: ffmpeg = $ch_pid";
           echo $ch_pid > $pid_file
              ;;

        stop)
           echo "Stop ffmpeg Stream1";
           kill `cat $pid_file` &> /dev/null
              ;;

        *)
           echo "Usage: PATH-to-file/streambash.sh {start|stop|restart}"
           exit 1
              ;;

        esac
       exit 0
       echo $pid_file

    Monit can start the bash file successfully, but when this condition "if TOTAL CPU is less than 1% for 10 cycles then restart" is matched in monit configuration, it tries to restart, it gives error that process is not running. But in actual the ffmpeg process still runs in the background and I can see that the stream is live on my website. Here is monit logs :

       [CET Jan 10 12:55:02] error    : 'FFMPEGStream' total cpu usage of 0.4% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:07] error    : 'FFMPEGStream' total cpu usage of 0.0% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:12] error    : 'FFMPEGStream' total cpu usage of 0.0% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:17] error    : 'FFMPEGStream' total cpu usage of 0.4% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:22] error    : 'FFMPEGStream' total cpu usage of 0.9% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:27] error    : 'FFMPEGStream' total cpu usage of 0.9% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:32] error    : 'FFMPEGStream' total cpu usage of 0.0% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:37] error    : 'FFMPEGStream' total cpu usage of 0.0% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:42] error    : 'FFMPEGStream' total cpu usage of 0.0% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:47] error    : 'FFMPEGStream' total cpu usage of 0.4% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:50] info     : 'FFMPEGStream' trying to restart
       [CET Jan 10 12:55:50] info     : 'FFMPEGStream' stop: PATH-to-file/streambash.sh
       [CET Jan 10 12:55:51] info     : 'FFMPEGStream' start: PATH-to-file/streambash.sh
       [CET Jan 10 12:55:56] error    : 'FFMPEGStream' process is not running
       [CET Jan 10 12:55:58] info     : 'FFMPEGStream' trying to restart
       [CET Jan 10 12:55:58] info     : 'FFMPEGStream' start: PATH-to-file/streambash.sh
       [CET Jan 10 12:56:04] error    : 'FFMPEGStream' process is not running
       [CET Jan 10 12:56:04] info     : 'FFMPEGStream' trying to restart
       [CET Jan 10 12:56:04] info     : 'FFMPEGStream' start: PATH-to-file/streambash.sh
       [CET Jan 10 12:56:09] error    : 'FFMPEGStream' process is not running
       [CET Jan 10 12:56:09] info     : 'FFMPEGStream' trying to restart
       [CET Jan 10 12:56:09] info     : 'FFMPEGStream' start: PATH-to-file/streambash.sh

    Monit keeps trying to restart the process and on each retry, it dumps a new pid to the PATH-to-file/streampid.pid, but as I said it seems, it somehow can stop the actual ffmpeg stream/pid, which keep running in the background.

  • Avisynth total frames does not equal VirtualDub total frames

    7 mai 2017, par Corpuscular

    It appears that Dissolve and/or Fade change the total number of frames in .avs scripts. When I add up the total number of frames in the avs script and then load the avs script in Vdub the total number of frames is different. My real world example below shows a difference of 822 frames vs 1368 frames for the same script. I have run some basic tests which appear to support this hypothesis. Of course I may be doing something stupid. Any guidance would be greatly appreciated. Please let me know if I can clarify anything. Ffmpeg also borks on the same script which leads me to think this is an Avisynth issue. Or my lack of avs coding skills.

    System specs :
    Win7,
    FFmpeg version : 20170223-dcd3418 win32 shared,
    AVISynth version : 2.6

    Test1.avs = 200 frames long = Expected behaviour

    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24, start=1, end=100)
    v2=ImageReader("2.png", fps=24, start=1, end=100)
    video = v1 + v2
    return video

    Test2.avs with return Dissolve = 195 frames long = Unexpected behaviour

    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24, start=1, end=100)
    v2=ImageReader("2.png", fps=24, start=1, end=100)
    return Dissolve(v1, v2, 5)

    Test3.avs with fadeOut(fadeIn = 202 frames long = Unexpected behaviour

    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24, start=1, end=100)
    v2=ImageReader("2.png", fps=24, start=1, end=100)
    fadeOut(fadeIn(v1 + v2, 60), 60)

    Test4.avs with dissolve and fade = 197 frames long = Unexpected behaviour

    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24, start=1, end=100)
    v2=ImageReader("2.png", fps=24, start=1, end=100)
    v3 = Dissolve(v1, v2, 5)
    fadeOut(fadeIn(v3, 60), 60)

    Test5.avs explicity specifying frame rates on dissolve and fade = 197 frames = Unexpected behaviour

    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24, start=1, end=100)
    v2=ImageReader("2.png", fps=24, start=1, end=100)
    v3 = Dissolve(v1, v2, 5, 24)
    fadeOut(fadeIn(v3, 60, $000000, 24), 60, $000000, 24)

    realExample = 822 frames long = Expected behaviour (this is what I want)

    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24).trim(1,106)
    v3=ImageReader("3.png", fps=24).trim(1,471)
    v9=ImageReader("9.png", fps=24).trim(1,58)
    v10=ImageReader("10.png", fps=24).trim(1,35)
    v11=ImageReader("11.png", fps=24).trim(1,152)
    video = v1 + v3 + v9 + v10 + v11
    return video

    realExample = 1368 frames long

    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24).trim(1,106)
    v3=ImageReader("3.png", fps=24).trim(1,471)
    v9=ImageReader("9.png", fps=24).trim(1,58)
    v10=ImageReader("10.png", fps=24).trim(1,35)
    v11=ImageReader("11.png", fps=24).trim(1,152)
    d1 = Dissolve(v1, v3, 5)
    d3 = Dissolve(v3, v9, 5)
    d9 = Dissolve(v9, v10, 5)
    d10 = Dissolve(v10, v11, 5)
    fadeOut(fadeIn(d1 + d3 + d9 + d10,60),60)