Recherche avancée

Médias (0)

Mot : - Tags -/serveur

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

Autres articles (48)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • 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.

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (9582)

  • How Much H.264 In Each Encoder ?

    8 septembre 2010, par Multimedia Mike — General

    Thanks to my recent experiments with code coverage tools, I have a powerful new — admittedly somewhat specious — method of comparing programs. For example, I am certain that I have read on more than one occasion that Apple’s H.264 encoder sucks compared to x264 due, at least in part, to the Apple encoder’s alleged inability to exercise all of H.264′s features. I wonder how to test that claim ?

    Experiment
    Use code coverage tools to determine which H.264 encoder uses the most features.

    Assumptions

    • Movie trailers hosted by Apple will all be encoded with the same settings using Apple’s encoder.
    • Similarly, Yahoo’s movie trailers will be encoded with consistent settings using an unknown encoder.
    • Encoding a video using FFmpeg’s libx264-slow setting will necessarily throw a bunch of H.264′s features into the mix (I really don’t think this assumption holds much water, but I also don’t know what “standard” x264 settings are).

    Methodology

    • Grab a random Apple-hosted 1080p movie trailer and random Yahoo-hosted 1080p movie trailer from Dave’s Trailer Page.
    • Use libx264/FFmpeg with the ‘slow’ preset to encode Big Buck Bunny 1080p from raw PNG files.
    • Build FFmpeg with code coverage enabled.
    • Decode each file to raw YUV, ignore audio decoding, generate code coverage statistics using gcovr, reset stats after each run by deleting *.gcda files.

    Results

    • x264 1080p video : 9968 / 134203 lines
    • Apple 1080p trailer : 9968 / 134203 lines
    • Yahoo 1080p trailer : 9914 / 134203 lines

    I also ran this old x264-encoded file (ImperishableNightStage6Low.mp4) through the same test. It demonstrated the most code coverage with 10671 / 134203 lines.

    Conclusions
    Conclusions ? Ha ! Go ahead and jump all over this test. I’m already fairly confident that it’s impossible (or maybe just very difficult) to build a single H.264-encoded video that exercises every feature that FFmpeg’s decoder supports. For example, is it possible for a file to use both CABAC and CAVLC entropy methods ? If it’s possible, does any current encoder do that ?

  • Why do I get UnknownValueError() speech_recognition.UnknownValueError when trying to run .recognize_google ?

    20 juillet 2022, par John Smith

    Following code is meant to transcribe a long audio file to text. It is to do this piece by piece. trimmed.wav holds a 15-second-long piece of a longer audio file (whose path is stored in fname) :

    


    #!/usr/bin/env python3

from subprocess import run
from sys import exit

italic = '\33[3m'
end = '\33[m'

try:
    from speech_recognition import AudioFile, Recognizer
except:
    run("pip3 install SpeechRecognition", shell=True)
    from speech_recognition import AudioFile, Recognizer

def transcribe_piece(fname, lang, stime):
    extension = fname[-3:]
    etime = stime + 15
    cmd = f"ffmpeg -ss {stime} -to {etime} -i {fname} -c copy trimmed.{extension} >/dev/null 2>&1"
    run(cmd, shell=True)
    cmd = f"ffmpeg -i trimmed.{extension} -f wav trimmed.wav >/dev/null 2>&1"
    run(cmd, shell=True)
    r = Recognizer()    
    af = AudioFile("trimmed.wav")
    with af as source:
        r.adjust_for_ambient_noise(source)
        audio = r.record(source)
        t = r.recognize_google(audio, language=lang)#UnknownValueError() speech_recognition.UnknownValueError
        print(f"{italic}{t}{end}")
        with open("of", "w") as f:
            f.write(f"{t}\n")
    run(f"rm trimmed.{extension}", shell=True) 
    run(f"rm trimmed.wav", shell=True)
    
    

fname = input("File name? Skip the path if the file is in CWD. The usage of ~ is allowed.\n")

lang = input("""Specify one of the following languages:
fr-BE, fr-CA, fr-FR, fr-CH

en-AU, en-CA, en-GH, en-HK, en-IN, en-IE, en-KE, en-NZ, en-PK, en-PH, en-SG, en-ZA, en-TZ, en-GB, en-US

es-AR, es-BO, es-BO, es-CL, es-CO, es-CR, es-DO, es-EC, es-SV, es-SV, es-GT, es-HN, es-MX, es-NI, es-PA, es-PY, es-PE, es-PR, es-ES, es-US, es-UY, es-VE\n""")


#for stime in range(0, 10000, 15):
#    try:
#        transcribe_piece(fname, lang, stime)
#    except:
#        run("shred -u trimmed.wav" , shell=True) 
        #run("shred -u trimmed.wav >/dev/null 2>&1" , shell=True) 
#        exit(0)
        
for stime in range(0, 10000, 15):#this loop is only for the sake of debugging, use try/except above
    transcribe_piece(fname, lang, stime)



    


    It gives me the following error :

    


    Traceback (most recent call last):&#xA;  File "/home/jim/CS/SoftwareDevelopment/MySoftware/Python/speech-to-text/long-audio-to-text.py", line 61, in <module>&#xA;    transcribe_piece(fname, lang, stime)&#xA;  File "/home/jim/CS/SoftwareDevelopment/MySoftware/Python/speech-to-text/long-audio-to-text.py", line 31, in transcribe_piece&#xA;    t = r.recognize_google(audio, language=lang)&#xA;  File "/home/jim/.local/lib/python3.10/site-packages/speech_recognition/__init__.py", line 858, in recognize_google&#xA;    if not isinstance(actual_result, dict) or len(actual_result.get("alternative", [])) == 0: raise UnknownValueError()&#xA;speech_recognition.UnknownValueError&#xA;&#xA;</module>

    &#xA;

    The said error refers to line 31, that is t = r.recognize_google(audio, language=lang).&#xA;Why do I get this error ? How might I rewrite this code so that such error does not appear ?

    &#xA;

  • ActionScript 3 FFMPEG losing Metadata of video

    12 janvier 2016, par AntBirch

    I am converting video files to the .flv format using FFMPEG so that I can use LoaderMax (GreenSocks) to play the video files. The issue is that when the video is converted with FFMPEG the metadata is lost so I cannot later on with LoaderMax get the duration or current play time with the code below.

    video.getTime();
    video.duration();

    I could get the duration of the video before converting it with FFMPEG easily enough but this doesn’t solve the issue of being able to get the current play time. My goal is to allow the user to click on the seek bar and jump to any point in the video which works but for obvious reasons I need to be able to show the current time and video length.

    I’m attempting to now use FFMPEG with something called flvtool2 which should rebuild the metadata ?

    My code currently for this :

       nativeProcessInfo = new NativeProcessStartupInfo();
       nativeProcessInfo.executable = File.applicationDirectory.resolvePath(ffmpegPath); //path to ffmpeg (included in project files)
       //nativeProcessInfo.executable = File.applicationDirectory.resolvePath(flvtool2Path); //path to flvtool2 (included in project files)

       var processArgument:Vector.<string> = new Vector.<string>(); //holds command line arguments for converting video
       processArgument.push("-i"); //filename
       processArgument.push(filePath);

       processArgument.push("-s"); //size
       processArgument.push("640x480");
       processArgument.push("-b:v"); //bitrate - video
       processArgument.push("4800k");
       processArgument.push("-b:a"); //bitrate -  
       processArgument.push("6400k");
       processArgument.push("-ar"); //audio sampling frequency
       processArgument.push("44100");
       processArgument.push("-ac"); //audio channels
       processArgument.push("2");
       processArgument.push("-ab"); //audio bitrate frequency
       processArgument.push("160k");
       processArgument.push("-f"); //force
       processArgument.push("flv");
       processArgument.push("-");

       /*processArgument.push("|");
       processArgument.push("flvtool2");
       processArgument.push("-U");
       processArgument.push("stdin");
       processArgument.push(filePath);*/

       nativeProcessInfo.arguments = processArgument;

       if (NativeProcess.isSupported) {
           nativeProcess = new NativeProcess();

           nativeProcess.start(nativeProcessInfo); //start video buffering

           nativeProcess.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, ProgressEventOutputHandler);
           nativeProcess.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, ProgressEventErrorHandler);
           nativeProcess.addEventListener(NativeProcessExitEvent.EXIT, NativeProcessExitHandler);
           nativeProcess.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, standardIOErrorHandler);
           nativeProcess.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, standardIOErrorHandler);

       } else {
           trace("!NativeProcess.isSupported");
       }
    </string></string>

    I’ve uploaded an example project to download which should help explain the problem. To use it you will need to point the ActionScript Properties to the location of Greensock to use LoaderMax and have a video somewhere on your computer to test with. The link is : http://www.prospectportal.co.uk/example.zip