
Recherche avancée
Autres articles (69)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (7659)
-
UVC webcam with ffplay outputs only noise ?
1er mars 2024, par Abdulla Masud(My end goal is to use a UVC webcam with esp32 or raspberry pi. I was hoping to learn while doing some fun projects.)


I have an old UVC webcam (Creative model ct6840) but I can't seem to get it to work with
ffplay
. I have tried looking through the documentation and other questions here but nothing is working for me. So far I have only been able to achieve a noisy-jittery output.

Running
ffplay -f rawvideo -video_size 670x480 /dev/video1
, I get :



Can someone help me understand how to make the camera work with
ffplay
?

The following is the information of my webcam :


$ ffmpeg -f v4l2 -list_formats all -i /dev/video2


[video4linux2,v4l2 @ 0x17eb3c0] Compressed: Unsupported : GSPCA OV511 : 320x240 640x480



$ v4l-info /dev/video2


### v4l2 device info [/dev/video2] ###
general info
 VIDIOC_QUERYCAP
 driver : "ov519"
 card : "USB Camera (05a9:0511)"
 bus_info : "usb-0000:00:14.0-8.2"
 version : 6.1.79
 capabilities : 0x85200001 [VIDEO_CAPTURE,?,READWRITE,STREAMING,(null)]

standards

inputs
 VIDIOC_ENUMINPUT(0)
 index : 0
 name : "ov519"
 type : CAMERA
 audioset : 0
 tuner : 0
 std : 0x0 []
 status : 0x0 []

video capture
 VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
 index : 0
 type : VIDEO_CAPTURE
 flags : 1
 description : "GSPCA OV511"
 pixelformat : 0x3131354f [O511]
 VIDIOC_G_FMT(VIDEO_CAPTURE)
 type : VIDEO_CAPTURE
 fmt.pix.width : 640
 fmt.pix.height : 480
 fmt.pix.pixelformat : 0x3131354f [O511]
 fmt.pix.field : NONE
 fmt.pix.bytesperline : 640
 fmt.pix.sizeimage : 614400
 fmt.pix.colorspace : JPEG
 fmt.pix.priv : 4276996862

controls
 VIDIOC_QUERYCTRL(BASE+0)
 id : 9963776
 type : INTEGER
 name : "Brightness"
 minimum : 0
 maximum : 255
 step : 1
 default_value : 127
 flags : 48
 VIDIOC_QUERYCTRL(BASE+1)
 id : 9963777
 type : INTEGER
 name : "Contrast"
 minimum : 0
 maximum : 255
 step : 1
 default_value : 127
 flags : 32
 VIDIOC_QUERYCTRL(BASE+2)
 id : 9963778
 type : INTEGER
 name : "Saturation"
 minimum : 0
 maximum : 255
 step : 1
 default_value : 127
 flags : 32
 VIDIOC_QUERYCTRL(BASE+24)
 id : 9963800
 type : MENU
 name : "Power Line Frequency"
 minimum : 0
 maximum : 2
 step : 1
 default_value : 0
 flags : 0
 VIDIOC_QUERYCTRL(BASE+32)
 id : 9963808
 type : BOOLEAN
 name : "Brightness, Automatic"
 minimum : 0
 maximum : 1
 step : 1
 default_value : 1
 flags : 8



Can someone guide me here please ? Any advice will be greatly appreciated


(P.S. the camera works perfectly with "guvcview" gtk application but since I want to use the camera with raspberry pi, I want it to work with ffplay...)


-
How to encode video with ffmpeg using AMD h264_amf
10 novembre 2022, par Ivy GrowingGiven :


- 

- Win10
- AMD CPU
- Video capturing card Avermedia Live Gamer Extreme 3
- ffmpeg versions and encoders :










>ffmpeg.exe -encoders | find "264"
ffmpeg version 5.1-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
// cut
 V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
 V....D libx264rgb libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
 V....D h264_amf AMD AMF H.264 Encoder (codec h264)
 V....D h264_mf H264 via MediaFoundation (codec h264)
 V....D h264_nvenc NVIDIA NVENC H.264 encoder (codec h264)
 V..... h264_qsv H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration) (codec h264)



Required to capture the video into H.264 encoded file using AMD's hardware accelerator in the CPU (AMF, or VCE).
Tried :
ffmpeg -y -f dshow -rtbufsize 2002000k -framerate 30 -i video="Live Gamer EXTREME 3" -t 00:00:10 -c:v h264_amf output.ts

Result :

Input #0, dshow, from 'video=Live Gamer EXTREME 3':
 Duration: N/A, start: 88548.973998, bitrate: N/A
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422(tv, bt709/bt709/unknown), 1280x720, 30 fps, 30 tbr, 10000k tbn
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_amf))
Press [q] to stop, [?] for help
[h264_amf @ 000002404328c700] DLL amfrt64.dll failed to open
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!



For some reason
ffmpeg
uses resolution1280x720
... When trying to specifiy the capture card resolution the following error appears :

>ffmpeg -y -f dshow -rtbufsize 2002000k -framerate 30 -video_size 3840x2160 -i video="Live Gamer EXTREME 3" -r 30 -t 00:00:10 -c:v h264_amf -f mpegts output.ts
//cut
[dshow @ 0000029d7c0f84c0] Could not set video options
video=Live Gamer EXTREME 3: I/O error



This is not unique error for Avermedia card. The same error appears with Dell web cam and for Magewell.


From this answer the extra flags to be used with
h264_amf
. I guessed the default values should be good enough. It seems something needs to be configured or initialized when using AMF/VCE.

The video encoding in software (without AMF) works just fine but loads the CPU. The goal is using dedicated hardware module and release computational power of the CPU for the other apps.


Command example will be appreciated.


-
Hacking the Popcorn Hour C-200
Update : A new firmware version has been released since the publication of this article. I do not know if the procedure described below will work with the new version.
The Popcorn Hour C-200 is a Linux-based media player with impressive specifications. At its heart is a Sigma Designs SMP8643 system on chip with a 667MHz MIPS 74Kf as main CPU, several co-processors, and 512MB of DRAM attached. Gigabit Ethernet, SATA, and USB provide connectivity with the world around it. With a modest $299 on the price tag, the temptation to repurpose the unit as a low-power server or cheap development board is hard to resist. This article shows how such a conversion can be achieved.
Kernel
The PCH runs a patched Linux 2.6.22.19 kernel. A source tarball is available from the manufacturer. This contains the sources with Sigma support patches, Con Kolivas’ patch set (scheduler tweaks), and assorted unrelated changes. Properly split patches are unfortunately not available. I have created a reduced patch against vanilla 2.6.22.19 with only Sigma-specific changes, available here.
The installed kernel has a number of features disabled, notably PTY support and oprofile. We will use kexec to load a more friendly one.
As might be expected, the PCH kernel does not have kexec support enabled. It does however, by virtue of using closed-source components, support module loading. This lets us turn kexec into a module and load it. A patch for this is available here. To build the module, apply the patch to the PCH sources and build using this configuration. This will produce two modules, kexec.ko and mips_kexec.ko. No other products of this build will be needed.
The replacement kernel can be built from the PCH sources or, if one prefers, from vanilla 2.6.22.19 with the Sigma-only patch. For the latter case, this config provides a minimal starting point suitable for NFS-root.
When configuring the kernel, make sure CONFIG_TANGOX_IGNORE_CMDLINE is enabled. Otherwise the command line will be overridden by a useless one stored in flash. A good command line can be set with CONFIG_CMDLINE (under “Kernel hacking” in menuconfig) or passed from kexec.
Taking control
In order to load our kexec module, we must first gain root privileges on the PCH, and here a few features of the system are working to our advantage :
- The PCH allows mounting any NFS export to access media files stored there.
- There is an HTTP server running. As root.
- This HTTP server can be readily instructed to fetch files from an NFS mount.
- Files with a name ending in .cgi are executed. As root.
All we need do to profit from this is place the kexec modules, the kexec userspace tools, and a simple script on an NFS export. Once this is done, and the mount point configured on the PCH, a simple HTTP request will send the old kernel screaming to /dev/null, our shiny new kernel taking its place.
The rootfs
A kernel is mostly useless without a root filesystem containing tools and applications. A number of tools for cross-compiling a full system exist, each with its strengths and weaknesses. The only thing to look out for is the version of kernel headers used (usually a linux-headers package). As we will be running an old kernel, chances are the default version is too recent. Other than this, everything should be by the book.
Assembling the parts
Having gathered all the pieces, it is now time to assemble the hack. The following steps are suitable for an NFS-root system. Adaptation to a disk-based system is left as an exercise.
- Build a rootfs for MIPS 74Kf little endian. Make sure kernel headers used are no more recent than 2.6.22.x. Include a recent version of the kexec userspace tools.
- Fetch and unpack the PCH kernel sources.
- Apply the modular kexec patch.
- Using this config, build the modules and install them as usual to the rootfs. The version string must be 2.6.22.19-19-4.
- From either the same kernel sources or plain 2.6.22.19 with Sigma patches, build a vmlinux and (optionally) modules using this config. Modify the compiled-in command line to point to the correct rootfs. Set the version string to something other than in the previous step.
- Copy vmlinux to any directory in the rootfs.
- Copy kexec.sh and kexec.cgi to the same directory as vmlinux.
- Export the rootfs over NFS with full read/write permissions for the PCH.
- Power on the PCH, and update to latest firmware.
- Configure an NFS mount of the rootfs.
- Navigate to the rootfs in the PCH UI. A directory listing of bin, dev, etc. should be displayed.
- On the host system, run the kexec.sh script with the target hostname or IP address as argument.
- If all goes well, the new kernel will boot and mount the rootfs.
Serial console
A serial console is indispensable for solving boot problems. The PCH board has two UART connectors. We will use the one labeled UART0. The pinout is as follows (not standard PC pinout).
+-----------+ 2| * * * * * |10 1| * * * * * |9 -----------+ J7 UART0 /---------------------/ board edge
Pin Function 1 +5V 5 Rx 6 Tx 10 GND The signals are 3.3V so a converter, e.g. MAX202, is required for connecting this to a PC serial port. The default port settings are 115200 bps 8n1.