Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (71)

  • 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

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

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (13397)

  • ffmpeg link error with CodeBlocks

    12 juillet 2016, par Yoohoo

    Hi,I am currently doing a real time video encoding c program using ffmpeg, initially I encountered a lot of "undefined reference" error, after I set the linker in build options, some error got disappeared, but still some error remains.

    ||=== Build: Debug in c_3rd party encoding (compiler: GNU GCC Compiler)     ===|
    /home/yonghao/codeblocksfile/c_3rd party encoding/main.c||In function     ‘init_video_encode’:|
    /home/yonghao/codeblocksfile/c_3rd party encoding/main.c|73|warning: ‘avcodec_alloc_frame’ is deprecated (declared at ../../ffmpeg_build/include/libavcodec/avcodec.h:3618) [-Wdeprecated-declarations]|
    /home/yonghao/codeblocksfile/c_3rd party encoding/main.c||In function ‘cancle_encode’:|
    /home/yonghao/codeblocksfile/c_3rd party encoding/main.c|134|warning: ‘avcodec_free_frame’ is deprecated (declared at ../../ffmpeg_build/include/libavcodec/avcodec.h:3643) [-Wdeprecated-declarations]|
    /home/yonghao/codeblocksfile/c_3rd party encoding/main.c|21|warning: ‘endcode’ defined but not used [-Wunused-variable]|
    ../../ffmpeg_build/lib/libavcodec.a(libmp3lame.o)||In function `mp3lame_encode_frame':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|211|undefined reference to `lame_encode_buffer_float'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|195|undefined reference to `lame_encode_buffer'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|198|undefined reference to `lame_encode_buffer_int'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|219|undefined reference to `lame_encode_flush'|
    ../../ffmpeg_build/lib/libavcodec.a(libmp3lame.o)||In function `mp3lame_encode_close':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|86|undefined reference to `lame_close'|
    ../../ffmpeg_build/lib/libavcodec.a(libmp3lame.o)||In function `mp3lame_encode_init':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|98|undefined reference to `lame_init'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|102|undefined reference to `lame_set_num_channels'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|103|undefined reference to `lame_set_mode'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|106|undefined reference to `lame_set_in_samplerate'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|107|undefined reference to `lame_set_out_samplerate'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|111|undefined reference to `lame_set_quality'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|115|undefined reference to `lame_set_VBR'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|116|undefined reference to `lame_set_VBR_quality'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|120|undefined reference to `lame_set_VBR'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|121|undefined reference to `lame_set_VBR_mean_bitrate_kbps'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|123|undefined reference to `lame_set_brate'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|128|undefined reference to `lame_set_bWriteVbrTag'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|131|undefined reference to `lame_set_disable_reservoir'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|134|undefined reference to `lame_init_params'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|140|undefined reference to `lame_get_encoder_delay'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|143|undefined reference to `lame_get_framesize'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusdec.o)||In function `libopus_flush':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|178|undefined reference to `opus_multistream_decoder_ctl'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusdec.o)||In function `libopus_decode':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|143|undefined reference to `opus_multistream_decode_float'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|139|undefined reference to `opus_multistream_decode'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|148|undefined reference to `opus_strerror'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusdec.o)||In function `libopus_decode_close':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|121|undefined reference to `opus_multistream_decoder_destroy'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusdec.o)||In function `libopus_decode_init':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|87|undefined reference to `opus_multistream_decoder_create'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|91|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|97|undefined reference to `opus_multistream_decoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|99|undefined reference to `opus_strerror'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusenc.o)||In function `libopus_encode':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|346|undefined reference to `opus_multistream_encode'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|342|undefined reference to `opus_multistream_encode_float'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|351|undefined reference to `opus_strerror'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusenc.o)||In function `libopus_encode_close':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|389|undefined reference to `opus_multistream_encoder_destroy'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusenc.o)||In function `libopus_encode_init':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|254|undefined reference to `opus_multistream_encoder_create'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|260|undefined reference to `opus_strerror'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusenc.o)||In function `libopus_configure_encoder':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|117|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|119|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|124|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|127|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|130|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|132|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|135|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|138|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|141|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|144|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|149|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|152|undefined reference to `opus_strerror'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusenc.o)||In function `libopus_encode_init':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|288|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|290|undefined reference to `opus_strerror'|
    ||More errors follow but not being shown.|
    ||Edit the max errors limit in compiler options...|
    ||=== Build failed: 50 error(s), 3 warning(s) (0 minute(s), 3 second(s)) ===|

    Here are my screen shot of the CodeBlock linker setting.

    ffmpeg_build/lib/libvpx.a
    ffmpeg_build/lib/libswscale.a
    ffmpeg_build/lib/libwresample.a
    ffmpeg_build/lib/libpostproc.a
    ffmpeg_build/lib/libfdk-aac.a
    ffmpeg_build/lib/libvutil.a
    ffmpeg_build/lib/libvformat.a
    ffmpeg_build/lib/libavfilter.a
    ffmpeg_build/lib/libavdevice.a
    ffmpeg_build/lib/libavcodec.a

    Totally 10 libs.

    My Questions :

    1. Are these errors caused by lacking libs or libs not linked.
    2. What libs I missing or what libs should I add to linker.
  • Pyinstaller Hidden import 'ffmpeg-python' not found

    13 août 2024, par petunia rose

    Trying to convert Python scripts to exe with PyInstaller.

    


    In my code, I use ffmpeg-python :

    


    import ffmpeg
....
def ffmpeg_save_clip(self,output_video: str, clip_start: str, clip_end: str): 
  (ffmpeg 
   .input(self.file.get_videopath(), ) 
   .output(output_video, vcodec='copy', ss=clip_start, to=clip_end, acodec='copy') 
   .global_args('-y') 
   .run())


    


    So Ii call PyInstaller from terminal with related flag :

    


    pyinstaller --windowed --hidden-import "ffmpeg-python" --noconsole --icon=app.ico --name "app" main.py 


    


    I checked also :

    


    pip install ffmpeg-python 
Requirement already satisfied: ffmpeg-python in c:\python38\lib\site-packages (0.2.0) 
Requirement already satisfied: future in c:\python38\lib\site-packages (from ffmpeg-python) (0.18.3)


    


    But I get from PyInstaller :

    


    Hidden import 'ffmpeg-python' not found


    


    App works in visual-studio, but when I run pyinstaller exe and try to save clip, it freeze without response.

    


    Note : I also :

    


      

    1. try to add ffmpeg.exe into root folder of pyinstaller app.

      


    2. 


    3. try to use .spec file with :

      


      binaries=[('C:\\ffmpeg\\bin\\ffmpeg.exe', 'ffmpeg/),('C:\\ffmpeg\\bin\\ffplay.exe','ffplay/'), ('C:\\ffmpeg\\bin\\ffprobe.exe', 'ffprobe/')],

      


    4. 


    


    Nothing changes

    


    UPDATE
Tank you @happy_code_egg, you explained me such a things.
I tried what you said and I don't have error any more.

    


    But I can't make work ffmpeg anywhere on Pyinstaller exe.
I added a try/except block to isolate problem
(when I launch app on Visualstudio it works, but not when use exe).

    


    block is (very symilar to past def) :

    


    def ffmpeg_save_clip(self,output_video: str, clip_start: str, clip_end: str):
    input = 'C:\Users\x\Desktop\input.mp4'
    output = 'C:\Users\x\Desktop\output.mp4'
    try:
        (ffmpeg
        .input(input)
        .output(output, vcodec='copy', ss=clip_start, to=clip_end, acodec='copy')
        .global_args('-y')
        .run(capture_stdout=True))
    except Exception as e:
        self.logger.error('Video window -> ffmpeg_save_clip -> error ' + str(e))
        self.logger.error('Video window -> ffmpeg_save_clip -> input file: ' + input)
        self.logger.error('Video window -> ffmpeg_save_clip -> output file ' + output)
        raise ValueError(str(e))


    


    Note : (input and output fixed are only as simple path examples)

    


    When I open log I have :

    


    2024-08-09 11:28:50,293 - ERROR - Video window -> ffmpeg_save_clip -> error [WinError 2] File not found error
2024-08-09 11:28:50,293 - ERROR - Video window -> ffmpeg_save_clip -> input file: C:\Users\x\Desktop\input.mp4
2024-08-09 11:28:50,293 - ERROR - Video window -> ffmpeg_save_clip -> output file C:\Users\x\Desktop\ouput.mp4


    


    (I tried with '/' and also '\' to create path)
File paths are correct and, on Visualstudio, they can be processed by ffmpeg (no error), but the exe seems to not find (input or output)

    


    I tried solution described here :
Python ffmpeg won't accept path
(without effects)

    


    I found also these discussions :

    


    github ffmpeg-python issue1

    


    github ffmpeg-python issue2

    


    in both discussions seems to be a problem with ffmpeg + ffmpeg-python libs cohexistence.

    


    I tried (as said) to uninstal both and reinstall ffmpeg-python,
but nothing change.

    


    Note :
I've also three other warning during Pyinstaller :
(I write them only to complete context, but i think they have no repercussions on this problem.)

    


    57283 ERROR: Hidden import 'fiona._shim' not found
57298 WARNING: Hidden import "fiona._shim" not found!
57392 WARNING: Hidden import "importlib_resources.trees" not found!


    


    tried with :

    


    --hidden-import fiona._shim --hidden-import fiona.schema


    


    tried also with :

    


    --add-data="fiona/*;fiona”


    


    but warnings still remains.

    


  • ffmpeg stream chrome kiosk mode ubuntu 16.04 server

    15 février 2021, par Raul

    I have a weird out-of-sync issue while using ffmpeg to stream to youtube live a chrome browser from an ub untu 16.04 server.

    



    Issue : output video streamed to youtube has audio/video out of sync, sometimes with as much as 3s

    



    Current flow :

    



    1) start pulseaudio - we using something like this to start it :

    



    pulseaudio --start -vvv --disallow-exit --log-target=syslog --high-priority --exit-idle-time=-1 --daemonize


    



    2) start Xvfb

    



    Xvfb :0 -ac -screen 0 1920x1080x24


    



    3) start chrome linux in kiosk mode

    



    google-chrome --kiosk --disable-gpu --incognito --no-first-run --disable-java --disable-plugins --disable-translate --disk-cache-size=$((1024 * 1024)) --disk-cache-dir=/tmp/chrome/ --user-data-dir=/tmp/chrome/ --force-device-scale-factor=1 --window-size=1920,1080 --window-position=0,0 LOCATION_URL


    



    4) start ffmpeg

    



    ffmpeg -y \
  -thread_queue_size 8192 -rtbufsize 250M -f x11grab -video_size 1920x1080 -framerate 24 -i :0 \
  -thread_queue_size 8192 -channel_layout stereo -f alsa -i pulse \
  -c:v libx264 -pix_fmt yuv420p -c:v libx264 -g 48 -crf 24 -filter:v fps=24 -preset ultrafast -tune zerolatency \
  -c:a aac -strict -2 -channel_layout stereo -ab 96k -ac 2 -flags +global_header \
  -f flv YOUTUBE_LIVE_STREAMING_RTMP


    



    Note : this is running on an amazon ec2 instance, meaning there is no soundcard, so alsa and pulseaudio are creating a dummy audio card. However, the latency does not come from there. Logs :

    



    Nov 25 06:14:22 ip-172-31-29-8 pulseaudio[26602]: [pulseaudio] protocol-native.c: Adjust latency mode enabled, configuring sink latency to half of overall latency.
Nov 25 06:14:22 ip-172-31-29-8 pulseaudio[26602]: [pulseaudio] protocol-native.c: Requested latency=23.22 ms, Received latency=23.22 ms
Nov 25 06:14:22 ip-172-31-29-8 pulseaudio[26602]: [pulseaudio] protocol-native.c: Final latency 69.66 ms = 23.22 ms + 2*11.61 ms + 23.22 ms


    



    At this point, here's what we observed :

    



      

    1. if we start ffmpeg exactly after issuing the command to start chrome, we see the DTS errors from ffmpeg. Audio is out of sync with the video and has delay of 3-5seconds AHEAD. We also noticed the out of sync remains the same for the full duration of the stream

    2. 


    3. if we start ffmpeg after around 10seconds, audio and video are almost in sync. We then manually added a -itsoffset -0.125 to the ffmpeg command and everything is perfect.

    4. 


    



    Questions :

    



      

    1. Why would ffmpeg have so much lag if it's started right after chrome ?
    2. 


    3. Is starting the ffmpeg after 10s or X seconds the expected behavior ? That is, is this because the system needs to wait for audio/video signals to be "ready" or something ?
    4. 


    5. Is there a way to 100% calculate or know when Chrome is fully ready and start ffmpeg ? We found sometimes it takes 5s, sometimes 10. Depends on the URL we load.
    6. 


    7. Besides the DTS error that ffmpeg throws, is there any other way to know if audio/video is out-of-sync ? as sometimes we have a delay of between 0.5 to 1s, but ffmpeg does not report anything. And a restart is required to "re-balance" the audio/video inputs and get them back in sync.
    8. 


    9. Can pulseaudio be the problem in this scenario ?
    10. 


    



    Thank you

    



    UPDATE Dec 20

    



    We were able to do some tricks to force chrome to start the audio on page load, and that will force connect to pulseaudio. Doing that, plus adding a 3s delay for ffmpeg to start, there is no more delay when ffmpeg starts.
However, our app is a webRTC app, and we have a STRANGER thing happening : if we start the page with no webcam/audio, once the webcam/audio is enabled, ffmpeg (while showing no errors) has a delay of 2s or so. While keep talking, in about max 30s, that delay is GONE.

    



    So the new questions are :

    



      

    1. Besides the DTS error that ffmpeg throws, is there any other way to know if audio/video is out-of-sync ? as sometimes we have a delay of between 0.5 to 1s, but ffmpeg does not report anything.
    2. 


    3. What could cause the initial audio/video out of sync issue and then catching up ?
    4.