Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

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

Autres articles (48)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

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

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

Sur d’autres sites (4581)

  • libaomenc : fix profile setting

    29 mars 2018, par James Almer
    libaomenc : fix profile setting
    

    Main Profile is yuv420p 8 and 10 bit
    High Profile is yuv444p 8 and 10 bit
    Professional Profile is yuv422p 8, 10, and 12 bit, plus every other pixfmt at 12 bit

    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DBH] libavcodec/libaomenc.c
  • pydub.exceptions.CouldntDecodeError : Decoding failed. ffmpeg returned error code : 1

    9 avril, par azail765

    This script will work on a 30 second wav file but not a 10 minutes phone call also in wav format. Any help would be appreciated

    &#xA;

    I've downloaded ffmpeg.

    &#xA;

    # Import necessary libraries &#xA;from pydub import AudioSegment &#xA;import speech_recognition as sr &#xA;import os&#xA;import pydub&#xA;&#xA;&#xA;chunk_count = 0&#xA;directory = os.fsencode(r&#x27;C:\Users\zach.blair\Downloads\speechRecognition\New folder&#x27;)&#xA;# Text file to write the recognized audio &#xA;fh = open("recognized.txt", "w&#x2B;")&#xA;for file in os.listdir(directory):&#xA;     filename = os.fsdecode(file)&#xA;     if filename.endswith(".wav"):&#xA;        chunk_count &#x2B;= 1&#xA;             # Input audio file to be sliced &#xA;        audio = AudioSegment.from_file(filename,format="wav") &#xA;          &#xA;        &#x27;&#x27;&#x27; &#xA;        Step #1 - Slicing the audio file into smaller chunks. &#xA;        &#x27;&#x27;&#x27;&#xA;        # Length of the audiofile in milliseconds &#xA;        n = len(audio) &#xA;          &#xA;        # Variable to count the number of sliced chunks &#xA;        counter = 1&#xA;          &#xA;         &#xA;          &#xA;        # Interval length at which to slice the audio file. &#xA;        interval = 20 * 1000&#xA;          &#xA;        # Length of audio to overlap.  &#xA;        overlap = 1 * 1000&#xA;          &#xA;        # Initialize start and end seconds to 0 &#xA;        start = 0&#xA;        end = 0&#xA;          &#xA;        # Flag to keep track of end of file. &#xA;        # When audio reaches its end, flag is set to 1 and we break &#xA;        flag = 0&#xA;          &#xA;        # Iterate from 0 to end of the file, &#xA;        # with increment = interval &#xA;        for i in range(0, 2 * n, interval): &#xA;              &#xA;            # During first iteration, &#xA;            # start is 0, end is the interval &#xA;            if i == 0: &#xA;                start = 0&#xA;                end = interval &#xA;          &#xA;            # All other iterations, &#xA;            # start is the previous end - overlap &#xA;            # end becomes end &#x2B; interval &#xA;            else: &#xA;                start = end - overlap &#xA;                end = start &#x2B; interval  &#xA;          &#xA;            # When end becomes greater than the file length, &#xA;            # end is set to the file length &#xA;            # flag is set to 1 to indicate break. &#xA;            if end >= n: &#xA;                end = n &#xA;                flag = 1&#xA;          &#xA;            # Storing audio file from the defined start to end &#xA;            chunk = audio[start:end] &#xA;          &#xA;            # Filename / Path to store the sliced audio &#xA;            filename = str(chunk_count)&#x2B;&#x27;chunk&#x27;&#x2B;str(counter)&#x2B;&#x27;.wav&#x27;&#xA;          &#xA;            # Store the sliced audio file to the defined path &#xA;            chunk.export(filename, format ="wav") &#xA;            # Print information about the current chunk &#xA;            print(str(chunk_count)&#x2B;str(counter)&#x2B;". Start = "&#xA;                                &#x2B;str(start)&#x2B;" end = "&#x2B;str(end)) &#xA;          &#xA;            # Increment counter for the next chunk &#xA;            counter = counter &#x2B; 1&#xA;              &#xA;          &#xA;            AUDIO_FILE = filename &#xA;            &#xA;            # Initialize the recognizer &#xA;            r = sr.Recognizer() &#xA;          &#xA;            # Traverse the audio file and listen to the audio &#xA;            with sr.AudioFile(AUDIO_FILE) as source: &#xA;                audio_listened = r.listen(source) &#xA;          &#xA;            # Try to recognize the listened audio &#xA;            # And catch expections. &#xA;            try:     &#xA;                rec = r.recognize_google(audio_listened) &#xA;                  &#xA;                # If recognized, write into the file. &#xA;                fh.write(rec&#x2B;" ") &#xA;              &#xA;            # If google could not understand the audio &#xA;            except sr.UnknownValueError: &#xA;                    print("Empty Value") &#xA;          &#xA;            # If the results cannot be requested from Google. &#xA;            # Probably an internet connection error. &#xA;            except sr.RequestError as e: &#xA;                print("Could not request results.") &#xA;          &#xA;            # Check for flag. &#xA;            # If flag is 1, end of the whole audio reached. &#xA;            # Close the file and break.                  &#xA;fh.close()    &#xA;

    &#xA;

    I get this error on audio = AudioSegment.from_file(filename,format="wav") :

    &#xA;

    Traceback (most recent call last):&#xA;  File "C:\Users\zach.blair\Downloads\speechRecognition\New folder\speechRecognition3.py", line 17, in <module>&#xA;    audio = AudioSegment.from_file(filename,format="wav")&#xA;  File "C:\Users\zach.blair\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pydub\audio_segment.py", line 704, in from_file&#xA;    p.returncode, p_err))&#xA;pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1&#xA;</module>

    &#xA;

    Output from ffmpeg/avlib :

    &#xA;

      ffmpeg version N-95027-g8c90bb8ebb Copyright (c) 2000-2019 the FFmpeg developers&#xA;  built with gcc 9.2.1 (GCC) 20190918&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 35.100 / 56. 35.100&#xA;  libavcodec     58. 58.101 / 58. 58.101&#xA;  libavformat    58. 33.100 / 58. 33.100&#xA;  libavdevice    58.  9.100 / 58.  9.100&#xA;  libavfilter     7. 58.102 /  7. 58.102&#xA;  libswscale      5.  6.100 /  5.  6.100&#xA;  libswresample   3.  6.100 /  3.  6.100&#xA;  libpostproc    55.  6.100 / 55.  6.100&#xA;Guessed Channel Layout for Input Stream #0.0 : mono&#xA;Input #0, wav, from &#x27;2a.wav.wav&#x27;:&#xA;  Duration: 00:09:52.95, bitrate: 64 kb/s&#xA;    Stream #0:0: Audio: pcm_mulaw ([7][0][0][0] / 0x0007), 8000 Hz, mono, s16, 64 kb/s&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (pcm_mulaw (native) -> pcm_s8 (native))&#xA;Press [q] to stop, [?] for help&#xA;[wav @ 0000024307974400] pcm_s8 codec not supported in WAVE format&#xA;Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented&#xA;Error initializing output stream 0:0 -- &#xA;Conversion failed!&#xA;

    &#xA;

  • Video capturing in portrait mode but the orientation is wrong when played back with a media player

    17 octobre 2016, par Ahmed Mujtaba

    I’m trying to make a custom video app. The app captures a video using mediarecorder and uploads it to the website where it’s played on a html5 media player. The issue is that, when I capture the video in portrait mode, the playback video on the website and on vlc player have it’s orientation off by 90 degrees. I have tried various solution on the internet but none work for me.

    Here’s what my code for setting up the media recorder :

    private bool prepareMediaRecorder() {

           Android.Hardware.Camera.Parameters p = mCamera.GetParameters();
           List previewSizes = p.SupportedPreviewSizes.ToList();

           //mCamera = GetCameraInstance();
           //setCameraDisplayOrientation(Activity, cameraId, mCamera);

           mediaRecorder = new MediaRecorder();
           mCamera.Unlock();
           mediaRecorder.SetCamera(mCamera);

           mediaRecorder.SetAudioSource(AudioSource.Camcorder);
           mediaRecorder.SetVideoSource(VideoSource.Camera);
           mediaRecorder.SetOrientationHint(CameraS.result);

           if (currentapiVersion >= 16)
           {
               mediaRecorder.SetProfile(CamcorderProfile.Get(CamcorderQuality.High)); // requires API Level 8 or higher
           }
           else
           {
               mediaRecorder.SetProfile(CamcorderProfile.Get(CamcorderQuality.Q480p)); // requires API Level 8 or higher
           }

           //mediaRecorder.SetVideoFrameRate(30);
           mediaRecorder.SetOutputFile(localPath);
           mediaRecorder.SetMaxDuration(600000); // Set max duration 60 sec.
           mediaRecorder.SetMaxFileSize(50000000); // Set max file size 50M
           mediaRecorder.SetVideoSize(previewSizes[0].Width, previewSizes[0].Height);
           mediaRecorder.SetPreviewDisplay(mPreview.Holder.Surface);

           mediaRecorder.SetOrientationHint(getDisplayOrientationAngle());

           try
           {
               mediaRecorder.Prepare();
           }
           catch (IllegalStateException e)
           {
               releaseMediaRecorder();
               return false;
           }
           catch (Java.IO.IOException e)
           {
               releaseMediaRecorder();
               return false;
           }
           return true;

    }

    public int getDisplayOrientationAngle() {
           //Log.e("", "setDisplayOrientationAngle is call");
           int angle;


           var mDisplayRotation = Activity.WindowManager.DefaultDisplay.Rotation;
           // switch (MeasurementNativeActivity.DisplayRotation) {
           switch (mDisplayRotation)
           {
               case SurfaceOrientation.Rotation0: // This is display orientation
                   angle = 90; // This is camera orientation
                   break;
               case SurfaceOrientation.Rotation90:
                   angle = 0;
                   break;
               case SurfaceOrientation.Rotation180:
                   angle = 270;
                   break;
               case SurfaceOrientation.Rotation270:
                   angle = 180;
                   break;
               default:
                   angle = 90;
                   break;
           }
           //Log.v("", "media recorder displayRotation: " + mDisplayRotation);
           //Log.v("", "media recorder angle: " + angle);
           return angle;

    }

    The orientation of the video is fine when played on the phone app but on the website it’s not. I tried to use FFMPEG encoder to rotate the video clockwise. This seemed to fix the orientation of the video, however the aspect ratio of the video is all messed up. The video is stretched vertically and goes off screen.
    The command I’m using to rotate and encode the video is as follows :

    -y -i inputPath -vf scale=640:480,setsar=1,transpose=1 -strict experimental -r 25 -vcodec mpeg4 -b 1000k ab 48000 -ac 2 -ar 22050 destinationPath

    I will really appreciate if someone can help me fix either the orientation of the video or the aspect ration after encoding the video.

    Cheers !

    Edit.

    Here’s the readout of the input file :

    General
    Complete name                  : C:\Users\Ahmed\Desktop\9adcdb56-500e-4d3f-8fb2-ccf20c680422_yt.mp4
    Format                         : MPEG-4
    Format profile                 : Base Media
    Codec ID                       : isom
    File size                      : 6.30 MiB
    Duration                       : 12s 437ms
    Overall bit rate               : 4 251 Kbps
    Encoded date                   : UTC 2016-05-29 23:54:30
    Tagged date                    : UTC 2016-05-29 23:54:30

    Video
    ID                             : 1
    Format                         : AVC
    Format/Info                    : Advanced Video Codec
    Format profile                 : Baseline@L3.1
    Format settings, CABAC         : No
    Format settings, ReFrames      : 1 frame
    Format settings, GOP           : M=1, N=31
    Codec ID                       : avc1
    Codec ID/Info                  : Advanced Video Coding
    Duration                       : 12s 323ms
    Bit rate                       : 3 967 Kbps
    Width                          : 1 280 pixels
    Height                         : 720 pixels
    Display aspect ratio           : 16:9
    Rotation                       : 90°
    Frame rate mode                : Variable
    Frame rate                     : 29.700 fps
    Minimum frame rate             : 29.354 fps
    Maximum frame rate             : 30.040 fps
    Color space                    : YUV
    Chroma subsampling             : 4:2:0
    Bit depth                      : 8 bits
    Scan type                      : Progressive
    Bits/(Pixel*Frame)             : 0.145
    Stream size                    : 5.83 MiB (92%)
    Title                          : VideoHandle
    Language                       : English
    Encoded date                   : UTC 2016-05-29 23:54:30
    Tagged date                    : UTC 2016-05-29 23:54:30

    Audio
    ID                             : 2
    Format                         : AAC
    Format/Info                    : Advanced Audio Codec
    Format profile                 : LC
    Codec ID                       : 40
    Duration                       : 12s 437ms
    Source duration                : 12s 454ms
    Bit rate mode                  : Constant
    Bit rate                       : 128 Kbps
    Nominal bit rate               : 96.0 Kbps
    Channel(s)                     : 2 channels
    Channel positions              : Front: L R
    Sampling rate                  : 48.0 KHz
    Compression mode               : Lossy
    Stream size                    : 194 KiB (3%)
    Source stream size             : 194 KiB (3%)
    Title                          : SoundHandle
    Language                       : English
    Encoded date                   : UTC 2016-05-29 23:54:30
    Tagged date                    : UTC 2016-05-29 23:54:30
    mdhd_Duration                  : 12454