Recherche avancée

Médias (0)

Mot : - Tags -/inscription3

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

Autres articles (111)

  • MediaSPIP Player : les contrôles

    26 mai 2010, par

    Les contrôles à la souris du lecteur
    En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (15351)

  • Video recorded from a webcam using FFmpeg is desynchronizing in iOS native player

    11 mars 2021, par Luuudo

    Objective

    


    I am trying to record a video (duration ≈ 1min to 4hours) from a webcam plugged into a PC. Then play just after the end of the recording the video on an Ipad connected to the same network as the PC.

    


    To do this I'm trying to record the video using ffmpeg (the detailed command I use is below). Then I serve the video that's on the PC to the Ipad via a Java server (The server works well with other videos so I don't think the problem is here).

    


    Problem

    


    When I play the video on the IPad native player, for example in Safari, the sound is going faster than the video and therefore it's desynchronizing from the video. If I request a certain time the video and audio re-sync then the audio is desynchronizing again while playing.

    


      

    • The video when played on VLC on the PC or on Firefox by requesting the server is well synced.
    • 


    • Another video (I downloaded this one to test) played on the Ipad from the server stay synced.
    • 


    


    It is only with the combination of a video record by myself using FFmpeg played in the iOS native player that I can observe the desynchronization.

    


    FFmpeg command

    


    I use FFmpeg to record the video from the webcam and save it into a file format readable on iOS.

    


    ffmpeg -y -f avfoundation -framerate 25 -pixel_format nv12 -video_size 1280x720 -i "0:0" -r 25 out.mp4


    


    The resulting recorded file info according to ffmpeg is below :

    


    > ffmpeg -i out.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
  Duration: 00:00:33.76, start: 0.000000, bitrate: 1510 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 1440 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 61 kb/s (default)
    Metadata:
      handler_name    : SoundHandler


    


    Compatible video formats from TV and Video iPad Pro specs

    


    


    Video formats supported : H.264 video up to 4K, 30 frames per second, High Profile level 4.2 with AAC‑LC audio up to 160 Kbps, 48kHz, stereo audio or Dolby Audio up to 1008 Kbps, 48kHz, stereo or multichannel audio, in .m4v, .mp4, and .mov file formats ; MPEG‑4 video up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC‑LC audio up to 160 Kbps per channel, 48kHz, stereo audio or Dolby Audio up to 1008 Kbps, 48kHz, stereo or multichannel audio, in .m4v, .mp4, and .mov file formats ; Motion JPEG (M‑JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format

    


    


    I don't see what codecs or profiles I don't respect ?

    


    ps : I write PC but I'm currently trying this on a Mac. Eventually, I want to be able to do it also on Linux or even Windows. It looks like I just have to change the input devices to do that, which is avfoundation for MacOS.

    


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

    


  • "Could not demultiplex stream" in loading Video recorded by Opencv's VideoWriter

    21 novembre 2020, par batuman

    My program is

    



    int main(){&#xA;    cout &lt;&lt; "Start the process" &lt;&lt; endl;&#xA;    cv::VideoCapture vcap("rtsp://root:pass@192.168.0.90/axis-media/media.amp?camera=1");&#xA;    cout &lt;&lt; "Camera connection done!" &lt;&lt; endl;&#xA;    cv::Mat image, small;&#xA;    //Output video&#xA;    cv::Size S = cv::Size((int) vcap.get(CV_CAP_PROP_FRAME_WIDTH), (int) vcap.get(CV_CAP_PROP_FRAME_HEIGHT));&#xA;    int ex = static_cast<int>(vcap.get(CV_CAP_PROP_FOURCC));&#xA;    int fps = vcap.get(CV_CAP_PROP_FPS);&#xA;    cout &lt;&lt; "fps " &lt;&lt; fps &lt;&lt; " ex " &lt;&lt; ex &lt;&lt; endl;&#xA;    cv::VideoWriter outputVideo;&#xA;    outputVideo.open("TEST.avi", ex/*CV_FOURCC(&#x27;X&#x27;, &#x27;2&#x27;, &#x27;6&#x27;, &#x27;4&#x27;)*/, vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;    if(!outputVideo.isOpened()){&#xA;        cout &lt;&lt; "Could not open the output video for write" &lt;&lt; endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    for(;;){&#xA;        if(!vcap.read(image)){&#xA;            std::cout &lt;&lt; "No frame" &lt;&lt; std::endl;&#xA;            cv::waitKey(0);&#xA;        }&#xA;&#xA;        cv::resize(image, small, image.size()/2, 0, 0 , cv::INTER_LINEAR);&#xA;        cv::imshow("Display", small);&#xA;        cv::waitKey(1);&#xA;        outputVideo.write(small);&#xA;        if(getkey() == &#x27;\n&#x27;)&#xA;            break;&#xA;    }&#xA;    cout &lt;&lt; "Camera release" &lt;&lt; endl;&#xA;    outputVideo.release();&#xA;    vcap.release();&#xA;    image.release();&#xA;    small.release();&#xA;    return 0;&#xA;}&#xA;</int>

    &#xA;&#xA;

    int ex = static_cast<int>(vcap.get(CV_CAP_PROP_FOURCC));</int> ex is 0 here.

    &#xA;&#xA;

    I can record the TEST.avi, but can't be read by cv::VideoCapture vcap("TEST.avi") ; or VLC player or Videos in Ubuntu.&#xA;The error is "Could not demultiplex stream".

    &#xA;&#xA;

    If I changed to

    &#xA;&#xA;

    outputVideo.open("TEST.avi", CV_FOURCC(&#x27;X&#x27;, &#x27;2&#x27;, &#x27;6&#x27;, &#x27;4&#x27;), vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;outputVideo.open("TEST.avi", CV_FOURCC(&#x27;P&#x27;,&#x27;I&#x27;,&#x27;M&#x27;,&#x27;1&#x27;), vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;outputVideo.open("TEST.avi", CV_FOURCC(&#x27;M&#x27;, &#x27;P&#x27;, &#x27;4&#x27;, &#x27;2&#x27;), vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;etc.&#xA;

    &#xA;&#xA;

    all have same problem.

    &#xA;&#xA;

    If I set

    &#xA;&#xA;

    outputVideo.open("TEST.avi", CV_FOURCC(&#x27;i&#x27;, &#x27;Y&#x27;, &#x27;U&#x27;, &#x27;V&#x27;), vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;

    &#xA;&#xA;

    I have error as Opencv: FFMPEG iYUV is not supported with codec id 14

    &#xA;&#xA;

    For

    &#xA;&#xA;

    outputVideo.open("TEST.avi", CV_FOURCC(&#x27;M&#x27;, &#x27;J&#x27;, &#x27;P&#x27;, &#x27;G&#x27;), vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;&#xA;&#xA;OpenCV Error: Assertion failed (img.cols == width &amp;&amp; img.rows == height &amp;&amp; chann&#xA;els == 3) in write, file /home/Softwares/opencv/opencv/modules/videoio/src/&#xA;cap_mjpeg_encoder.cpp, line 829&#xA;terminate called after throwing an instance of &#x27;cv::Exception&#x27;&#xA;  what():  /home/Softwares/opencv/opencv/modules/videoio/src/cap_mjpeg_enco&#xA;der.cpp:829: error: (-215) img.cols == width &amp;&amp; img.rows == height &amp;&amp; channels =&#xA;= 3 in function write&#xA;

    &#xA;&#xA;

    What could be wrong ? Is that my FFMPEG has problem ?

    &#xA;