
Recherche avancée
Autres articles (24)
-
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 (...)
-
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
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 (...)
Sur d’autres sites (3324)
-
"Non-monotonous DTS" and jerky video when copying streams
2 décembre 2017, par forthrinI’m switching containers from MKV to mp4 for a set of video files. This has worked for all videos before, but now I’m getting weird problems (also when converting from MKV to another MKV !)
- I’m getting a million
Non-monotonous DTS in output stream
messages - With QuickTime on macOS the video is jerking back and forth very fast while playing
- With VLC on macOS, the video is skipping a lot of frames
How can I fix this, without re-encoding the video stream ? (Re-encoding audio would be acceptable.) Somehow it must be possible since the original MKV works perfectly !
$ ffmpeg -i in.mkv -codec copy out.mp4
ffmpeg version 3.3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.37)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-libass --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Input #0, matroska,webm, from 'in.mkv':
Metadata:
ENCODER : Lavf54.63.104
Duration: 00:37:59.98, start: 0.200000, bitrate: 2536 kb/s
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
[mp4 @ 0x7f93c9006c00] track 1: codec frame size is not set
Output #0, mp4, to 'out.mp4':
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: h264 (High) ([33][0][0][0] / 0x0021), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 16k tbn, 1k tbc
Stream #0:1(eng): Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x7f93c9006c00] Non-monotonous DTS in output stream 0:0; previous: 60720, current: 60064; changing to 60721. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7f93c9006c00] Non-monotonous DTS in output stream 0:0; previous: 63392, current: 62736; changing to 63393. This may result in incorrect timestamps in the output file.
(...repeats a million times...)MP4Box :
$ MP4Box -add in.mkv out.mp4
[MPEG-2 TS] TS Packet 1 is scrambled - not supported
[MPEG-2 TS] TS Packet 3 does not start with sync marker
...
[MPEG-2 TS] TS Packet 999 does not start with sync marker
[Importer] Unknown input file type
Error importing in.mkv: Corrupted Data in file/streamSo the file is maybe corrupt ? (Though it plays perfectly to begin with, in VLC at least !) Is there any way I can repair it and convert it to an mp4 file, again without re-encoding the video stream ?
- I’m getting a million
-
How to properly wrap H264 into FLV with FFMPEG ?
9 août 2017, par mOflFirst of all, the "properly" in the title refers to this related question, of which answer does not solve my problem.
tl ;dr : There is a difference between encoding a video and directly storing it into FLV and doing this in two separate steps. I need to do it separately, how do I get the same result as doing it directly ?
Nvidia’s hardware encoder NVENC produces raw H.264 data without a container, which is difficult to play in most video players. For an Adobe AIR application, I need to wrap the video into the FLV format, for which I wanted to use FFMPEG :
ffmpeg -f h264 -i "input.h264" -c copy -f flv "output.flv"
This did not work as expected, because the first frame of each video treated this way is simply not shown. Each video is only displayed from the second frame, which is a shame for single-frame videos (using the GPU’s hardware encoder for lightning-fast image compression only).
For inspection, I now reencode the input video twice : once directly to FLV output
ffmpeg -f h264 -i "input.h264" -c:v h264_nvenc -f flv "A.flv"
and once to H.264, then shoving it into an FLV afterwards.
ffmpeg -f h264 -i "input.h264" -c:v h264_nvenc -f h264 "reencode.h264"
ffmpeg -f h264 -i "reencode.h264" -c copy -f flv "B.flv"The first video plays fine, the second does not. The resulting FLV of the direct approach (A.flv, see below) has a slightly different file structure, especially the NAL unit differs, which I suspect is the reason for the different behavior.
So, my question is : If I already have a H.264 video and only want it to be copied into an FLV container without being transcoded, but the file and frame headers should be filled in correctly as is done when actually transcoding, how do I tell this to FFMPEG ? Are there commands for this, such as "-c copy butGenerateValidHeader" ?
Here the relevant portions of the files :
Direct approach
ffmpeg -f h264 -i "input.h264" -c:v h264_nvenc -f flv "A.flv"
A.flv
46 4C 56 01 01 00 00 00 09 00 00 00 00 12 00 00 // FLV header + metadata
B8 00 00 00 00 00 00 00 02 00 0A 6F 6E 4D 65 74
61 44 61 74 61 08 00 00 00 08 00 08 64 75 72 61
74 69 6F 6E 00 3F A0 E5 60 41 89 37 4C 00 05 77
69 64 74 68 00 40 93 80 00 00 00 00 00 00 06 68
65 69 67 68 74 00 40 8E F0 00 00 00 00 00 00 0D
76 69 64 65 6F 64 61 74 61 72 61 74 65 00 40 9E
84 80 00 00 00 00 00 09 66 72 61 6D 65 72 61 74
65 00 40 3E 00 00 00 00 00 00 00 0C 76 69 64 65
6F 63 6F 64 65 63 69 64 00 40 1C 00 00 00 00 00
00 00 07 65 6E 63 6F 64 65 72 02 00 0D 4C 61 76
66 35 37 2E 37 31 2E 31 30 30 00 08 66 69 6C 65
73 69 7A 65 00 40 F9 5C B0 00 00 00 00 00 00 09
00 00 00 C3 09 00 00 2B 00 00 00 00 00 00 00 17 // AVC sequence start
00 00 00 00
01 4D 40 20 FF E1 00 17 // ?
67 4D 40 20 // Sequence parameter set
95 A0 13 81 F7 EB 01 10 00 00 3E 80 00 0E A6 08
F1 C3 2A
01 00 04 // ?
68 EE 3C 80 // Picture parameter set
00 00 00 36 09 01 // AVC NALU
94 9A 00 00 00 00 00 00 00 17 01 00 00 00
00 01 // ?
94 91
65 // IDR frame
[B8 04 1D FF ...]
00 01 94 A5 09 00 00 05 00 00 00 00 00 00 00 // ?
17 // AVC sequence end
02 00 00 00 00 00 00 10Encoding first
ffmpeg -f h264 -i "input.h264" -c:v h264_nvenc -f h264 "reencode.h264"
reencode.h264
00 00 00 01 67 4D 40 20 95 A0 13 81 F7 EB 01 10 // Sequence parameter set
00 00 3E 80 00 0E A6 08 F1 C3 2A
00 00 00 01 68 // Picture parameter set
EE 3C 80
00 00 00 01 65 // IDR frame
[B8 04 1D FF ...] // Frame dataSqueeze into container
ffmpeg -f h264 -i "reencode.h264" -c copy -f flv "B.flv"
B.flv
46 4C 56 01 01 00 00 00 09 00 00 00 00 12 00 00 // FLV header + metadata
A4 00 00 00 00 00 00 00 02 00 0A 6F 6E 4D 65 74
61 44 61 74 61 08 00 00 00 07 00 08 64 75 72 61
74 69 6F 6E 00 3F A4 7A E1 47 AE 14 7B 00 05 77
69 64 74 68 00 40 93 80 00 00 00 00 00 00 06 68
65 69 67 68 74 00 40 8E F0 00 00 00 00 00 00 0D
76 69 64 65 6F 64 61 74 61 72 61 74 65 00 00 00
00 00 00 00 00 00 00 0C 76 69 64 65 6F 63 6F 64
65 63 69 64 00 40 1C 00 00 00 00 00 00 00 07 65
6E 63 6F 64 65 72 02 00 0D 4C 61 76 66 35 37 2E
37 31 2E 31 30 30 00 08 66 69 6C 65 73 69 7A 65
00 40 F9 5B 40 00 00 00 00 00 00 09
00 00 00 AF // AVC sequence start
09 00 00 05 00 00 00 00 00 00 00 17 00 00 00 00
00 00 00 10 09 01 94 BD 00 00 00 00 00 00 00 17 // AVC NALU
01 00 00
00 00 00 00 01 67 4D 40 20 95 A0 13 81 // Sequence parameter set
F7 EB 01 10 00 00 3E 80 00 0E A6 08 F1 C3 2A
00 // Picture parameter set
00 00 01 68 EE 3C 80
00 00 00 01 65 // IDR frame
[B8 04 1D FF // Frame data
...]
00 01 94 C8 09 00 00 05 00 00 00 00 00 00 00 // ?
17 // AVC sequence end
02 00 00 00 00 00 00 10Update 08.08.2017 : Added input and output files for examination
- input.h264
- ffmpeg -f h264 -i "input.h264" -c copy "copy.flv"
- ffmpeg -f h264 -i "input.h264" -c:v h264_nvenc -f flv "A.flv"
- ffmpeg -f h264 -i "input.h264" -c:v h264_nvenc -f h264 "reencode.h264"
- ffmpeg -f h264 -i "reencode.h264" -c copy -f flv "B.flv"
- ffmpeg -f h264 -i "reencode.h264" -c copy -bsf:v extract_extradata -f flv "extradata.flv"
-
ffmpeg concat error-unusual video
19 juillet 2017, par Samhita vempattiI have been trying to concatenate two 48 seconds video bits to one using the following command
ffmpeg -f concat -safe 0 -i C:\moviepy-master\concat.txt -c copy output.mp4
When I played it using Windows media player the first 48 second plays fine but the player closes before playing the second bit .
Then I tried to play it using VLC media player but in the second bit player but the audio and video are not in sync .
Then I also tried giving inputs separately so the following error shows up
C:\Users\SAMHITA VVNK>ffmpeg -f concat -safe 0 -i C:\moviepy-master\extract1.mp4
-i C:\moviepy-master\extract2.mp4 -c copy -flags +global_header output.mp4
ffmpeg version N-86723-g3b3501f Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --e
nable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --
enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-li
bfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug -
-enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enabl
e-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolam
e --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable
-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 67.100 / 55. 67.100
libavcodec 57.100.103 / 57.100.103
libavformat 57. 75.100 / 57. 75.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 94.100 / 6. 94.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
C:\moviepy-master\extract1.mp4: Invalid data found when processing inputThese are the input file’s specifications are as follows
C :\Users\SAMHITA VVNK>ffmpeg -i C :\moviepy-master\extract.mp4 -filter_complex "[
0:v]setpts=0.5*PTS[v] ;[0:a]atempo=2.0" -map "[a]" extract1fast.mp4C:\Users\SAMHITA VVNK>ffmpeg -i C:\moviepy-master\extract2.mp4 -i C:\moviepy-mas
ter\extract1.mp4
ffmpeg version N-86723-g3b3501f Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --e
nable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --
enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-li
bfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug -
-enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enabl
e-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolam
e --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable
-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 67.100 / 55. 67.100
libavcodec 57.100.103 / 57.100.103
libavformat 57. 75.100 / 57. 75.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 94.100 / 6. 94.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\moviepy-master\extract2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.56.101
Duration: 00:00:49.00, start: 0.012993, bitrate: 785 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yu
v420p(tv, smpte170m/smpte170m/bt709), 640x360, 668 kb/s, 29.97 fps, 29.97 tbr, 1
1988 tbn, 23976 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp,
137 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\moviepy-master\extract1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.56.101
Duration: 00:00:49.00, start: 0.012993, bitrate: 526 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [
SAR 1:1 DAR 16:9], 462 kb/s, 24.86 fps, 24.86 tbr, 19888 tbn, 49.72 tbc (default
)
Metadata:
handler_name : VideoHandler
Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 95 kb/s (default)
Metadata:
handler_name : SoundHandler