
Recherche avancée
Autres articles (52)
-
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez 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 (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang 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. -
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa 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 (5802)
-
multiple GPU encoding use FFMPEG under multiple threads environment
8 septembre 2022, par shenuoHere is the application situation.
I want use 4 NV GPUs to carry out some calculation work (CUDA based), and encoding work (FFMPEG &NVEC), it works fine when they are in serial. But when I want them to be parallel. like this


void encodingwork(){
 #pragma omp parallel for num_threads(4)
 for (int i = 0; i < 4; i++) {
 cudaSetDevice(i);
 encodingwork();
 }
 }

 int main(){
 thread thd;
 for (int k = 0; k < N; k++) {
#pragma omp parallel for num_threads(4)
 for (int i = 0; i < 4; i++) {
 cudaSetDevice(i);
 cudawork();
 }
 if (k != 0)
 thd.join();
 thd = thread(encodingwork);
 }
 thd.join();
 }



an error will be thrown out from ffmpeg. just like


[AVHWDeviceContext @ 000002334959ac80] cu->cuMemFree((CUdeviceptr)data) failed -> CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered

[hevc_nvenc @ 00000230c956b200] EncodePicture failed!: generic error (20):
Error sending a frame for encoding: -1313558101 (Unknown error occurred)



can anybody tell me what's wrong with this ?


-
how to record camera to file while encoding stream to v4l2-loopback device ?
3 février 2021, par JonatasSo i have this logitech c920 camera 1920x1080 h264 capable and i would like to record the camera to file while at the same time copying/encoding the stream to a loopback device so the camera can be still used by other apps.
here is the code i got so far :


ffmpeg -report -f alsa -i hw:CARD=C920,DEV=0 -r 1500 -s 1920x1080 -f v4l2 -vcodec h264 \
-i /dev/video1 -copyinkf -vcodec copy /home/jonatas/Videos/2021-02-01185658.mp4 \ 
-f v4l2 /dev/video0



error :


Unknown V4L2 pixel format equivalent for yuvj420p
Could not write header for output file #1 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 1:0 -- 



some info on /dev/video0(loopbackdevice) :


v4l2-ctl -d /dev/video0

 Device Caps : 0x05208003
 Video Capture
 Video Output
 Video Memory-to-Memory
 Read/Write
 Streaming
 Extended Pix Format
Priority: 0
Video input : 0 (loopback: ok)
Video output: 0 (loopback in)
Format Video Output:
 Width/Height : 1280/720
 Pixel Format : 'YUYV' (YUYV 4:2:2)
 Field : None
 Bytes per Line : 2560
 Size Image : 1843200
 Colorspace : sRGB
 Transfer Function : Default (maps to sRGB)
 YCbCr/HSV Encoding: Default (maps to ITU-R 601)
 Quantization : Default (maps to Limited Range)
 Flags : 
Streaming Parameters Video Capture:
 Frames per second: 30.000 (30/1)
 Read buffers : 8
Streaming Parameters Video Output:
 Frames per second: 30.000 (30/1)
 Write buffers : 8

User Controls

 keep_format 0x0098f900 (bool) : default=0 value=0
 sustain_framerate 0x0098f901 (bool) : default=0 value=0
 timeout 0x0098f902 (int) : min=0 max=100000 step=1 default=0 value=0
 timeout_image_io 0x0098f903 (bool) : default=0 value=0



some info on my camera in /dev/video1


v4l2-ctl -d /dev/video1 --all
Driver Info:
 Driver name : uvcvideo
 Card type : HD Pro Webcam C920
 Bus info : usb-0000:00:14.0-7.2
 Driver version : 5.4.78
 Capabilities : 0x84a00001
 Video Capture
 Metadata Capture
 Streaming
 Extended Pix Format
 Device Capabilities
 Device Caps : 0x04200001
 Video Capture
 Streaming
 Extended Pix Format
Media Driver Info:
 Driver name : uvcvideo
 Model : HD Pro Webcam C920
 Serial : EC6C336F
 Bus info : usb-0000:00:14.0-7.2
 Media version : 5.4.78
 Hardware revision: 0x00000011 (17)
 Driver version : 5.4.78
Interface Info:
 ID : 0x03000002
 Type : V4L Video
Entity Info:
 ID : 0x00000001 (1)
 Name : HD Pro Webcam C920
 Function : V4L2 I/O
 Flags : default
 Pad 0x01000007 : 0: Sink
 Link 0x0200001f: from remote pad 0x100000a of entity 'Processing 3': Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
 Width/Height : 1280/720
 Pixel Format : 'H264' (H.264)
 Field : None
 Bytes per Line : 2560
 Size Image : 1843200
 Colorspace : sRGB
 Transfer Function : Default (maps to sRGB)
 YCbCr/HSV Encoding: Default (maps to ITU-R 601)
 Quantization : Default (maps to Full Range)
 Flags : 
Crop Capability Video Capture:
 Bounds : Left 0, Top 0, Width 1280, Height 720
 Default : Left 0, Top 0, Width 1280, Height 720
 Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height 720, Flags: 
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height 720, Flags: 
Streaming Parameters Video Capture:
 Capabilities : timeperframe
 Frames per second: 30.000 (30/1)
 Read buffers : 0
 brightness 0x00980900 (int) : min=0 max=255 step=1 default=128 value=128
 contrast 0x00980901 (int) : min=0 max=255 step=1 default=128 value=128
 saturation 0x00980902 (int) : min=0 max=255 step=1 default=128 value=128
 white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
 gain 0x00980913 (int) : min=0 max=255 step=1 default=0 value=255
 power_line_frequency 0x00980918 (menu) : min=0 max=2 default=2 value=2
 0: Disabled
 1: 50 Hz
 2: 60 Hz
 white_balance_temperature 0x0098091a (int) : min=2000 max=6500 step=1 default=4000 value=3233 flags=inactive
 sharpness 0x0098091b (int) : min=0 max=255 step=1 default=128 value=128
 backlight_compensation 0x0098091c (int) : min=0 max=1 step=1 default=0 value=0
 exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
 1: Manual Mode
 3: Aperture Priority Mode
 exposure_absolute 0x009a0902 (int) : min=3 max=2047 step=1 default=250 value=333 flags=inactive
 exposure_auto_priority 0x009a0903 (bool) : default=0 value=0
 pan_absolute 0x009a0908 (int) : min=-36000 max=36000 step=3600 default=0 value=0
 tilt_absolute 0x009a0909 (int) : min=-36000 max=36000 step=3600 default=0 value=0
 focus_absolute 0x009a090a (int) : min=0 max=250 step=5 default=0 value=0
 focus_auto 0x009a090c (bool) : default=1 value=0
 zoom_absolute 0x009a090d (int) : min=100 max=500 step=1 default=100 value=100



if i remove the 3rd line of my script the camera records the stream of video and sound to the file flawless. i tried diferent things for the 3rd line as -vcodec and something to do with pix-format flag to YUYV without success.
Is it possible to achieve this with just one ffmpeg process ?
Will the sound be made available to the loopback device also ?
How to transcode it to the proper pixel format used by loopback device ?


-
Using ffmpeg on Ubuntu, how can the audio and video from an audio-video USB capture device be recorded ?
11 avril 2022, par BlandCorporationI 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.