Recherche avancée

Médias (91)

Autres articles (71)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (6692)

  • ffmpeg - skipping frames while watermarking

    12 août 2018, par Vaas

    I am building a video watermark utility based on ffmpeg.

    But watermarking takes considerable time. I wish to reduce the watermarking time by skipping frames while processsing.

    Is it possible to skip frames while processing video ?

    Like adding text to only every other frame ?

    ffmpeg  -i "D://sample.mp4"  -vf [in]drawtext=fontfile='C\://Windows//Fonts//Calibri.ttf':fontsize=27.9:text=www.example.com:fontcolor=#ffffff:box=1:boxcolor=0x00000099:x=w-tw-10:y=h-th-10 -y D:\watermarked.mp4
  • Fast WAV audio decoding with FFMPEG : avformat_find_stream_info is slow

    5 août 2020, par Vadim Kantorov

    I'm implementing an audio reading backend for a machine learning system. This means that decoding should be fast. Potential formats are .wav, .gsm, .opus.

    


    I've implemented audio decoding in FFMPEG : https://github.com/vadimkantorov/readaudio/blob/65f97b7/decode_audio_ffmpeg.c

    


    Currently using scipy.io.wavfile.read on a 5-second 8khz .wav file (typical file for my usecase) takes about 0.1 milliseconds. This is reasonable, because .wav format is quite simple.

    


    In my FFMPEG code, only calling avformat_find_stream_info() without decoding the packets takes about 5-6 milliseconds which can be too slow (I'm testing it on .WAV files as the first test bed to find FFMPEG's overhead) and takes the bulk of audio loading time.

    


    Does anyone know how to avoid taking this latency hit ? Is it possible to cache stream_info ? What is determining large latency ? (I tried reducing fmt_ctx->probesize / fmt_ctx->analyze_duration without success). In logs it seems that it tries to detect some mp3 format and reads too many bytes, but I know beforehand that it's wav. Is there a practical way of manually filling the stream parameters for a given known set of formats/codecs ?

    


    decode_audio_BEFORE: 0.61 msec
[wav @ 0x563667d57b60] Before avformat_find_stream_info() pos: 78 bytes read:65614 seeks:1 nb_streams:1
[wav @ 0x563667d57b60] probing stream 0 pp:32
[wav @ 0x563667d57b60] Probe with size=4096, packets=2469 detected mp3 with score=1
[wav @ 0x563667d57b60] probing stream 0 pp:31
[wav @ 0x563667d57b60] Probe with size=8192, packets=2470 detected mp3 with score=1
[wav @ 0x563667d57b60] probing stream 0 pp:30
[wav @ 0x563667d57b60] probing stream 0 pp:29
[wav @ 0x563667d57b60] Probe with size=16384, packets=2472 detected mp3 with score=1
[wav @ 0x563667d57b60] probing stream 0 pp:28
[wav @ 0x563667d57b60] probing stream 0 pp:27
[wav @ 0x563667d57b60] probing stream 0 pp:26
[wav @ 0x563667d57b60] probing stream 0 pp:25
[wav @ 0x563667d57b60] probing stream 0 pp:24
[wav @ 0x563667d57b60] probing stream 0 pp:23
[wav @ 0x563667d57b60] probing stream 0 pp:22
[wav @ 0x563667d57b60] probing stream 0 pp:21
[wav @ 0x563667d57b60] probing stream 0 pp:20
[wav @ 0x563667d57b60] probing stream 0 pp:19
[wav @ 0x563667d57b60] probing stream 0 pp:18
[wav @ 0x563667d57b60] probing stream 0 pp:17
[wav @ 0x563667d57b60] probing stream 0 pp:16
[wav @ 0x563667d57b60] probing stream 0 pp:15
[wav @ 0x563667d57b60] probing stream 0 pp:14
[wav @ 0x563667d57b60] probing stream 0 pp:13
[wav @ 0x563667d57b60] probing stream 0 pp:12
[wav @ 0x563667d57b60] probed stream 0
[wav @ 0x563667d57b60] parser not found for codec pcm_s16le, packets or times may be invalid.
[wav @ 0x563667d57b60] After avformat_find_stream_info() pos: 80078 bytes read:145614 seeks:1 frames:20
decode_audio_AFTER: 7.90 msec


    


    This problem is well-known, but I couldn't find a workaround so far :

    


    


  • Audio to text is slow and words are getting dropped

    8 mars 2019, par Madhur Yadav

    I have a code which takes videos from an input folder, converts it into audio file(.wav) using ffmpeg.
    It then converts the audio file to text by recording 30 seconds audio (dura=30) and converting it to text using google translate api.

    The problem is that the code takes a lot of time to convert video to text and it drops first two words and some words after every 30 seconds.

    import speech_recognition as sr
    import sys
    import shutil
    from googletrans import Translator
    from pathlib import Path
    import os
    import wave
    def audio_to_text(self,video_lst,deploy_path,video_path,audio_path):
       try:
           txt_lst=[]
           for video_file in video_lst:
               file_part=video_file.split('.')
               audio_path_mod = audio_path +'/'+ '.'.join(file_part[:-1])
               dir_path=video_path+'.'.join(file_part[:-1])
               self.createDirectory(audio_path_mod)
               audio_file='.'.join(file_part[:-1])+'.wav'
               command_ffmpeg='set PATH=%PATH%;'+deploy_path.replace('config','script')+'audio_video/ffmpeg/bin/'
               command='ffmpeg -i '+video_path+'/'+video_file+' '+audio_path_mod+'/'+audio_file
               os.system(command_ffmpeg)
               os.system(command)
               r=sr.Recognizer()
               dura=30
               lang='en'
               wav_filename=audio_path_mod+'/'+audio_file

               f = wave.open(wav_filename, 'r')
               frames = f.getnframes()
               rate = f.getframerate()
               audio_duration = frames / float(rate)
               final_text_lst=[]
               counter=0

               with sr.AudioFile(wav_filename) as source:
                   while countercode>

    Any help/suggestion would be valuable. Thanks in advance.