
Recherche avancée
Autres articles (104)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP 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 (...) -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...)
Sur d’autres sites (7836)
-
ffmpeg : join + crossfade 5 input files (video+audio) into one output file
7 avril 2020, par Fab SanchezI have 5 mp4 input videos (audio+video) that I want to 'join' into a single output video with a crossfade effect in between each pair of videos.
I want to 'crossfade' both the audio and the video, with a transition of 0.4s.
(Not an actual crossfade, more like video-2 fades in over video-1, video-1 does not need to fade out, but this is not the problem)



I'm using ffmpeg-4.1.3-win64-static



I have followed many tutorials and answers from here, but there are so many different ways to do it...



Each one of the 5 videos is 1.024s long, duration obtained with ffprobe



ffprobe.exe -i "0.mp4" -show_entries format=duration -v quiet -of csv="p=0"




This is the command for both audio and video :
(I've reformatted the command so it is easier to read, it is issued as a single line in the command prompt)



ffmpeg.exe -y -i "0.mp4" -i "1.mp4" -i "2.mp4" -i "3.mp4" -i "4.mp4" 
-filter_complex "
[0:v]setpts=PTS-STARTPTS[v1];
[1:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(0.6/TB)[v2];
[2:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(1.2/TB)[v3];
[3:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(1.8/TB)[v4];
[4:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(2.4/TB)[v5];
[v1][v2]overlay[u1];[u1][v3]overlay[u2];[u2][v4]overlay[u3];[u3][v5]overlay,format=yuv420p[v];
[0][1]acrossfade=d=0.4[a0];
[a0][2]acrossfade=d=0.4[a1];
[a1][3]acrossfade=d=0.4[a2];
[a2][4]acrossfade=d=0.4[a]
" -map [v] -map [a] "output.mp4"




When I do both audio and video into a single output file, output.mp4 can not be played on VLC, this is the vlc log :



main debug: `file:///C:/project/input-videos/output.mp4' gives access `file' demux `any' path `/C:project/input-videos/output.mp4'
main debug: creating demux: access='file' demux='any' location='/C:/project/input-videos/output.mp4' file='C:\project\input-videos\output.mp4'
main debug: looking for access_demux module matching "file": 15 candidates
main debug: no access_demux modules matched
main debug: creating access: file:///C:/project/input-videos/output.mp4
main debug: (path: C:\project\input-videos\output.mp4)
main debug: looking for access module matching "file": 26 candidates
main debug: using access module "filesystem"
main debug: looking for stream_filter module matching "prefetch,cache_read": 24 candidates
cache_read debug: Using stream method for AStream*
cache_read debug: starting pre-buffering
cache_read error: cannot pre fill buffer
main debug: looking for meta fetcher module matching "any": 1 candidates
main debug: no stream_filter modules matched
main warning: cannot insert stream filter prefetch,cache_read
main debug: looking for stream_filter module matching "any": 24 candidates
playlist debug: not enough data
...




This is the output from ffmpeg :



ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 8.3.1 (GCC) 20190414
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
 libavutil 56. 22.100 / 56. 22.100
 libavcodec 58. 35.100 / 58. 35.100
 libavformat 58. 20.100 / 58. 20.100
 libavdevice 58. 5.100 / 58. 5.100
 libavfilter 7. 40.101 / 7. 40.101
 libswscale 5. 3.100 / 5. 3.100
 libswresample 3. 3.100 / 3. 3.100
 libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '0.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.20.100
 location-eng : +52.6899-001.8293/
 location : +52.6899-001.8293/
 Duration: 00:00:01.02, start: 0.000000, bitrate: 13821 kb/s
 Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2224x1080 [SAR 1:1 DAR 278:135], 14002 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : VideoHandle
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
 Metadata:
 handler_name : SoundHandle
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.20.100
 location-eng : +53.4256-001.3580/
 location : +53.4256-001.3580/
 Duration: 00:00:01.02, start: 0.000000, bitrate: 7094 kb/s
 Stream #1:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2224x1080 [SAR 1:1 DAR 278:135], 7113 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : VideoHandle
 Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
 Metadata:
 handler_name : SoundHandle
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.20.100
 location-eng : +53.3927-001.5044/
 location : +53.3927-001.5044/
 Duration: 00:00:01.02, start: 0.000000, bitrate: 7367 kb/s
 Stream #2:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2224x1080 [SAR 1:1 DAR 278:135], 7394 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : VideoHandle
 Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 126 kb/s (default)
 Metadata:
 handler_name : SoundHandle
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '3.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.20.100
 location-eng : +53.3927-001.5044/
 location : +53.3927-001.5044/
 Duration: 00:00:01.02, start: 0.000000, bitrate: 8145 kb/s
 Stream #3:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2224x1080 [SAR 1:1 DAR 278:135], 8192 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : VideoHandle
 Stream #3:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
 Metadata:
 handler_name : SoundHandle
Input #4, mov,mp4,m4a,3gp,3g2,mj2, from '4.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.20.100
 location-eng : +53.3927-001.5044/
 location : +53.3927-001.5044/
 Duration: 00:00:01.02, start: 0.000000, bitrate: 6241 kb/s
 Stream #4:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2224x1080 [SAR 1:1 DAR 278:135], 6241 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : VideoHandle
 Stream #4:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 126 kb/s (default)
 Metadata:
 handler_name : SoundHandle
Stream mapping:
 Stream #0:0 (h264) -> setpts
 Stream #0:1 (aac) -> acrossfade:crossfade0
 Stream #1:0 (h264) -> format
 Stream #1:1 (aac) -> acrossfade:crossfade1
 Stream #2:0 (h264) -> format
 Stream #2:1 (aac) -> acrossfade:crossfade1
 Stream #3:0 (h264) -> format
 Stream #3:1 (aac) -> acrossfade:crossfade1
 Stream #4:0 (h264) -> format
 Stream #4:1 (aac) -> acrossfade:crossfade1
 format -> Stream #0:0 (libx264)
 acrossfade -> Stream #0:1 (aac)
 Press [q] to stop, [?] for help




When I do the video only it is fine. The duration of the output.mp4 file generated for video-only is 3.4s



When I do the audio only it is also fine. The duration of the output.mp4 file generated for audio-only is 3.435s



This is the command for video only :



ffmpeg.exe -y -i "0.mp4" -i "1.mp4" -i "2.mp4" -i "3.mp4" -i "4.mp4" 
-filter_complex "
[0:v]setpts=PTS-STARTPTS[v1];
[1:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(0.6/TB)[v2];
[2:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(1.2/TB)[v3];
[3:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(1.8/TB)[v4];
[4:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(2.4/TB)[v5];
[v1][v2]overlay[u1];[u1][v3]overlay[u2];[u2][v4]overlay[u3];[u3][v5]overlay,format=yuv420p[v]
" -map [v] "output.mp4"




This is the command for audio only :



ffmpeg.exe -y -i "0.mp4" -i "1.mp4" -i "2.mp4" -i "3.mp4" -i "4.mp4" 
-filter_complex "
[0][1]acrossfade=d=0.4[a0];
[a0][2]acrossfade=d=0.4[a1];
[a1][3]acrossfade=d=0.4[a2];
[a2][4]acrossfade=d=0.4[a]
" -map [a] "output.mp4"




What am I missing in order to generate one output file with both audio and video content ?



Edit : Here's the full ffmpeg command + result for audio and video combined with "-loglevel debug" added. (Too big to add directly here, so I've added it to Pastebin)
https://pastebin.com/NLBc7Abb



Work Around
Not a solution, but I found a work around :



- 

- Create video only output using command above, output to video.mp4
- Create audio only output using command above, output to audio.mp4
- Merge both video.mp4 and audio.mp4 into output.mp4 using the following command :









ffmpeg.exe -y -i "video.mp4" -i "audio.mp4" -c:v copy -c:a aac output.mp4




If anyone has any ideas as to why the combined audio+video command does not work, please let me know. :)


-
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 !


-
Revert "lavf/id3v2dec : support multiple values and TIPL frames"
16 avril, par Michael NiedermayerRevert "lavf/id3v2dec : support multiple values and TIPL frames"
see : Re : [FFmpeg-devel] [PATCH 2/2] avformat/id3v2 : Check that decode_str() did advance
but in short, first our API since 16years says we dont have multiple values per key
(which it supports since 9 years only)and it causes some problems for ffprobe apparently.
I do believe the original patch is the correct direction but it requires
more changes. So revert this until other things are in place and until
we have a consensus.This reverts commit 80b77e8e8d0630710ad6069133f397459015f139.