Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (86)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

Sur d’autres sites (7225)

  • Using ffmpeg on Ubuntu, how can the audio and video from an audio-video USB capture device be recorded ?

    11 avril 2022, par BlandCorporation

    I have a USB audio-video capture device, something used to digitize video cassettes. I want to record both the video and audio from the device to a video file that has dimensions 720x576 and video codec H.264 and good audio quality.

    


    I am able to record video from the device using ffmpeg and I am able to see video from the device using MPlayer. I am able also to see that audio is being delivered from the device to the computer by looking at Input tab of the Sound Preferences window or by recording the audio using Audacity, however the audio gets delivered from the device apparently only when the video is being accessed using ffmpeg or MPlayer.

    


    I have tried to get ffmpeg to record the audio and I have tried to get MPlayer to play the audio and my efforts have not been successful.

    


    The device is "Pinnacle Dazzle DVC 90/100/101" (as returned by v4l2-ctl --list-devices). The sound cards listing shows it as "DVC100" :

    


    $ cat /proc/asound/cards 
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0x601d118000 irq 171
 1 [DVC100         ]: USB-Audio - DVC100
                      Pinnacle Systems GmbH DVC100 at usb-0000:00:14.0-4, high speed
29 [ThinkPadEC     ]: ThinkPad EC - ThinkPad Console Audio Control
                      ThinkPad Console Audio Control at EC reg 0x30, fw N2LHT33W


    


    The PulseAudio listing for the device is as follows :

    


    $ pactl list cards short
0   alsa_card.pci-0000_00_1f.3  module-alsa-card.c
14  alsa_card.usb-Pinnacle_Systems_GmbH_DVC100-01   module-alsa-card.c


    


    The following ffmpeg command successfully records video, but records severely distorted, broken and out-of-sync audio :

    


    ffmpeg -y -f rawvideo -f alsa -thread_queue_size 2048 -ar 48000 -i hw:0 \
    -c:a aac -video_size 720x576 -pixel_format uyvy422 -i /dev/video2 out.mp4


    


    The following MPlayer command successfully displays the video but does not play the audio :

    


    mplayer -tv driver=v4l2:norm=PAL:device=/dev/video2:width=720:height=576 \
    -ao alsa:device=hw=1.0 -vf pp=lb tv://


    


    Now, when the above MPlayer command is running (not the ffmpeg command) and displaying the input video in a window, Audacity can be opened and set recording audio, and it records the audio from the device clearly and in good quality. While Audacity is doing this, the input device is listed in pavucontrol as "Dazzle DVC Audio Device Analogue Stereo". Equivalently, arecord can be used also to record the audio using the following command (with output shown) :

    


    $ arecord -vv -D plughw:DVC100 -fdat out.wav
Recording WAVE 'out.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Plug PCM: Hardware PCM card 1 'DVC100' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 24000
  period_size  : 6000
  period_time  : 125000
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 6000
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 24000
  silence_threshold: 0
  silence_size : 0
  boundary     : 6755399441055744000
  appl_ptr     : 0
  hw_ptr       : 0


    


    Looking at the output of arecord -L, I tried a variety of audio device input names with ffmpeg and none of them seemed to work. So, for example, I tried commands like the following :

    


    ffmpeg -y -f rawvideo -f alsa -i plughw:DVC100 \
    -video_size 720x576 -pixel_format uyvy422 -i /dev/video2 out.mp4


    


    And tried the following audio device names :

    


    plughw:DVC100
plughw:CARD=DVC100,DEV=0
hw:CARD=DVC100,DEV=0
plughw:CARD=DVC100
sysdefault:CARD=DVC100
iec958:CARD=DVC100,DEV=0
dsnoop:CARD=DVC100,DEV=0


    


    So, how might I get ffmpeg to record the audio successfully to the video file ? Is there some alternative approach to this problem ?

    



    


    EDIT : The relevant output from the command pactl list sources is as follows :

    


    Source #20
    State: SUSPENDED
    Name: alsa_input.usb-Pinnacle_Systems_GmbH_DVC100-01.analog-stereo
    Description: Dazzle DVC100 Audio Device Analogue Stereo
    Driver: module-alsa-card.c
    Sample Specification: s16le 2ch 48000Hz
    Channel Map: front-left,front-right
    Owner Module: 45
    Mute: no
    Volume: front-left: 99957 / 153% / 11.00 dB,   front-right: 99957 / 153% / 11.00 dB
            balance 0.00
    Base Volume: 35466 /  54% / -16.00 dB
    Monitor of Sink: n/a
    Latency: 0 usec, configured 0 usec
    Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
    Properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "USB Audio"
        alsa.id = "USB Audio"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "1"
        alsa.card_name = "DVC100"
        alsa.long_card_name = "Pinnacle Systems GmbH DVC100 at usb-0000:00:14.0-4, high speed"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:00:14.0-usb-0:4:1.1"
        sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.1/sound/card1"
        udev.id = "usb-Pinnacle_Systems_GmbH_DVC100-01"
        device.bus = "usb"
        device.vendor.id = "2304"
        device.vendor.name = "Pinnacle Systems, Inc."
        device.product.id = "021a"
        device.product.name = "Dazzle DVC100 Audio Device"
        device.serial = "Pinnacle_Systems_GmbH_DVC100"
        device.string = "front:1"
        device.buffering.buffer_size = "352800"
        device.buffering.fragment_size = "176400"
        device.access_mode = "mmap+timer"
        device.profile.name = "analog-stereo"
        device.profile.description = "Analogue Stereo"
        device.description = "Dazzle DVC100 Audio Device Analogue Stereo"
        alsa.mixer_name = "USB Mixer"
        alsa.components = "USB2304:021a"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-usb"
    Ports:
        analog-input-linein: Line In (priority: 8100)
    Active Port: analog-input-linein
    Formats:
        pcm


    


    I tested the name from this with ffmpeg (version 4.3.1, compiled with -enable-libpulse) in the following way :

    


    ffmpeg -y -f video4linux2 -f pulse \
    -i alsa_input.usb-Pinnacle_Systems_GmbH_DVC100-01.analog-stereo \
    -video_size 720x576 -pixel_format uyvy422 -i /dev/video2 out.mp4


    


    Unfortunately this hasn't worked.

    


  • Live jpeg sequence image to RTMP fps drop

    6 avril 2021, par m0j1

    I want to encode a sequence of jpg images (captured from my camera in unity) to h264 codec live stream video. I'm using the following command in ffmpeg :

    


    -f image2pipe -vcodec mjpeg -r 25 -i  udp://127.0.0.1:6000  -r 25 -preset slow -vcodec libx264 -tune zerolatency -b:v 800k -maxrate 800k -bufsize 400k  -f mpegts udp://127.0.0.1:5701


    


    On the other side, I playback this live stream using ffplay (ffplay -fflags nobuffer -flags low_delay -framedrop udp ://192.168.189.112:5701) and everything seems to be fine.
    
After that, I want to use a media server to restream this to other clients so I chose node media server and with the following ffmpeg comment I stream my image sequence to my media server :

    


    -f image2pipe -vcodec mjpeg -r 25 -i  udp://127.0.0.1:6000  -r 25 -preset slow -vcodec libx264 -tune zerolatency -b:v 800k -maxrate 800k -bufsize 400k  -f flv rtmp://192.168.189.112/live/STREAM_NAME


    


    But when I use ffplay to playback this live stream using the following command I get a choppy stream that looks like it is in 5fps :

    


    ffplay -fflags nobuffer -flags low_delay -framedroprtmp://192.168.189.112/live/STREAM_NAME

 


    


    I also tried to first record my live stream using node media server and then play it to see if I had received the data right and surprisingly the recorded video is perfect.

    
I wanted to ask if someone has any tips or experience about this.

    


  • Merge image, audio, video with no audio, video with audio, with ffmpeg

    17 février 2021, par Basj

    Similarly to Merge videos and images using ffmpeg (which is not a duplicate for the reasons explained below), I'd like to merge multiple inputs which can be either :

    


      

    • image only,
    • 


    • audio only,
    • 


    • video with audio,
    • 


    • video without audio
    • 


    


    into one output video, with stereo audio.

    


    Note : If multiple audio channels are playing at the same time, they should be mixed ; idem for video : the images from multiple sources should overlap.

    


    I tried this (comments added here) :

    


    ffmpeg 
  -i tmp/%04d.png       # [0]
  -f lavfi -t 0.1 -i anullsrc   # [1], if needed for inputs without sound?
  -i a.mp3              # [2], we keep 1 sec. from it; should start at 0'05" in output video
  -i b.mp3              # [3], we keep 2 sec. from it; should start at 0'06" in output video
  -i with_sound.mp4     # [4], we keep 3 sec. from it; should start at 0'07" in output video
  -i without_sound.mp4  # [5], we keep 4 sec. from it; should start at 0'08" in output video
  -filter_complex 
    [2]atrim=start=0:duration=1.0,asetpts=PTS-STARTPTS[s2];[s2]adelay=5000|5000[t2];
    [3]atrim=start=0:duration=2.0,asetpts=PTS-STARTPTS[s3];[s3]adelay=6000|6000[t3];
    [4]atrim=start=0:duration=3.0,asetpts=PTS-STARTPTS[s4];[s4]adelay=7000|7000[t4];
    [5]atrim=start=0:duration=4.0,asetpts=PTS-STARTPTS[s5];[s5]adelay=8000|8000[t5];
    [0][1][t2][t3][t4][t5]concat=n=6:a=1:v=1:unsafe=1[outv][outa]
  -map [outv] -map [outa] out.mp4


    


    I tried with various values concat=n=5, n=6, etc. and added unsafe=1, but I always get similar errors :

    


    


    [Parsed_adelay_2 @ 00000000006e8140] Media type mismatch between the 'Parsed_adelay_2' filter output pad 0 (audio) and the 'Parsed_concat_6' filter input pad 2 (video)
    
[AVFilterGraph @ 00000000006923c0] Cannot create the link adelay:0 -> concat:2

    


    


    or for the times I got it nearly working, the videos were added one after another and not merged / mixed.

    


    Also, I'm looking for a syntax that would work even if I don't know in advance if the input videos have or don't have audio (I'm doing a script and I don't know in advance if the videos have audio channels).

    



    


    TL ;DR :

    


    Question : How to mix/merge multiple inputs (image, audio, video with-or-without-sound) with ffmpeg, with a precise starting timestamp for each, into a single video output ?