
Recherche avancée
Médias (1)
-
SWFUpload Process
6 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
Autres articles (36)
-
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 (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
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.
Sur d’autres sites (6519)
-
How can I convert a video raw frame to image using ffmpeg [closed]
8 mai 2024, par SeanI have a video stream (from a DJI Drone) coming to a websocket server.The websocket server saves the data using the technique described in this answer.


Technical Details



The frame is :


- 

- From a H265 video generated by the drone
- has size : height 1080 , width 1440
- FPS : 30
- Size : 45235










This is the raw video data as we receive from the getData() function of the video frame returned by the addStreamDataListener method


Goal



I want that the saved frame (I have noted the peculiar size) to be converted to ffpmeg.


Attempt(s) to solve



I have tried :


ffmpeg -f rawvideo -s 720x480 -i images/fileName1715180324575.dat output.jpg



as well as


ffmpeg -f rawvideo -pix_fmt rgb24 -s 1080x1440 -i images/fileName1715180324575.dat output.jpg



and various other combinations


Error



I get :


ffmpeg version n6.1.1 Copyright (c) 2000-2023 the FFmpeg developers


built with gcc 13.2.1 (GCC) 20230801
 configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
 libavutil 58. 29.100 / 58. 29.100
 libavcodec 60. 31.102 / 60. 31.102
 libavformat 60. 16.100 / 60. 16.100
 libavdevice 60. 3.100 / 60. 3.100
 libavfilter 9. 12.100 / 9. 12.100
 libswscale 7. 5.100 / 7. 5.100
 libswresample 4. 12.100 / 4. 12.100
 libpostproc 57. 3.100 / 57. 3.100
[rawvideo @ 0x5d0fc4e5f600] Packet corrupt (stream = 0, dts = 0).
[rawvideo @ 0x5d0fc4e5f600] Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from 'images/fileName1715180324575.dat':
 Duration: N/A, start: 0.000000, bitrate: 933120 kb/s
 Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1080x1440, 933120 kb/s, 25 tbr, 25 tbn
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[in#0/rawvideo @ 0x5d0fc4e5f500] corrupt input packet in stream 0
[rawvideo @ 0x5d0fc4e697c0] Invalid buffer size, packet size 45235 < expected frame_size 4665600
[vist#0:0/rawvideo @ 0x5d0fc4e69640] Error submitting packet to decoder: Invalid argument
[swscaler @ 0x5d0fc4e86580] deprecated pixel format used, make sure you did set range correctly
[vost#0:0/mjpeg @ 0x5d0fc4e6c6c0] No filtered frames for output stream, trying to initialize anyway.
Output #0, image2, to 'output.jpg':
 Metadata:
 encoder : Lavf60.16.100
 Stream #0:0: Video: mjpeg, yuvj444p(pc, progressive), 1080x1440, q=2-31, 200 kb/s, 25 fps, 25 tbn
 Metadata:
 encoder : Lavc60.31.102 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
[vist#0:0/rawvideo @ 0x5d0fc4e69640] Decode error rate 1 exceeds maximum 0.666667
[out#0/image2 @ 0x5d0fc4e69380] video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[out#0/image2 @ 0x5d0fc4e69380] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
frame= 0 fps=0.0 q=0.0 Lsize=N/A time=N/A bitrate=N/A speed=N/A 
Conversion failed!



or


ffmpeg version n6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 13.2.1 (GCC) 20230801
 configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
 libavutil 58. 29.100 / 58. 29.100
 libavcodec 60. 31.102 / 60. 31.102
 libavformat 60. 16.100 / 60. 16.100
 libavdevice 60. 3.100 / 60. 3.100
 libavfilter 9. 12.100 / 9. 12.100
 libswscale 7. 5.100 / 7. 5.100
 libswresample 4. 12.100 / 4. 12.100
 libpostproc 57. 3.100 / 57. 3.100
[rawvideo @ 0x5a4c0b8685c0] Packet corrupt (stream = 0, dts = 0).
[rawvideo @ 0x5a4c0b8685c0] Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from 'images/fileName1715180324575.dat':
 Duration: N/A, start: 0.000000, bitrate: 103680 kb/s
 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x480, 103680 kb/s, 25 tbr, 25 tbn
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[in#0/rawvideo @ 0x5a4c0b8684c0] corrupt input packet in stream 0
[rawvideo @ 0x5a4c0b872700] Invalid buffer size, packet size 45235 < expected frame_size 518400
[vist#0:0/rawvideo @ 0x5a4c0b872580] Error submitting packet to decoder: Invalid argument
[swscaler @ 0x5a4c0b88f480] deprecated pixel format used, make sure you did set range correctly
[vost#0:0/mjpeg @ 0x5a4c0b875600] No filtered frames for output stream, trying to initialize anyway.
Output #0, image2, to 'output.jpg':
 Metadata:
 encoder : Lavf60.16.100
 Stream #0:0: Video: mjpeg, yuvj420p(pc, progressive), 720x480, q=2-31, 200 kb/s, 25 fps, 25 tbn
 Metadata:
 encoder : Lavc60.31.102 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
[vist#0:0/rawvideo @ 0x5a4c0b872580] Decode error rate 1 exceeds maximum 0.666667
[out#0/image2 @ 0x5a4c0b8722c0] video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[out#0/image2 @ 0x5a4c0b8722c0] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
frame= 0 fps=0.0 q=0.0 Lsize=N/A time=N/A bitrate=N/A speed=N/A 
Conversion failed!



or similar errors.


Question



How can I extract the image from a video frame using ffmpeg ? Thank you


A sample of the image file may be found here : github


-
avutil : remove deprecated FF_API_FRAME_PKT
19 février, par James Almeravutil : remove deprecated FF_API_FRAME_PKT
Deprecated since 2023-03-20.
Signed-off-by : James Almer <jamrial@gmail.com>
- [DH] libavcodec/av1dec.c
- [DH] libavcodec/cuviddec.c
- [DH] libavcodec/decode.c
- [DH] libavcodec/libuavs3d.c
- [DH] libavdevice/lavfi.c
- [DH] libavfilter/af_volume.c
- [DH] libavfilter/af_volume.h
- [DH] libavfilter/avfilter.c
- [DH] libavfilter/f_select.c
- [DH] libavfilter/f_sendcmd.c
- [DH] libavfilter/setpts.c
- [DH] libavfilter/vf_crop.c
- [DH] libavfilter/vf_drawtext.c
- [DH] libavfilter/vf_eq.c
- [DH] libavfilter/vf_eq.h
- [DH] libavfilter/vf_overlay.c
- [DH] libavfilter/vf_overlay.h
- [DH] libavfilter/vf_overlay_cuda.c
- [DH] libavfilter/vf_scale.c
- [DH] libavfilter/vf_scale_npp.c
- [DH] libavfilter/vf_swaprect.c
- [DH] libavutil/frame.c
- [DH] libavutil/frame.h
- [DH] libavutil/version.h
-
FFMPEG : how to create a "title slide" for 3 seconds before a video [closed]
15 mars 2024, par ashayI'm trying to make a lecture video to put online. I have the video itself, and I have a title slide that I'd like to play for 3 seconds before the main video.


I tried using ffmpeg to (1) create a 3 second long video from the title slide and (2) concat the two videos together.


I'm having issues concatenating the videos together — when I do so, the resulting video is much longer than it should be. When I look online, others have similar problems — and this seems to occur when the parameters of the two videos do not match perfectly.


I'd prefer to do this without re-encoding the main video — and it seems this should be possible because I should be able to control what parameters are set for the "lecture slide video".


Here are the commands I've run.
The main video has framerate 25, resolution 1920x1080, and an audio stream at #0:0 and a video stream at #0:1 (according to ffmpeg -i [video].


To create the video of the title slide, I ran
ffmpeg -framerate 25 -i lec01_title.png -t 3 -c:v libx264 -x265-params lossless=1 -pix_fmt yuvj420p -vf scale=1920:1080 lec01_title.mp4 -f lavfi -i anullsrc -c:a aac -shortest
.
Then to reorder the streams to match the main video, I ranffmpeg -i lec01_title.mp4 -map 0:a -map 0:v -c:v copy -c:a copy lec01_title_matched.mp4
.

Then to concatenate the two files together, I created a text file "concat_list" with :

file 'lec01_title_matched.mp4' file 'lec01.mp4'
, and ran the commandffmpeg -f concat -safe 0 -i concat_list.txt -c copy -movflags +faststart output.mp4
.

The main video is 53 minutes long, but the final output video after concatenating is 1 hour and 43 minutes long.


I'm looking for advice for how to create the "lecture title video" properly to match the parameters of the second video so that I can concatenate them without problems.


Here's the output of
ffmpeg -i lec01.mp4
:

ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
 built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
 configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
 libavutil 58. 29.100 / 58. 29.100
 libavcodec 60. 31.102 / 60. 31.102
 libavformat 60. 16.100 / 60. 16.100
 libavdevice 60. 3.100 / 60. 3.100
 libavfilter 9. 12.100 / 9. 12.100
 libswscale 7. 5.100 / 7. 5.100
 libswresample 4. 12.100 / 4. 12.100
 libpostproc 57. 3.100 / 57. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'dcai_lec01.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 title : 2-190-wideshot
 encoder : Lavf60.16.100
 Duration: 00:47:39.08, start: 0.000000, bitrate: 1435 kb/s
 Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 96000 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
 Stream #0:1[0x2](und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1298 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 encoder : Lavc60.31.102 libx264



Described above in detail.