
Recherche avancée
Autres articles (47)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (3516)
-
How to concat videos with FFMPEG without a black frame in the middle
21 juillet 2020, par david kI need to join two videos together programmatically, and FFMPEG seems to be working perfectly except it leaves a single black frame between the two joined videos.


Based on this post, I'm guessing it's because the video and audio streams aren't exactly the same length (not sure why). Since I'm seeing a black flash, I'm guessing that the audio is slightly longer than the video, but I can't figure out how to remedy that. I'm fine losing a tiny piece of the audio at the end of the file.


Can anyone help me "trim" the end of my audio stream so that it matches my video stream ? I need to be able to do this for many files, so I can't just hard-code a value into my command.


I've attempted both of the methods that FFMPEG provides to concat, and both of them have this issue. I'd be fine with either approach, if I can get rid of the black frame.


Transcode :


ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex \
 "[0:v][0:a][1:v][1:a] concat=n=2:v=1:a=1 [outv] [outa]" \
 -map "[outv]" -map "[outa]" output.mp4



Re-wrap :


ffmpeg -f concat -i files.txt -c copy output.mp4



Here is the output of ffmpeg -i video1.mp4 -i video2.mp4 :


ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with Apple clang version 11.0.0 (clang-1100.0.33.16)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.0.1.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.0.1.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video1.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2020-07-20T20:43:05.000000Z
 Duration: 00:00:09.88, start: 0.000000, bitrate: 1330 kb/s
 Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 53 kb/s (default)
 Metadata:
 creation_time : 2020-07-20T20:43:05.000000Z
 handler_name : AAC audio
 Stream #0:1(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 1274 kb/s, 25 fps, 25 tbr, 30k tbn, 60k tbc (default)
 Metadata:
 creation_time : 2020-07-20T20:43:05.000000Z
 handler_name : H.264/AVC video
 encoder : AVC Coding
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'video2.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2020-07-20T20:43:06.000000Z
 Duration: 00:00:11.68, start: 0.000000, bitrate: 1346 kb/s
 Stream #1:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 53 kb/s (default)
 Metadata:
 creation_time : 2020-07-20T20:43:06.000000Z
 handler_name : AAC audio
 Stream #1:1(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 1289 kb/s, 25 fps, 25 tbr, 30k tbn, 60k tbc (default)
 Metadata:
 creation_time : 2020-07-20T20:43:06.000000Z
 handler_name : H.264/AVC video
 encoder : AVC Coding
At least one output file must be specified



-
Remuxing MKV to MP4 fails when using -map 0 but works fine when Remuxing MP4 to MKV
20 septembre 2020, par AppetiteForDestructionI have an MKV file that contains 5 streams...


0 : video

1 : audio

2 : audio

3 : text

4 : menu

I was able to remux the MKV into an MP4 using this command...


> ffmpeg.exe -i input.mp4 -map 0 -c copy -c:s mov_text output.mkv



The resulting output MP4 contains all the streams from the original MKV.


But if I try to remux the output MP4 into an MKV using the same command, but with a different codec for the subtitles (srt) and different file extension (mkv), I get an error. However, if I omit "-map 0" from the command, it works but only ONE of the audio streams get copied to the output MKV file.


====================

 Steps to Reproduce

====================

These two commands work, however, the output MKV only contains ONE of the TWO audio streams...


> ffmpeg.exe -i input.mp4 -c copy -c:s srt output.mkv
> ffmpeg.exe -i input.mp4 -c:v copy -c:a copy -c:s srt output.mkv



When I try to use either of the two commands below using "-map 0" just like I did when I remuxed the original MKV into an MP4, the commands fail and both result in the "Full Output" shown at the bottom...


> ffmpeg.exe -i input.mp4 -map 0 -c copy -c:s srt output.mkv
> ffmpeg.exe -i input.mp4 -map 0 -c:v copy -c:a copy -c:s srt output.mkv



Output Error


Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument



So why would using "-map 0" cause it to fail when I used the exact same command to remux the original MKV into an MP4 ? And why does omitting "-map 0" allow it to work, but obviously doesn't copy both audio streams ? Seems like a BUG to me because why does practically the exact same command work for going from MKV to MP4, but not from MP4 to MKV ?


Full Output


ffmpeg version git-2020-07-20-43a08d9 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9.3.1 (GCC) 20200621
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
 libavutil 56. 55.100 / 56. 55.100
 libavcodec 58. 96.100 / 58. 96.100
 libavformat 58. 48.100 / 58. 48.100
 libavdevice 58. 11.101 / 58. 11.101
 libavfilter 7. 87.100 / 7. 87.100
 libswscale 5. 8.100 / 5. 8.100
 libswresample 3. 8.100 / 3. 8.100
 libpostproc 55. 8.100 / 55. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\input.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2mp41
 encoder : Lavf58.48.100
 Duration: 00:11:03.90, start: 0.000000, bitrate: 5873 kb/s
 Chapter #0:0: start 0.000000, end 663.872000
 Metadata:
 title : Chapter 01
 Stream #0:0(eng): Video: mpeg2video (Main) (mp4v / 0x7634706D), yuv420p(tv, smpte170m, top first), 720x480 [SAR 8:9 DAR 4:3], 5546 kb/s, 29.97 fps, 29.97 tbr, 16k tbn, 59.94 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Side data:
 cpb: bitrate max/min/avg: 8500000/0/0 buffer size: 1835008 vbv_delay: N/A
 Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp, 160 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 Side data:
 audio service type: main
 Stream #0:2(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp, 160 kb/s
 Metadata:
 handler_name : SoundHandler
 Side data:
 audio service type: main
 Stream #0:3(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
 Metadata:
 handler_name : SubtitleHandler
 Stream #0:4(eng): Data: bin_data (text / 0x74786574)
 Metadata:
 handler_name : SubtitleHandler
Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options specified for stream 3, only the last option '-c:s srt' will be used.
[matroska @ 0000002df6f90f40] Only audio, video, and subtitles are supported for Matroska.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
 Stream #0:2 -> #0:2 (copy)
 Stream #0:3 -> #0:3 (mov_text (native) -> subrip (srt))
 Stream #0:4 -> #0:4 (copy)
 Last message repeated 1 times



-
Extract frame timecodes from DV AVI
21 juillet 2020, par Davor JosipovicI have some ancient DV AVI files (Type 1) from my camcorder.


I would like to export the
timecode
of each frame to a seperate file. Here I read thatffprobe
supports timecode extraction, but it is confusing since it mentions-show_format
. As far as I know, DV AVI format encodes timecodes per frame.

Anyway here is what I get for
ffprobe -show_format testcc.avi
:

ffprobe version 4.3 Copyright (c) 2007-2020 the FFmpeg developers
 built with gcc 9.3.1 (GCC) 20200621
 configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
[avi @ 0000025da5e55bc0] Switching to NI mode, due to poor interleaving
Input #0, avi, from 'testcc.avi':
 Duration: 00:06:16.68, start: 0.000000, bitrate: 28882 kb/s
 Stream #0:0: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR 4:3], 25000 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
 Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[FORMAT]
filename=testcc.avi
nb_streams=2
nb_programs=0
format_name=avi
format_long_name=AVI (Audio Video Interleaved)
start_time=0.000000
duration=376.680000
size=1359912960
bit_rate=28882084
probe_score=100
[/FORMAT]



And for
ffprobe -show_frames testcc.avi
:

...
[FRAME]
media_type=video
stream_index=0
key_frame=1
pkt_pts=0
pkt_pts_time=0.000000
pkt_dts=0
pkt_dts_time=0.000000
best_effort_timestamp=0
best_effort_timestamp_time=0.000000
pkt_duration=1
pkt_duration_time=0.040000
pkt_pos=65032
pkt_size=144000
width=720
height=576
pix_fmt=yuv420p
sample_aspect_ratio=16:15
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
color_range=unknown
color_space=unknown
color_primaries=unknown
color_transfer=unknown
chroma_location=topleft
[/FRAME]
[FRAME]
...



And for
ffprobe -show_streams testcc.avi
:

[STREAM]
index=0
codec_name=dvvideo
codec_long_name=DV (Digital Video)
profile=unknown
codec_type=video
codec_time_base=1/25
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=720
height=576
coded_width=720
coded_height=576
closed_captions=0
has_b_frames=0
sample_aspect_ratio=16:15
display_aspect_ratio=4:3
pix_fmt=yuv420p
level=-99
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=topleft
field_order=unknown
timecode=N/A
refs=1
id=N/A
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/25
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=25000000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]
[STREAM]
index=1
codec_name=pcm_s16le
codec_long_name=PCM signed 16-bit little-endian
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=s16
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=16
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/30000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=1536000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]



I don't see any
timecode
. In Movie Maker (yes I know... it's on an old VM) I do see all the correcttimecodes
per frame. So what am I doing wrong ?