Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (7)

  • L’espace de configuration de MediaSPIP

    29 novembre 2010, par

    L’espace de configuration de MediaSPIP est réservé aux administrateurs. Un lien de menu "administrer" est généralement affiché en haut de la page [1].
    Il permet de configurer finement votre site.
    La navigation de cet espace de configuration est divisé en trois parties : la configuration générale du site qui permet notamment de modifier : les informations principales concernant le site (...)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (5680)

  • -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>
  • Detect rotation angle and rotate final video using ffmpeg version 2.8

    9 novembre 2017, par Hemant Kumar

    I used to work on ffmpeg 2.2 until now and was detecting rotation angle of video uploaded from android / iPhone mobiles and rotate the resulting video so that it run perfectly on a correct angle.

    But since I have updated the ffmpeg to version 2.8 I am getting this rotation problem. My queries are not rotating the videos as they were earlier.

    Here’r the commands I was using :

    To check rotation angle :

    ffprobe -of json -show_streams {$input} | grep rotate

    below is my final command to convert a video to mp4

    "ffmpeg -i {$input} -strict -2 -vcodec libx264 -preset slow -vb 500k -maxrate 500k -bufsize 1000k -vf 'scale=-1:480 ".fix_video_orientation($input)."' -threads 0 -ab 64k -s {$resolution}  -movflags faststart -metadata:s:v:0 rotate=0 {$output}";

    "fix_video_orientation" function is given below. It detect the angle of rotation of the initial video and output optimal option for rotating the final video.

    function fix_video_orientation($input){

    $return= ", transpose=1 ";

    $dd= exec("ffprobe -of json -show_streams  {$input}   | grep rotate");

    if(!empty($dd)){

    $dd=explode(":",$dd);
    $rotate=str_replace(",","",str_replace('"',"",$dd[1]));

    if($rotate=="90")return $return;

    else if ($rotate=="180") return ", transpose=2,transpose=2 ";

    else if($rotate == "270") return ", transpose=2 ";
    }

    Currently above script is supporting "flv","avi","mp4","mkv","mpg","wmv","asf","webm","mov","3gp","3gpp" extensions, also the script is supporting the resulting .mp4 file to play on all browsers and devices.

    Now the ffprobe command is not returning rotation angle and so a portrait video if uploaded from iphone is showing as landscape on the website.

    Output console of ffprobe command :

    ffprobe version N-77455-g4707497 Copyright (c) 2007-2015 the FFmpeg developers
    built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
    configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
    libavutil 55. 11.100 / 55. 11.100
    libavcodec 57. 20.100 / 57. 20.100
    libavformat 57. 20.100 / 57. 20.100
    libavdevice 57. 0.100 / 57. 0.100
    libavfilter 6. 21.101 / 6. 21.101
    libavresample 3. 0. 0 / 3. 0. 0
    libswscale 4. 0.100 / 4. 0.100
    libswresample 2. 0.101 / 2. 0.101
    libpostproc 54. 0.100 / 54. 0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/standard/PORTRAIT.m4v':
    Metadata:
    major_brand : qt

    minor_version : 0
    compatible_brands: qt

    creation_time : 2016-02-03 05:25:18
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: iPhone 4S
    com.apple.quicktime.software: 9.2.1
    com.apple.quicktime.creationdate: 2016-02-03T10:52:11+0530
    Duration: 00:00:03.34, start: 0.000000, bitrate: 7910 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s (default)
    Metadata:
    creation_time : 2016-02-03 05:25:18
    handler_name : Core Media Data Handler
    Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x1280 [SAR 1:1 DAR 9:16], 7832 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 50 tbc (default)
    Metadata:
    creation_time : 2016-02-03 05:25:18
    handler_name : Core Media Data Handler
    encoder : H.264
    Stream #0:2(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
    creation_time : 2016-02-03 05:25:18
    handler_name : Core Media Data Handler
    Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
    creation_time : 2016-02-03 05:25:18
    handler_name : Core Media Data Handler
    Unsupported codec with id 0 for input stream 2
    Unsupported codec with id 0 for input stream 3

    If latest version of ffmpeg (2.8) is used to auto rotate the video, can you please suggest me what option I need to add or remove from my final command.