Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (65)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (6828)

  • -12909 error decoding h264 stream with intra-refresh

    2 juillet 2024, par ciclopez

    I'm making an iOS app that decodes an h264 stream using video-toolbox. I create the stream with ffmpeg on a PC and send it to an iPhone using RTP. It's working nicely when I use this command to create it :

    



    ffmpeg -y -f:v rawvideo -c:v rawvideo -s 1280x720 -pix_fmt bgra -r 30 -an -i - -pix_fmt yuv420p -c:v libx264 -tune zerolatency -preset fast -b:v 5M -refs 1 -g 30 -profile:v high -level 4.1 -f rtp rtp://192.168.1.100:5678


    



    The iPhone receives and displays all the frames. However, when I enable intra-refresh

    



    -intra-refresh 1


    



    decoding fails with error code -12909 (-8969 on simulator) when VTDecompressionSessionDecodeFrame() is called.

    



    I take care of processing UDP packets to extract NAL Units, so I triple checked this process and discarded a problem with this part of the code.

    



    I didn't find any info about Video-toolbox not supporting intra-refresh, so the question is, does Video-toolbox support intra-refresh ? and if it does, am I missing something in the ffmpeg side that makes the stream not supported by Video-toolbox ?
Do I have to add something to the CMVideoFormatDescriptionRef apart from creating it with SPS and PPS data using CMVideoFormatDescriptionCreateFromH264ParameterSets() ?

    


  • FFMPEG command from Python 3.5 does not actually create audio file

    20 décembre 2017, par Nathan Blaine

    I have a Django web application that accepts user uploaded videos/audio and saves them into a folder ’../WebAppDirectory/media/recordings’.

    I am then using a speech to text API to get a rough transcription of the audio. This is working fine for .wav and .mp4 files, but the web app also accepts videos (.MOV) that I would like to first convert to .wav, then pass off to the API.

    Using ffmpeg from my command line like this

    ffmpeg -i C:\Users\Nathan\Desktop\MeetingRecorderWebAPP\media\recordings\upload_sample.MOV -ab 160k -ac 2 -ar 44100 -vn upload_sample.wav

    Correctly creates the .wav file from the original .MOV.

    However, when I run this from python with

    subprocess.check_call(command, shell=True)

    ffmpeg responds with

    File ’upload_sample.wav’ already exists. Overwrite ? [y/N]

    While Python tells me

    FileNotFoundError : [Errno 2] No such file or directory : ’C :\Users\Nathan\Desktop\MeetingRecorderWebAPP\media\recordings\upload_sample.wav’

    It is also worth noting that I do not see a ’upload_sample.wav’ file in the media/recordings/ directory.

    This leads me to believe that maybe Python and ffmpeg are looking in different folders, but I am not sure where I am going wrong. When I print the command from the subprocess.check_call and copy/paste it into cmd, the file is created as expected.

    Hoping someone with some experience with ffmpeg/Python subprocess can help shed some light ! Here are the files I am working with :

    Folder Structure

    DjangoWebApp
    |---media
    |---|---imgs
    |---|---recordings
    |---|---|---upload_sample.MOV
    |---uploaded_audio_to_text.py

    uploaded_audio_to_text.py

    import speech_recognition as sr
    from os import path
    import os
    import subprocess


    def speech_to_text(file_name):
       AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), 'media','recordings', file_name)
       print("Looking at path: ",AUDIO_FILE)
       # get extension
       AUDIO_FILE_EXT = os.path.splitext(AUDIO_FILE)[1]

       if(AUDIO_FILE_EXT == '.MOV'):
           print("File is not .wav: ", AUDIO_FILE_EXT, "found. Converting...")
           # We will use subprocess and ffmpeg to convert this .MOV file to .wav, so we can send to API
           temp_wav = os.path.splitext(file_name)[0] + '.wav'
           print("New audio file will be: ", temp_wav)
           # build CMD ffmpeg command
           command = "ffmpeg -i "
           command += AUDIO_FILE
           command += " -ab 160k -ac 2 -ar 44100 -vn "
           command += temp_wav

           print("Attempting to run this command: \n",command)
           print(subprocess.check_call(command, shell=True))
           print("Past Subprocess.call")
           AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), 'media','recordings', temp_wav)
           print("AUDIO_FILE now set to: ", AUDIO_FILE)

       else:
           # continue with what we are doing
           pass


       r = sr.Recognizer()
       with sr.AudioFile(AUDIO_FILE) as source:
           audio = r.record(source)  # read the entire audio file
           text_transcription = "Sentinel"
           # recognize speech using Microsoft Bing Voice Recognition
           BING_KEY = "MY_KEY_:)"
           try:
               text_transcription = r.recognize_bing(audio, key=BING_KEY)
           except sr.UnknownValueError:
               print("Microsoft Bing Voice Recognition could not understand audio")
           except sr.RequestError as e:
               print("Could not request results from Microsoft Bing Voice Recognition service; {0}".format(e))

       return text_transcription


    #my tests
    my_relative_file_path = "upload_sample.MOV"
    print(speech_to_text(my_relative_file_path))

    Console output (traceback and my print()’s)

    Looking at path:  C:\Users\Nathan\Desktop\MeetingRecorderWebAPP\media\recordings\upload_sample.MOV
    File is not .wav:  .MOV found. Converting...
    New audio file will be:  upload_sample.wav Attempting to run this command:
    ffmpeg -i C:\Users\Nathan\Desktop\MeetingRecorderWebAPP\media\recordings\upload_sample.MOV -ab 160k -ac 2 -ar 44100 -vn upload_sample.wav
    ffmpeg version git-2017-12-18-74f408c Copyright (c) 2000-2017 the FFmpeg developers   built with gcc 7.2.0 (GCC)  
    ----REMOVED SOME FFMPEG OUTPUT FOR BREVITY----
    File 'upload_sample.wav' already exists. Overwrite ? [y/N] y
    Stream mapping:   Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, wav, to 'upload_sample.wav':   Metadata:
       major_brand     : qt  
       minor_version   : 0
       compatible_brands: qt  
       com.apple.quicktime.creationdate: 2017-12-19T16:06:10-0500
       com.apple.quicktime.make: Apple
       com.apple.quicktime.model: iPhone 6
       com.apple.quicktime.software: 10.3.3
       ISFT            : Lavf58.3.100
       Stream #0:0(und): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s (default)
       Metadata:
         creation_time   : 2017-12-19T21:06:11.000000Z
         handler_name    : Core Media Data Handler
         encoder         : Lavc58.8.100 pcm_s16le size=    1036kB time=00:00:06.01 bitrate=1411.3kbits/s speed=N/A     video:0kB audio:1036kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.007352%
    0
    Traceback (most recent call last): Past Subprocess.call  
    File "C:\Users\Nathan\Desktop\MeetingRecorderWebAPP\uploaded_audio_to_text.py", line 53, in <module>
    AUDIO_FILE now set to:  C:\Users\Nathan\Desktop\MeetingRecorderWebAPP\media\recordings\upload_sample.wav
       print(speech_to_text(my_relative_file_path))  
    File "C:\Users\Nathan\Desktop\MeetingRecorderWebAPP\uploaded_audio_to_text.py", line 36, in speech_to_text
       with sr.AudioFile(AUDIO_FILE) as source:  
    File "C:\Users\Nathan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\speech_recognition\__init__.py", line 203, in __enter__
       self.audio_reader = wave.open(self.filename_or_fileobject, "rb")  
    File "C:\Users\Nathan\AppData\Local\Programs\Python\Python36-32\lib\wave.py", line 499, in open
       return Wave_read(f)  
    File "C:\Users\Nathan\AppData\Local\Programs\Python\Python36-32\lib\wave.py", line 159, in __init__
       f = builtins.open(f, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Nathan\\Desktop\\MeetingRecorderWebAPP\\media\\recordings\\upload_sample.wav'

    Process finished with exit code 1
    </module>
  • FFmpeg - selecting appropriate bitrate for VP9 encoding

    11 janvier 2018, par fastily

    I am looking to encode a 4k video shot with iPhone 6s in VP9 in the best quality possible.

    For reference, stream data of the video I would like to encode, via ffprobe :

    Duration: 00:00:10.48, start: 0.000000, bitrate: 46047 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 3840x2160, 45959 kb/s, 29.98 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
       Metadata:
         creation_time   : 2017-03-13T21:12:56.000000Z
         handler_name    : Core Media Data Handler
         encoder         : H.264
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 79 kb/s (default)
       Metadata:
         creation_time   : 2017-03-13T21:12:56.000000Z
         handler_name    : Core Media Data Handler

    I am using the following FFmpeg commands, based on these instructions (see Best Quality (Slowest) Recommended Settings section).

    1. ffmpeg -i INPUT.mov -c:v libvpx-vp9 -pass 1 -b:v 46000K -threads 4 -speed 4 -g 9999 -an -f webm -y /dev/null
    2. ffmpeg -I INPUT.mov -c:v libvpx-vp9 -pass 2 -b:v 46000K -threads 4 -speed 0 -g 9999 -an -f webm OUTPUT.webm

    Is there a best practice to select an optimal -b:v value such that the resulting video is visually indistinguishable from the original ? I have tried values ranging from 36000K-46000K, but these result in massive files with an overall bitrate exceeding the target bitrate.

    Thanks in advance !