
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (41)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (6034)
-
Writing multi-stream MP4 file with Gstreamer
26 juin 2023, par Florian EchtlerMy Gstreamer 1.20 application is writing two H.264 video streams and one Opus audio stream to a MP4 file. The relevant parts of the pipeline looks as follows :


Video encoder (this part is present twice) :


queue max-size-time=100000000 leaky=downstream ! x264enc bitrate=1500 speed-preset=ultrafast tune=zerolatency key-int-max=15 ! video/x-h264,profile=constrained-baseline,stream-format=avc ! queue ! mux.



Audio encoder :


queue max-size-time=100000000 leaky=downstream ! opusenc bitrate-type=vbr inband-fec=true ! queue ! opusparse ! mux.



Muxer and filesink :


mp4mux name=mux fragment-duration=1000 latency=100000000 ! filesink sync=true location=out.mp4



The result is an MP4 file which I can play just fine in Totem on Ubuntu, and even switch between video streams using "Switch angles".


However, none of the following work :


- 

- play it in VLC (plays a few seconds, then freezes)
- do anything with FFMPEG, e.g. split the streams (results are garbage)
- seek in the video (even in Totem)








In all cases, I get some messages about "Invalid NAL unit size" and/or "non-monotonous DTS". So what would I need to do to my output pipeline to get a "compliant" MP4 file ?



Note : I can "fix" the resulting file by using GStreamer with
qtdemux
to split it into two raw H.264 files and a WAV file, and then useffmpeg
to re-encode it into MP4 with an MP3 audio track. But I'd rather have a workable MP4 file right away.

-
FFMPEG generated h264/aac mp4 video first frame doesn't report a zero mediaTime using requestVideoFrameCallback html api [closed]
12 mai 2023, par Daniel RobinsonI have noticed that mp4 files generated using ffmpeg aren’t reporting a mediaTime of 0 via requestVideoFrameCallback for the first frame however files encoded as webm or via another encoder such as mainconcept its 0.


You can see a demo of the issue here https://randomstuffdr.s3.eu-west-1.amazonaws.com/TEST-v3.HTML
As you increment the frames with video 1 you don’t see video progress until the third button press.


With video 2-4, the mediaTime is 0 and a single press of the button increments the video by one frame.


Browser : Chrome 113.0.5672.92 (Windows 10)


FFMPEG Version : 6.0-essentials_build-www.gyan.dev or N-109421-g9adf02247c-20221216


There was an interesting note on this page related to mediaTime implementation in chrome https://web.dev/requestvideoframecallback-rvfc/




Of special interest in this list is mediaTime. In Chromium's
implementation, we use the audio clock as the time source that backs
video.currentTime, whereas the mediaTime is directly populated by the
presentationTimestamp of the frame. The mediaTime is what you should
use if you want to exactly identify frames in a reproducible way,
including to identify exactly which frames you missed.




The led me to compare the PTS files of the video and audio stream between the ffmpeg and MC files using ffprobe however these are all zero for the first frames. The one interesting note, is that ffmpeg file seems to interleave video and audio packets in ffprobe while the mainconcept file has 8 video frames before audio, I have no idea if this is significant.


What I would like to know is if there is any way I can make ffmpeg generate a file in a similar manner to mainconcept ? So far I have tried ; disabling b-frames, use baseline profile and avoid_negative_ts


Video 1 – (Video : H264 /Audio : AAC / Wrapper : MP4 / Transcoder : FFMPEG)
.\ffmpeg.exe -i '720p50 Flash and Beep.mxf' -map 0:0 -map 0:1 -map_metadata -1 -c:v libx264 -crf 28 -b:v 118k -maxrate 118k -bufsize 236k -vf scale="480 :-1" -preset veryfast -c:a aac "..\low-res\720p50FlashandBeep_V_A.mp4"


Video 2 – (Video : H264 /Audio : No Audio / Wrapper : MP4 / Transcoder : FFMPEG)
.\ffmpeg.exe -i '720p50 Flash and Beep.mxf' -map 0:0 -map 0:1 -map_metadata -1 -c:v libx264 -crf 28 -b:v 118k -maxrate 118k -bufsize 236k -vf scale="480 :-1" -preset veryfast -an "..\low-res\720p50FlashandBeep_V.mp4"


Video 3 – (Video : vp8 /Audio : ogg / Wrapper : webm / Transcoder : FFMPEG)
.\ffmpeg.exe -i '720p50 Flash and Beep.mxf' -map 0:0 -map 0:1 -map_metadata -1 -c:v vp8 -crf 28 -b:v 118k -maxrate 118k -bufsize 236k -vf scale="480 :-1" -preset veryfast "..\low-res\720p50FlashandBeep_V_A.webm"


Video 4 – (Video : H264 /Audio : AAC / Wrapper : MP4 / Transcoder : MainConcept)


-
FFmpeg - Copy a (not A/V) data stream from input MP4 file [closed]
31 mars 2023, par darkshineI've got an
MP4
video file captured by DJI drone. The file contains the video stream (H.264) and also two data streams of unknown format. I would like to convert the video fromh.264
toh.265
and also save both of the included data streams. Unfortunately, I cannot force FFmpeg to copy the data streams across from the input file into the output file.

Here is the mp4 file :


ffprobe DJI_0019.MP4


[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5631004c2730] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'DJI_0019.MP4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 creation_time : replaced_timestamp
 encoder : DJIMavic3
 Duration: 00:01:05.66, start: 0.000000, bitrate: 128915 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 3840x2160, 127648 kb/s, 29.41 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
 Metadata:
 creation_time : replaced_timestamp
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1(und): Data: none (djmd / 0x646D6A64), 13 kb/s
 Metadata:
 creation_time : replaced_timestamp
 handler_name : DJI meta
 Stream #0:2(und): Data: none (dbgi / 0x69676264), 1190 kb/s
 Metadata:
 creation_time : replaced_timestamp
 handler_name : DJI dbgi
 Stream #0:3: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 960x540 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc (attached pic)
Unsupported codec with id 0 for input stream 1
Unsupported codec with id 0 for input stream 2



I tried the command below :


ffmpeg -i DJI_0019.MP4 -map 0 -c:v libx265 -crf 25 -c:d copy -copy_unknown DJI_0019.v2.MP4


The command fails with the following error. The output file is empty.


[mp4 @ 0x556d0180ced0] Could not find tag for codec none in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --



Note that for "-c:d" option I tried different suggested values, none of them succeeded :


copy
none
bin
bin_data
data
null
file



In the meantime an attempt to save the data streams to separate files succeeds for the both of them with the commands :


ffmpeg -i DJI_0019.MP4 -map 0:d:0 -c copy -copy_unknown -f data DJI_0019.data0.bin


ffmpeg -i DJI_0019.MP4 -map 0:d:1 -c copy -copy_unknown -f data DJI_0019.data1.bin


Question :


How to force FFmpeg to copy the data streams from input to output ?


This is the ffmpeg's info :


ffmpeg version 4.4.3 Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 11.3.0 (Gentoo 11.3.0 p5)
 configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 
--docdir=/usr/share/doc/ffmpeg-4.4.3/html --mandir=/usr/share/man --enable-shared 
--cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar 
--nm=x86_64-pc-linux-gnu-nm --strip=x86_64-pc-linux-gnu-strip 
--ranlib=x86_64-pc-linux-gnu-ranlib --pkg-config=x86_64-pc-linux-gnu-pkg-config 
--optflags='-O2 -pipe -march=native' --disable-static --enable-avfilter --enable-avresample 
--disable-stripping --disable-optimizations --disable-libcelt --disable-indev=oss 
--disable-indev=jack --disable-indev=sndio --disable-outdev=oss --disable-outdev=sndio 
--enable-nonfree --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt 
--enable-gnutls --disable-gmp --enable-gpl --disable-hardcoded-tables --enable-iconv 
--disable-libxml2 --disable-lzma --enable-network --disable-opencl --disable-openssl 
--enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --disable-vaapi 
--disable-vdpau --disable-vulkan --enable-xlib --enable-libxcb --enable-libxcb-shm 
--enable-libxcb-xfixes --enable-zlib --enable-libcdio --disable-libiec61883 
--disable-libdc1394 --enable-libcaca --disable-openal --disable-opengl --enable-libv4l2 
--disable-libpulse --disable-libdrm --disable-libjack --disable-libopencore-amrwb 
--disable-libopencore-amrnb --disable-libcodec2 --enable-libdav1d --enable-libfdk-aac 
--disable-libopenjpeg --disable-libbluray --disable-libgme --disable-libgsm 
--disable-libaribb24 --disable-mmal --disable-libmodplug --disable-libopus 
--disable-libilbc --disable-librtmp --disable-libssh --disable-libspeex --disable-libsrt 
--disable-librsvg --disable-ffnvcodec --disable-libvorbis --disable-libvpx --disable-libzvbi 
--disable-appkit --disable-libbs2b --disable-chromaprint --disable-cuda-llvm 
--disable-libflite --disable-frei0r --disable-libvmaf --disable-libfribidi 
--disable-fontconfig --disable-ladspa --enable-libass --disable-libtesseract 
--disable-lv2 --disable-libfreetype --disable-libvidstab --disable-librubberband 
--disable-libzmq --disable-libzimg --disable-libsoxr --enable-pthreads --disable-amf 
--disable-libvo-amrwbenc --disable-libkvazaar --disable-libaom --enable-libmp3lame 
--disable-libopenh264 --disable-librav1e --disable-libsnappy --disable-libsvtav1 
--disable-libtheora --disable-libtwolame --disable-libwebp --enable-libx264 --enable-libx265 
--enable-libxvid --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon 
--disable-vfp --disable-vfpv3 --disable-armv8 --disable-mipsdsp --disable-mipsdspr2 
--disable-mipsfpu --disable-altivec --disable-vsx --disable-power8 --disable-amd3dnow 
--disable-amd3dnowext --disable-aesni --disable-avx --disable-avx2 --disable-fma3 
--disable-fma4 --disable-sse3 --disable-ssse3 --disable-sse4 --disable-sse42 --disable-xop 
--cpu=host --disable-doc --disable-htmlpages --enable-manpages
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100