Recherche avancée

Médias (0)

Mot : - Tags -/albums

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

Autres articles (16)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (2971)

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

    


  • ffmpeg stream input sdp shows warning keyframe missing

    27 mars 2021, par Doua Beri

    I'm using ffmpeg 4.3.2.
I'm trying to forward a stream to a rtmp server having sdp file as input

    


    Opening the sdp file with VLC everything is working great. The same thing happens when I use ffplay

    


    ffplay -i rtp-forwarder.sdp -protocol_whitelist file,udp,rtp


    


    The problem starts when I start streaming to a rtmp server. The audio is good but the video is just a black screen. I event tried to stream to youtube rtmp server but it didn't work.

    


    I'm new to ffmpeg. Let me know if I'm missing something.

    


    I'm using this command

    


    ffmpeg -protocol_whitelist file,crypto,udp,rtp -re -i rtp-forwarder.sdp -c:v libx264 -b:v 3000k -maxrate 3000k -bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 -ar 44100 -f flv rtmp://localhost/live/test


    


    The sdp file content is like this

    


    v=0
o=- 0 0 IN IP4 192.168.1.49
s=Pion WebRTC
c=IN IP4 192.168.1.49
t=0 0
m=audio 4000 RTP/AVP 111
a=rtpmap:111 OPUS/48000/2
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000


    


    Here is a full log

    


      libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[sdp @ 0000015a81ede6c0] Keyframe missing
Input #0, sdp, from 'rtp-forwarder.sdp':
  Metadata:
    title           : Pion WebRTC
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
    Stream #0:1: Video: vp8, yuv420p(tv, bt470bg/unknown/unknown), 640x480, 90k tbr, 90k tbn, 90k tbc
Stream mapping:
  Stream #0:1 -> #0:0 (vp8 (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (opus (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0000015a81f9e880] MB rate (108000000) > level limit (16711680) -0.0kbits/s speed=N/A
[libx264 @ 0000015a81f9e880] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0000015a81f9e880] profile High, level 6.2, 4:2:0, 8-bit
[libx264 @ 0000015a81f9e880] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=50 keyint_min=5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=cbr mbtree=1 bitrate=3000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=3000 vbv_bufsize=6000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://localhost/live/test':
  Metadata:
    title           : Pion WebRTC
    encoder         : Lavf58.45.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 640x480, q=-1--1, 3000 kb/s, 90k fps, 1k tbn, 90k tbc
    Metadata:
      encoder         : Lavc58.91.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 3000000/0/3000000 buffer size: 6000000 vbv_delay: N/A
    Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 160 kb/s
    Metadata:
      encoder         : Lavc58.91.100 aac
[flv @ 0000015a820dd200] Failed to update header with correct duration..1kbits/s speed=   1x
[flv @ 0000015a820dd200] Failed to update header with correct filesize.
frame=   13 fps=0.1 q=-1.0 Lsize=    4233kB time=00:03:07.12 bitrate= 185.3kbits/s speed=0.999x
video:440kB audio:3658kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.281771%
[libx264 @ 0000015a81f9e880] frame I:1     Avg QP: 1.61  size: 59263
[libx264 @ 0000015a81f9e880] frame P:3     Avg QP: 9.10  size: 44500
[libx264 @ 0000015a81f9e880] frame B:9     Avg QP: 9.80  size: 28605
[libx264 @ 0000015a81f9e880] consecutive B-frames:  7.7%  0.0%  0.0% 92.3%
[libx264 @ 0000015a81f9e880] mb I  I16..4: 36.5% 19.5% 44.0%
[libx264 @ 0000015a81f9e880] mb P  I16..4: 10.7% 50.3% 12.3%  P16..4: 11.6%  9.6%  5.5%  0.0%  0.0%    skip: 0.1%
[libx264 @ 0000015a81f9e880] mb B  I16..4:  2.2% 10.4%  3.6%  B16..8: 45.7% 21.2%  6.1%  direct:10.6%  skip: 0.1%  L0:60.0% L1:25.5% BI:14.5%
[libx264 @ 0000015a81f9e880] final ratefactor: 13.03
[libx264 @ 0000015a81f9e880] 8x8 transform intra:56.7% inter:41.9%
[libx264 @ 0000015a81f9e880] coded y,uvDC,uvAC intra: 90.9% 99.6% 98.9% inter: 66.1% 99.0% 93.2%
[libx264 @ 0000015a81f9e880] i16 v,h,dc,p: 23% 22% 18% 38%
[libx264 @ 0000015a81f9e880] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 26% 23%  4%  2%  3%  3%  4%  4%
[libx264 @ 0000015a81f9e880] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 34% 18%  2%  2%  2%  2%  2%  2%
[libx264 @ 0000015a81f9e880] i8c dc,h,v,p: 55% 29% 11%  5%
[libx264 @ 0000015a81f9e880] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0000015a81f9e880] ref P L0: 59.2%  5.0% 13.4% 22.4%
[libx264 @ 0000015a81f9e880] ref B L0: 87.1%  7.5%  5.4%
[libx264 @ 0000015a81f9e880] ref B L1: 95.1%  4.9%
[libx264 @ 0000015a81f9e880] kb/s:4028.74
[aac @ 0000015a81f9a880] Qavg: 7535.380


    


    I get this warning [sdp @ 0000015a81ede6c0] Keyframe missing
and this one after a stop it

    


    [flv @ 0000015a820dd200] Failed to update header with correct duration..1kbits/s speed=   1x
[flv @ 0000015a820dd200] Failed to update header with correct filesize.


    


  • pydub.exceptions.CouldntDecodeError : Couldn't find fmt header in wav data

    26 mai 2021, par Jaswanth

    I am trying to make an audiofile into chunks and converting into text but, pydub is refusing to read my wav file.
Here is the code

    


    #from speakerDiarization import main,fmtTime
from pydub import AudioSegment
import os
from speech_to_text import wav_to_text

meet_audio = 'UK.wav'
out_file = r'test.txt'
#spkrs = main(meet_audio)

spkrs = {0: [{'start': 0, 'stop': 6000}, {'start': 15000, 'stop': 15500}], 
1: [{'start': 6000, 'stop': 11000}, {'start': 15500, 'stop': 18500}, {'start':27500, 'stop': 34500}], 
2: [{'start': 11000, 'stop': 15000}, {'start': 18500, 'stop': 27500}, {'start': 34500, 'stop': 41000}]}

new_dict = {}
for spkr in spkrs:
    for i in range(len(spkrs[spkr])):
        new_dict[spkrs[spkr][i]['start']] = [spkr,i]
new_dict = sorted(new_dict)

audio = AudioSegment(meet_audio)

for i in new_dict:
    spkr,ind = new_dict[i][0],new_dict[i][1]
    start,end = spkrs[spkr][ind]['start'],spkrs[spkr][ind]['stop']
    chunk = audio[start:end]
    chunk_file = 'Chunks\chunk'+str(spkr)+str(ind)+'.wav'
    chunk.export(chunk_file,format='.wav')
    wav_to_text(chunk_file,out_file,spkr)


    


    output :

    


    (sprk-diaz) H:\Btech-Proj\Speaker_Diarization>split_audio.py&#xA;H:\Btech-Proj\Speaker_Diarization\sprk-diaz\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn&#x27;t find ffmpeg or avconv - defaulting to ffmpeg, but may not work&#xA;  warn("Couldn&#x27;t find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)&#xA;Traceback (most recent call last):&#xA;  File "H:\Btech-Proj\Speaker_Diarization\split_audio.py", line 20, in <module>&#xA;    audio = AudioSegment(meet_audio)&#xA;  File "H:\Btech-Proj\Speaker_Diarization\sprk-diaz\lib\site-packages\pydub\audio_segment.py", line 222, in __init__&#xA;    wav_data = read_wav_audio(data)&#xA;  File "H:\Btech-Proj\Speaker_Diarization\sprk-diaz\lib\site-packages\pydub\audio_segment.py", line 114, in read_wav_audio&#xA;    raise CouldntDecodeError("Couldn&#x27;t find fmt header in wav data")&#xA;pydub.exceptions.CouldntDecodeError: Couldn&#x27;t find fmt header in wav data&#xA;</module>

    &#xA;

    I don't know what's wrong, can some solve this please.&#xA;Thank you.

    &#xA;

    My audiofile : around 40sec

    &#xA;