Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (103)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (9275)

  • pydub not encoding file correctly

    21 décembre 2019, par geoffr98

    I’m trying to use pydub to take an audio stream in opus format and save it as a wav. I am currently using a file instead of a stream and it is not working.

    My code :

    myfile = open("Short_Test.opus", 'rb')
    opus_audio_bytes = myfile.read()
    myfile.close()
    opus_data = BytesIO(opus_audio_bytes)
    sound = AudioSegment.from_file(opus_data, codec="ogg")
    print("Export now")
    mywave_file = sound.export("mashup.wav","16k")

    It does create mashup.wav, however it is not created correctly. Here is the log output from pydub :

    subprocess.call(['ffmpeg', '-y', '-i', '-', '-acodec', 'pcm_s32le', '-vn', '-f', 'wav', '-'])

    Export now

    subprocess.call(['ffmpeg', '-y', '-f', 'wav', '-i', 'C:\\Users\\Geoff\\AppData\\Local\\Temp\\tmppjaomlf6', '-f', '16k', 'C:\\Users\\Geoff\\AppData\\Local\\Temp\\tmp3tserc9q'])
    subprocess output: b'ffmpeg version git-2019-12-19-99f505d Copyright (c) 2000-2019 the FFmpeg developers'
    subprocess output: b'  built with gcc 9.2.1 (GCC) 20191125'
    subprocess output: b'  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'
    subprocess output: b'  libavutil      56. 36.101 / 56. 36.101'
    subprocess output: b'  libavcodec     58. 65.100 / 58. 65.100'
    subprocess output: b'  libavformat    58. 35.101 / 58. 35.101'
    subprocess output: b'  libavdevice    58.  9.101 / 58.  9.101'
    subprocess output: b'  libavfilter     7. 69.101 /  7. 69.101'
    subprocess output: b'  libswscale      5.  6.100 /  5.  6.100'
    subprocess output: b'  libswresample   3.  6.100 /  3.  6.100'
    subprocess output: b'  libpostproc    55.  6.100 / 55.  6.100'
    subprocess output: b'Guessed Channel Layout for Input Stream #0.0 : mono'
    subprocess output: b"Input #0, wav, from 'C:\\Users\\Geoff\\AppData\\Local\\Temp\\tmppjaomlf6':"
    subprocess output: b'  Duration: 00:00:06.90, bitrate: 1536 kb/s'
    subprocess output: b'    Stream #0:0: Audio: pcm_s32le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32, 1536 kb/s'
    subprocess output: b"[NULL @ 0000021fd2900580] Requested output format '16k' is not a suitable output format"
    subprocess output: b'C:\\Users\\Geoff\\AppData\\Local\\Temp\\tmp3tserc9q: Invalid argument'
    Traceback (most recent call last):
     File "C:/Users/Geoff/Documents/Geoff-Microsemi(Other)/Smart-OR/Savant_V1/Cobalt/G_opus_Cobalt.py", line 176, in <module>
       mywave_file = sound.export("mashup.wav","16k")
     File "C:\Users\Geoff\AppData\Local\Programs\Python\Python37\lib\site-packages\pydub\audio_segment.py", line 877, in export
       p.returncode, conversion_command, p_err))
    pydub.exceptions.CouldntEncodeError: Encoding failed. ffmpeg/avlib returned error code: 1
    </module>

    Command :[’ffmpeg’, ’-y’, ’-f’, ’wav’, ’-i’, ’C :\Users\Geoff\AppData\Local\Temp\tmppjaomlf6’, ’-f’, ’16k’, ’C :\Users\Geoff\AppData\Local\Temp\tmp3tserc9q’]

    Output from ffmpeg/avlib :

    b"ffmpeg version git-2019-12-19-99f505d Copyright (c) 2000-2019 the FFmpeg developers\r\n  built with gcc 9.2.1 (GCC) 20191125\r\n  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\r\n  libavutil      56. 36.101 / 56. 36.101\r\n  libavcodec     58. 65.100 / 58. 65.100\r\n  libavformat    58. 35.101 / 58. 35.101\r\n  libavdevice    58.  9.101 / 58.  9.101\r\n  libavfilter     7. 69.101 /  7. 69.101\r\n  libswscale      5.  6.100 /  5.  6.100\r\n  libswresample   3.  6.100 /  3.  6.100\r\n  libpostproc    55.  6.100 / 55.  6.100\r\nGuessed Channel Layout for Input Stream #0.0 : mono\r\nInput #0, wav, from 'C:\\Users\\Geoff\\AppData\\Local\\Temp\\tmppjaomlf6':\r\n  Duration: 00:00:06.90, bitrate: 1536 kb/s\r\n    Stream #0:0: Audio: pcm_s32le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32, 1536 kb/s\r\n[NULL @ 0000021fd2900580] Requested output format '16k' is not a suitable output format\r\nC:\\Users\\Geoff\\AppData\\Local\\Temp\\tmp3tserc9q: Invalid argument\r\n"

    I am confused as to why it isn’t working because the following ffmpeg command on the command line works, so I’m sure it’s my parametes in pyusb :

    ffmpeg -i Short_Test.opus -b:a 16000 mashup.wav

    Any ideas as to how to fix my problem ?

  • ffmpeg and libx264 videos do not play on video player

    24 décembre 2019, par Tobi

    for a few months now I encountered a problem using FFmpeg in combination with the video code h264. The video generation works fine and without any errors. I am using the following script since 2015 to build my videos from single pictures :

    #!/bin/bash                                                                    
    # ------------------------------------------------------------------------------
    #                                                                              
    # Video generator                                                              
    # Tobias Holzmann                                                              
    # Date: 18.03.15                                                                
    # Update: 24.12.2019                                                            
    # Switch back to ffmpeg from avconv                                            
    #                                                                              
    # ------------------------------------------------------------------------------

    frameRate=30                                                                    
    vcodec="h264"                                                                  
    crf=18              # Between 0-51; 23 is default. 0 = lossless                


    # ------------------------------------------------------------------------------

    ffmpeg \                                                                        
       -f image2 \                                                                
       -r $frameRate \                                                            
       -i animation.%4d.png \                                                      
       -r $frameRate \                                                            
       -crf $crf \                                                                
       -vcodec $vcodec \                                                          
       AVideo.flv                                                                  


    # ------------------------------------------------------------------------------

    Today I made it a bit more fancy and easier to use. However, the problem is, that all videos I generate with h264 do not play at all using the vlc player or the common Ubuntu video player. I get errors such as :

    shorty@animation: vlc AVideo.flv
    VLC media player 3.0.8 Vetinari (revision 3.0.8-0-gf350b6b5a7)
    [000055c0e70af420] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
    [NULL @ 0x7fe318c2c2a0] Invalid NAL unit size (30490 > 15039).
    [NULL @ 0x7fe318c2c2a0] missing picture in access unit with size 15733
    [h264 @ 0x7fe318c2c2a0] Invalid NAL unit size (30490 > 15039).
    [h264 @ 0x7fe318c2c2a0] Error splitting the input into NAL units.
    [00007fe324c1c420] avcodec decoder: Using NVIDIA VDPAU Driver Shared Library  430.50  Thu Sep  5 22:38:52 CDT 2019 for hardware decoding
    [h264 @ 0x7fe325428ac0] hardware accelerator failed to decode picture
    [h264 @ 0x7fe324c1fb00] hardware accelerator failed to decode picture
    [h264 @ 0x7fe324eb9d80] hardware accelerator failed to decode picture
    [h264 @ 0x7fe324ed6080] hardware accelerator failed to decode picture
    [h264 @ 0x7fe324ef2400] hardware accelerator failed to decode picture
    [h264 @ 0x7fe324f0e780] hardware accelerator failed to decode picture
    [h264 @ 0x7fe325428ac0] hardware accelerator failed to decode picture
    [h264 @ 0x7fe324c1fb00] hardware accelerator failed to decode picture
    [h264 @ 0x7fe324eb9d80] hardware accelerator failed to decode picture
    [h264 @ 0x7fe324ed6080] hardware accelerator failed to decode picture
    [h264 @ 0x7fe324ef2400] hardware accelerator failed to decode picture
    [00007fe324c1c420] main decoder error: buffer deadlock prevented
    [h264 @ 0x7fe324f0e780] hardware accelerator failed to decode picture
    ...
    ...

    I am wondering if someone does know where the problem is located. Any hint or feedback is appreciated. Thank you in advance and kind regards, Tobi.

  • AForge.Video.VideoFileWriter, Video Quality loss after a second

    29 décembre 2019, par Just another Dev

    I tried to use AForge to create mp4 video from images..but experience this quality loss after about 1 - 2 second into the video. Just wondering if anyone knows what went wrong with my code ?

    using AForge.Video.FFMPEG;
    VideoFileWriter writer = new VideoFileWriter();
    writer.Open(fileName, _width, _height, _frameRate, VideoCodec.MPEG4, 800000);
    var s = AForge.Imaging.Image.FromFile(@"[path]\image.jpg");
    int frameCount = _frameRate * scene.Time;
    for (int i = 0; i &lt; frameCount; i++)
    {
       writer.WriteVideoFrame(s);
    }
    writer.Close();

    I use the above code to create a 3 second 1080p video with frame rate 60, bit rate 800k, and using this image as an example : https://www.bushandbeach.co.nz/wp-content/uploads/2019/05/A-Taste-of-Auckland-Full-Day-1-opt.jpg

    the output video is in here : https://youtu.be/j0z7711cyOM

    as you can see the image quality seems to be ok, for about 2 seconds and then it blurs out in the last second.

    Thanks so much