
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (41)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar 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 ;
-
Dépôt de média et thèmes par FTP
31 mai 2013, parL’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 (...) -
Keeping control of your media in your hands
13 avril 2011, parThe 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 (3997)
-
Transcoding & displaying user-uploaded videos for cross-browser/platform compatibility
5 avril 2012, par Jonathan AmendI want to display user-uploaded videos in high quality on different browsers/platforms. I think I have a pretty good start, but there are a few issues. I have at my disposal ffmpeg 0.10 (called from PHP) and jwPlayer 5.8 (licensed).
Ideally I would like to support :
- Browsers with Flash 9+
- Modern Firefox/Chrome/Safari without Flash
- iOS 4.1+
- Android 2.2+
My current transcoding commands are :
$commands = array(
'flv' => "/usr/bin/ffmpeg -y -i {$sourceFile} -b 500k -ar 22050 -ab 64 {$tmpFileName}.flv 2>&1",
'webm' => "/usr/bin/ffmpeg -i {$sourceFile} -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b 500k {$tmpFileName}.webm 2>&1",
'mp4' => "/usr/bin/ffmpeg -i {$sourceFile} -acodec libfaac -ab 96k -vcodec libx264 -level 21 -refs 2 -vf 'scale=trunc(ih*a/2)*2:trunc(iw/a/2)*2' -b 500k -bt 1000k -threads 0 -f mp4 {$tmpFileName}.pre.mp4 2>&1",
'jpg' => "/usr/bin/ffmpeg -y -i {$sourceFile} -ss 5 -vcodec mjpeg -vframes 1 -an -f rawvideo {$tmpFileName}.jpg 2>&1"
);
$fastStartCommand = "/usr/bin/qt-faststart {$tmpFileName}.pre.mp4 {$tmpFileName}.mp4");My current display code is this :
<video controls="controls" width="{$width}" height="{$height}" poster="{$fileJPG}" style="width: {$width}px; height: {$height}px;">
<source src="{$fileMP4}" type="video/mp4" data-ext="mp4"></source>
<source src="{$fileWEBM}" type="video/webm" data-ext="webm"></source>
<a href="http://stackoverflow.com/feeds/tag/{$fileMP4}" title="Play Video">
<img border="0" src="http://stackoverflow.com/feeds/tag/{$fileJPG}" width='0' height='0' alt="Play Video" />
</a>
</video>
<code class="echappe-js"><script type="text/javascript"><br />
swfobject.embedSWF(<br />
&#39;/flash/jwPlayer.swf&#39;,<br />
&#39;video&#39;,<br />
{$width},<br />
{$height},<br />
&#39;9.0.0&#39;,<br />
&#39;&#39;,<br />
{<br />
file: &#39;{$fileFLV}&#39;,<br />
width: {$width},<br />
height: {$height},<br />
provider: &#39;video&#39;,<br />
stretching: &#39;uniform&#39;,<br />
smoothing: &#39;true&#39;,<br />
dock: &#39;true&#39;<br />
},<br />
{<br />
menu: &#39;false&#39;,<br />
allowfullscreen: &#39;true&#39;,<br />
allowscriptaccess: &#39;always&#39;,<br />
allownetworking: &#39;always&#39;,<br />
wmode: &#39;transparent&#39;<br />
}<br />
);<br />
</script>The idea is to prefer the Flash player (we have many custom skins that we would like to keep using), then fall back to HTML 5 video, and if that fails, show the JPEG with a link to the mp4 file (that seems to work as a last-ditch effort for iOS 2/3 and old browsers so they can at least play the video by launching QuickTime).
The main issues that I'm not sure how to solve right now are :
- How can I show a higher quality video in Flash ? I tried using the mp4 video instead of the flv but it doesn't work and I only get sound, no video. I think Flash is supposed to support h.264 these days, but how ? And do I have to use a different transcoding method for older and newer versions of Flash ?
- How can I transcode the video with better quality ? Right now I am using the same bitrate for all resolutions. Any chance there is a way for ffmpeg to adjust the bitrate automatically ? Or can I detect and match the resolution of the uploaded video to a list of resolution -> bitrates somehow ?
-
Dreamcast Anniversary Programming
10 septembre 2010, par Multimedia Mike — Game HackingThis day last year saw a lot of nostalgia posts on the internet regarding the Sega Dreamcast, launched 10 years prior to that day (on 9/9/99). Regrettably, none of the retrospectives that I read really seemed to mention the homebrew potential, which is the aspect that interested me. On the occasion of the DC’s 11th anniversary, I wanted to remind myself how to build something for the unit and do so using modern equipment and build tools.
Background
Like many other programmers, I initially gained interest in programming because I desired to program video games. Not content to just plunk out games on a PC, I always had a deep, abiding ambition to program actual video game hardware. That is, I wanted to program a purpose-built video game console. The Sega Dreamcast might be the most ideal candidate to ever emerge for that task. All that was required to run your own software on the unit was the console, a PC, some free software tools, and a special connectivity measure.The Equipment
Here is the hardware required (ideally) to build software for the DC :- The console itself (I happen to have 3 of them laying around, as pictured above)
- Some peripherals : Such as the basic DC controller, the DC keyboard (flagship title : Typing of the Dead), and the visual memory unit (VMU)
- VGA box : The DC supported 480p gaming via a device that allowed you to connect the console straight to a VGA monitor via 15-pin D-sub. Not required for development, but very useful. I happen to have 3 of them from different third parties :
- Finally, the connectivity measure for hooking the DC to the PC.
There are 2 options here. The first is rare, expensive and relatively fast : A DC broadband adapter. The second is slower but much less expensive and relatively easy to come by– the DC coder’s cable. This was a DB-9 adapter on one end and a DC serial adapter on the other, and a circuit in the middle to monkey with voltage levels or some such ; I’m no electrical engineer. I procured this model from the notorious Lik Sang, well before that outfit was sued out of business.
Dealing With Legacy
Take a look at that coder’s cable again. DB-9 ? When was the last time you owned a computer with one of those ? And then think farther back to the last time to had occasion to plug something into one of those ports (likely a serial mouse).
A few years ago, someone was about to toss out this Belkin USB to DB-9 serial converter when I intervened. I foresaw the day when I would dust off the coder’s cable. So now I can connect a USB serial cable to my Eee PC, which then connects via converter to a different serial cable, one which has its own conversion circuit that alters the connection to yet another type of serial cable.
Bits is bits is bits as far as I’m concerned.
Putting It All Together
Now to assemble all the pieces (plus a monitor) into one development desktop :
The monitor says “dcload 1.0.3, idle…”. That’s a custom boot CD-ROM that is patiently waiting to receive commands, code and data via the serial port.
Getting The Software
Back in the day, homebrew software development on the DC revolved around these components :- GNU binutils : for building base toolchains for the Hitachi SH-4 main CPU as well as the ARM7-based audio coprocessor
- GNU gcc/g++ : for building compilers on top of binutils for the 2 CPUs
- Newlib : a C library intended for embedded systems
- KallistiOS : an open source, real-time OS developed for the DC
The DC was my first exposure to building cross compilers. I developed some software for the DC in the earlier part of the decade. Now, I am trying to figure out how I did it, especially since I think I came up with a few interesting ideas at the time.
Struggling With the Software Legacy
The source for KallistiOS has gone untouched since about 2004 but is still around thanks to Sourceforge. The instructions for properly building the toolchain have been lost to time, or would be were it not for the Internet Archive’s copy of a site called Hangar Eleven. Also, KallistiOS makes reference to a program called ‘dc-tool’ which is needed on the client side for communicating with dcload. I was able to find this binary at the Boob ! site (well-known in DC circles).I was able to build the toolchain using binutils 2.20.1, gcc 4.5.1 and newlib 1.18.0. Building the toolchain is an odd process as it requires building the binutils, then building the C compiler, then newlib, and then building the C compiler again along with the C++ compiler because the C++ compiler depends on newlib.
With some effort, I got the toolchain to build KallistiOS and most of its example programs. I documented most of the tweaks I had to make, several of them exactly the same as this one that I recently discovered while resurrecting a 10-year-old C program (common construct in C programming of old ?).
Moment of Truth
So I had some example programs built as ELF files. I told dc-tool to upload and run them on the waiting console. Unfortunately, the tool would just sort of stall, though some communication had evidently taken place. It has been many years since I have seen this in action but I recall that something more ought to be happening.Plan B (Hardware)
This is the point that I remember that I have been holding onto one rather old little machine that still has a DB-9 serial port. It’s not especially ergonomic to set up. I have to run it on my floor because, to connect it to my network, I need to run a 25′ ethernet cable that just barely reaches from the other room. The machine doesn’t seem to like USB keyboards, which is a shame since I have long since ditched any PS/2 keyboards. Fortunately, the box still has an old Gentoo distro and is running sshd, a holdover from its former life as a headless box.
Now when I run dc-tool, both the PC and DC report the upload progress while pretty overscan bars oscillate on the DC’s monitor. Now I’m back in business, until…
Plan C (Software)
None of these KallistiOS example programs are working. Some are even reporting catastrophic failures (register dumps) via the serial console. That’s when I remember that gcc can be a bit fickle on CPU architectures that are not, shall we say, first-class citizens. Back in the day, gcc 2.95 was a certified no-go for SH-4 development. 3.0.3 or 3.0.4 was called upon at the time. As I’m hosting this toolchain on x86_64 right now, gcc 3.0.4 can’t even be built (predates the architecture).One last option : As I searched through my old DC project directories, I found that I still have a lot of the resulting binaries, the ones I built 7-8 years ago. I upload a few of those and I finally see homebrew programming at work again, including this old program (described in detail here).
Next Steps
If I ever feel like revisiting this again, I suppose I can try some of the older 4.x series to see if they build valid programs. Alternatively, try building an x86_32-hosted 3.0.4 toolchain which ought to be a known good. And if that fails, search a little bit more to find that there are still active Dreamcast communities out there on the internet which probably have development toolchain binaries ready for download. -
v4l2loopback+ffmpeg input for uvc gadget
13 mai, par MosiI'm trying to use an MP4 video file as the input for a UVC Gadget setup on my Raspberry Pi 4 Model B, but I'm running into an issue when streaming through V4L2.


Goal :


To emulate a webcam that streams a looping MP4 video file to a Windows 11 host.


My setup :


- 

- Hardware : Raspberry Pi 4 Model B
- OS : Raspberry Pi OS Lite 64-bit (
2025-05-06-raspios-bookworm-arm64-lite
) - Kernel :
6.12.25+rpt-rpi-v8
- Host System : Windows 11
- UVC Gadget version :
v0.3.0












Workflow :


[MP4 Video] → [FFmpeg] → [V4L2 Loopback] → [UVC Gadget] → Windows sees virtual webcam



What works :


The UVC Gadget works perfectly when I use a real webcam as the source (e.g.,
/dev/video0
). Windows detects the virtual webcam and displays a smooth video stream.

The problem :


When I try to use an MP4 video file through FFmpeg and send it to the loopback device (
/dev/video3
), the UVC Gadget fails with the following error :


Command I'm using :


ffmpeg -re -stream_loop -1 -i input.mp4 -vf scale=640:480 \
 -c:v rawvideo -pix_fmt yuyv422 -r 30 -f v4l2 /dev/video3



Then I run :


sudo uvc-gadget -d /dev/video3 uvc.0



Output :


bRequestType 21 bRequest 01 wValue 0200 wIndex 0001 wLength 0022
streaming request (req SET_CUR cs 02)
setting commit control, length = 34
Setting format to 0x56595559 640x480
=== Setting frame rate to 30 fps
Starting video stream.
--> [At this point I open the camera on the Windows host]
/dev/video3: 2 buffers requested.
Failed to export buffer 0.
Failed to export buffers on source: Inappropriate ioctl for device (25)




Things I've tried :


- 

- Multiple FFmpeg formats, resolutions, and pixel formats
- Various
ffmpeg
buffer and framerate tweaks - Different UVC Gadget versions
- GitHub related projects (
showcamera
, etc.) - Older Raspberry Pi OS versions












Most guides and GitHub projects I found are outdated (5+ years old), and newer methods seem undocumented or incompatible with current kernel/UVC gadget tools.



My question :


How can I stream an MP4 file as a virtual webcam using UVC Gadget without getting ioctl errors ?

Is there a proper way to set up FFmpeg and loopback devices so that UVC Gadget can read the stream correctly ?

Any modern working example or tips would be very appreciated. Thanks in advance !