
Recherche avancée
Médias (3)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (52)
-
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 (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (5689)
-
FFMpeg SetSar value gets overriden
8 décembre 2015, par user650922I have a video concatenating application where In all videos are converted to the same format .
I am converting 640*360 video to 1080*720 with setsar=1:1 as
ffmpeg -i C :\Users\work\Desktop\Esocializ\B.mp4 -s 1080*720 -ac 2 -vf setsar=1 :
1 -acodec aac -strict experimental B1.mp4.However for some reasons its value get overridden.
Any help would be appreciated .
Below is my console output :
C:\Users\work\Downloads\ffmpeg-20151130-git-7b11eea-win64-static\ffmpeg-20151130
-git-7b11eea-win64-static\bin
>ffmpeg -i C:\Users\work\Desktop\Esocializ\B.mp4 -s 1080*720 -ac 2 -vf setsar=1:
1 -acodec aac -strict experimental B1.mp4
ffmpeg version N-76957-g7b11eea Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --
enable-lzma --enable-decklink --enable-zlib
libavutil 55. 9.100 / 55. 9.100
libavcodec 57. 16.101 / 57. 16.101
libavformat 57. 19.100 / 57. 19.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 17.100 / 6. 17.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\work\Desktop\Esocializ\B.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2015-02-11 06:48:50
Duration: 00:00:35.04, start: 0.000000, bitrate: 676 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yu
v420p, 640x360 [SAR 1:1 DAR 16:9], 577 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc (def
ault)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 95 kb/s (default)
Metadata:
creation_time : 2015-02-11 06:48:50
handler_name : IsoMedia File Produced by Google, 5-11-2011
[Parsed_setsar_0 @ 000000f8a4c8bf20] num:den syntax is deprecated, please use nu
m/den or named options instead
[libx264 @ 000000f8a4919400] using SAR=32/27
[libx264 @ 000000f8a4919400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 000000f8a4919400] profile High, level 3.1
[libx264 @ 000000f8a4919400] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 dec
imate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b
_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=
25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.
60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'B1.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf57.19.100
Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1
080x720 [SAR 32:27 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc57.16.101 libx264
Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, flt
p, 128 kb/s (default)
Metadata:
creation_time : 2015-02-11 06:48:50
handler_name : IsoMedia File Produced by Google, 5-11-2011
encoder : Lavc57.16.101 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 64 fps=0.0 q=29.0 size= 40kB time=00:00:01.92 bitrate= 168.9kbits/
frame= 118 fps=115 q=29.0 size= 297kB time=00:00:03.87 bitrate= 626.4kbits/
frame= 166 fps=109 q=29.0 size= 589kB time=00:00:05.34 bitrate= 904.1kbits/
frame= 212 fps=104 q=29.0 size= 892kB time=00:00:06.80 bitrate=1074.1kbits/
frame= 250 fps= 98 q=29.0 size= 1201kB time=00:00:08.26 bitrate=1190.0kbits/
frame= 293 fps= 96 q=29.0 size= 1565kB time=00:00:09.72 bitrate=1318.0kbits/
frame= 335 fps= 94 q=29.0 size= 1897kB time=00:00:11.19 bitrate=1388.7kbits/
frame= 374 fps= 92 q=29.0 size= 2227kB time=00:00:12.56 bitrate=1452.5kbits/
frame= 418 fps= 91 q=29.0 size= 2623kB time=00:00:13.93 bitrate=1542.3kbits/
frame= 462 fps= 91 q=29.0 size= 2994kB time=00:00:15.11 bitrate=1622.5kbits/
frame= 499 fps= 89 q=29.0 size= 3306kB time=00:00:16.55 bitrate=1635.7kbits/
frame= 539 fps= 88 q=29.0 size= 3591kB time=00:00:18.01 bitrate=1632.5kbits/
frame= 579 fps= 88 q=29.0 size= 3886kB time=00:00:19.27 bitrate=1651.9kbits/
frame= 623 fps= 88 q=29.0 size= 4184kB time=00:00:20.48 bitrate=1673.4kbits/
frame= 660 fps= 87 q=29.0 size= 4497kB time=00:00:21.91 bitrate=1680.8kbits/
frame= 696 fps= 86 q=29.0 size= 4801kB time=00:00:23.28 bitrate=1688.8kbits/
frame= 742 fps= 86 q=29.0 size= 5119kB time=00:00:24.84 bitrate=1687.9kbits/
frame= 788 fps= 86 q=29.0 size= 5439kB time=00:00:26.30 bitrate=1693.7kbits/
frame= 831 fps= 86 q=29.0 size= 5736kB time=00:00:27.77 bitrate=1692.2kbits/
frame= 878 fps= 86 q=29.0 size= 6041kB time=00:00:29.23 bitrate=1692.7kbits/
frame= 930 fps= 87 q=29.0 size= 6325kB time=00:00:31.18 bitrate=1661.6kbits/
frame= 989 fps= 88 q=29.0 size= 6551kB time=00:00:32.99 bitrate=1626.4kbits/
frame= 1043 fps= 89 q=29.0 size= 6786kB time=00:00:34.64 bitrate=1604.5kbits/
frame= 1051 fps= 86 q=-1.0 Lsize= 7172kB time=00:00:35.03 bitrate=1676.7kbits
/s
video:6600kB audio:541kB subtitle:0kB other streams:0kB global headers:0kB muxin
g overhead: 0.433214%
[libx264 @ 000000f8a4919400] frame I:7 Avg QP:21.73 size: 19053
[libx264 @ 000000f8a4919400] frame P:1006 Avg QP:26.11 size: 6523
[libx264 @ 000000f8a4919400] frame B:38 Avg QP:27.27 size: 1616
[libx264 @ 000000f8a4919400] consecutive B-frames: 93.7% 4.2% 0.6% 1.5%
[libx264 @ 000000f8a4919400] mb I I16..4: 10.1% 82.1% 7.8%
[libx264 @ 000000f8a4919400] mb P I16..4: 3.3% 5.4% 0.6% P16..4: 22.7% 7.4
% 2.4% 0.0% 0.0% skip:58.2%
[libx264 @ 000000f8a4919400] mb B I16..4: 0.4% 0.4% 0.0% B16..8: 19.6% 2.1
% 0.3% direct: 0.4% skip:76.9% L0:45.9% L1:48.7% BI: 5.4%
[libx264 @ 000000f8a4919400] 8x8 transform intra:59.5% inter:77.2%
[libx264 @ 000000f8a4919400] coded y,uvDC,uvAC intra: 34.4% 45.3% 13.7% inter: 9
.7% 10.1% 0.3%
[libx264 @ 000000f8a4919400] i16 v,h,dc,p: 36% 50% 3% 11%
[libx264 @ 000000f8a4919400] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 25% 26% 3% 4%
5% 4% 4% 4%
[libx264 @ 000000f8a4919400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 29% 17% 2% 4%
5% 4% 3% 2%
[libx264 @ 000000f8a4919400] i8c dc,h,v,p: 51% 25% 18% 6%
[libx264 @ 000000f8a4919400] Weighted P-Frames: Y:0.5% UV:0.4%
[libx264 @ 000000f8a4919400] ref P L0: 81.7% 10.7% 5.9% 1.7% 0.0%
[libx264 @ 000000f8a4919400] ref B L0: 92.3% 7.2% 0.5%
[libx264 @ 000000f8a4919400] ref B L1: 98.9% 1.1%
[libx264 @ 000000f8a4919400] kb/s:1543.06
[aac @ 000000f8a491dec0] Qavg: 686.824
C:\Users\work\Downloads\ffmpeg-20151130-git-7b11eea-win64-static\ffmpeg-20151130
-git-7b11eea-win64-static\bin
>ffmpeg -i B1.mp4
ffmpeg version N-76957-g7b11eea Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --
enable-lzma --enable-decklink --enable-zlib
libavutil 55. 9.100 / 55. 9.100
libavcodec 57. 16.101 / 57. 16.101
libavformat 57. 19.100 / 57. 19.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 17.100 / 6. 17.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'B1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.19.100
Duration: 00:00:35.06, start: 0.023220, bitrate: 1675 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x720
[SAR 32:27 DAR 16:9], 1543 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 126 kb/s (default)
Metadata:
handler_name : SoundHandler
At least one output file must be specified
C:\Users\work\Downloads\ffmpeg-20151130-git-7b11eea-win64-static\ffmpeg-20151130
-git-7b11eea-win64-static\bin
> -
Issue when combining 2 video files [after matching the specs]
6 décembre 2015, par RuneBasically I got a .mp4 and a .flv file which I want to concatenate (the .mp4 should be the intro).
So after having asked a previous question regarding this I went ahead and converted the intro video to an .flv with matching specifications of the second video.
First I got the specifications of the second (.flv) video using ffprobe. This was the output :
{
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_time_base": "1/50",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 646,
"height": 364,
"coded_width": 656,
"coded_height": 368,
"has_b_frames": 2,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "323:182",
"pix_fmt": "yuv420p",
"level": 30,
"chroma_location": "left",
"refs": 5,
"is_avc": "true",
"nal_length_size": "4",
"r_frame_rate": "25/1",
"avg_frame_rate": "25/1",
"time_base": "1/1000",
"start_pts": 80,
"start_time": "0.080000",
"bit_rate": "400000",
"bits_per_raw_sample": "8",
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_time_base": "1/44100",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "44100",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": 241,
"start_time": "0.241000",
"bit_rate": "96000",
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0
}
}
],
"format": {
"filename": "vid2.flv",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "flv",
"format_long_name": "FLV (Flash Video)",
"start_time": "0.080000",
"duration": "371.920000",
"size": "23876671",
"bit_rate": "513587",
"probe_score": 100,
"tags": {
"audiosize": "4476626",
"canSeekToEnd": "true",
"datasize": "23876671",
"videosize": "19004263",
"hasAudio": "true",
"hasCuePoints": "false",
"hasKeyframes": "true",
"hasMetadata": "true",
"hasVideo": "true",
"lasttimestamp": "372",
"metadatacreator": "flvtool++ (Facebook, Motion project, dweatherford)",
"totalframes": "9298",
"encoder": "Lavf56.36.100"
}
}
}Here’s my command :
-i prefix.mp4 -b:v 400k -b:a 96k -r 25 -ar 44100 -acodec aac -vf scale=646:364 -strict -2 prefix.flv
.This produces the following output (as well as the video file) :
ffmpeg version N-76137-gb0bb1dc Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 4.100 / 55. 4.100
libavcodec 57. 7.100 / 57. 7.100
libavformat 57. 8.102 / 57. 8.102
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 12.100 / 6. 12.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'prefix.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.8.102
Duration: 00:00:05.31, start: 0.000000, bitrate: 1589 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1205 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 384 kb/s (default)
Metadata:
handler_name : SoundHandler
Output #0, flv, to 'prefix.flv':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.8.102
Stream #0:0(und): Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 646x364 [SAR 2912:2907 DAR 16:9], q=2-31, 400 kb/s, 25 fps, 1k tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc57.7.100 flv
Stream #0:1(und): Audio: aac ([10][0][0][0] / 0x000A), 44100 Hz, 5.1, fltp, 96 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc57.7.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> flv1 (flv))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 79 fps=0.0 q=10.7 size= 381kB time=00:00:03.43 bitrate= 908.7kbits/frame= 132 fps=0.0 q=10.1 Lsize= 548kB time=00:00:05.31 bitrate= 844.1kbits/s
video:479kB audio:62kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.161623%
[aac @ 0000021aa893eae0] Qavg: 177.292I then run the outputted video file and it runs just like the old one.
I then concatenate the ouputted intro file with my main video file using the following command (tmp.txt contains the 2 files) :
-f concat -i tmp.txt -c copy newvid.flv
This produces the following output :
ffmpeg version N-76137-gb0bb1dc Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 4.100 / 55. 4.100
libavcodec 57. 7.100 / 57. 7.100
libavformat 57. 8.102 / 57. 8.102
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 12.100 / 6. 12.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, concat, from 'tmp.txt':
Duration: N/A, start: 0.000000, bitrate: 496 kb/s
Stream #0:0: Video: flv1, yuv420p, 646x364, 400 kb/s, 25 fps, 25 tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: aac (LC), 44100 Hz, 5.1, fltp, 96 kb/s
[flv @ 00000257b5f0e180] Codec for stream 0 does not use global headers but container format requires global headers
[flv @ 00000257b5f0e180] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, flv, to 'newvid.flv':
Metadata:
encoder : Lavf57.8.102
Stream #0:0: Video: flv1 ([2][0][0][0] / 0x0002), yuv420p, 646x364, q=2-31, 400 kb/s, 25 fps, 25 tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: aac ([10][0][0][0] / 0x000A), 44100 Hz, 5.1, 96 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[flv @ 00000257b56947e0] Packet mismatch 486539264 7424
[flv @ 00000257b56947e0] Auto-inserting h264_mp4toannexb bitstream filter
[flv @ 00000257b5f0e180] Non-monotonous DTS in output stream 0:0; previous: 5263, current: 5255; changing to 5263. This may result in incorrect timestamps in the output file.
frame= 6359 fps=0.0 q=-1.0 size= 15906kB time=00:04:14.30 bitrate= 512.4kbits/frame= 9428 fps=0.0 q=-1.0 Lsize= 23835kB time=00:06:17.05 bitrate= 517.8kbits/s
video:19016kB audio:4403kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.777447%When I try to run the final video (newvid.flv) it plays like this :
It starts off playing the intro just fine.
However, when the intro is finished the video freezes while the sound of the actual video continues for the entire duration of the video.Thus in conclusion what is lacking is the video of the second vid (the audio is fine).
I’m new at using ffmpeg but I’ve tried my best to solve this, which is why I’m asking for your help.
I’d certainly appreciate if someone could help me out.
-
FFMPEG Converted Video Not Working In HTML5
27 novembre 2015, par Suprabhat BiswalConverted Avi to Mp4 using FFMPEG, Converted video not working in html
5I have a section in my web page where user can upload any types of videos of any format , currently only restricted to .mp4 and .avi. After successfull upload i have displayed the same video to the user. I have bind the path in HTML5 video so that the user can view the content he/she has uploded. Video with extension .mp4 no doubt are working properly as HTML5 support them. Tricky part is it don’t support Avi files. Now here what the problem has arised. In order to display avi videos i have used FFMPEG to convert videos with extension .avi to .mp4. With lots of googling and reading forum, i have succesfully converted avi videos to mp4 . Here’s what i have used :-
-
ffmpeg -i input.avi -acodec libfaac -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4
-
ffmpeg -i input.avi -c:v libx264 -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4
Above two are working perfectly, they have succesfully converted the video. But when i run them on browser in HTML5 and in new tab (Flash Player Plugin Installed), HTML5 doesn’t play it and flash player return an error message "Video can’t be played because the file is corrupt". But when i played them on KMplayer and in Window media player they are running perfectly.
I have been to various threads in stackoverflow related to convert avi to mp4 and here i found following in one of the forum. where one of user has accepted this a correct answer but it ain’t worked out for me.
ffmpeg -y -i sample.avi -b:v 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 sample.mp4
Above argument returned me following error "File for preset ’slow’ not found".
Following my futher searches i came across this thread ffmpeg convert mov file to mp4 for HTML5 video tag IE9. Here following argument worked perfectly and it able to convert video in such way that it is playble on browser.
ffmpeg -y -i input.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k -pix_fmt yuv420p output.mp4
.
Problem i faced here was video is converted to 420p reso which quality is noty upto mark. Smaller resolution videos are been enlarged and seems pixelated
Thus, i had to finally put up a question. I will be very obliged if someone can give a solution for above problem. I need to convert an avi video to mp4 supported by HTML5 video tag. It should able to play it on browser and during conversion of video it should maintain original audio and video quality plus resolution.
Thanks
My C# Code :
public void Create(string input, string output, string parametri, string ThumbnailPhysicalPath, int ConvertType)
{
ffmpeg = new Process();
if (ConvertType == Convert.ToInt32(ConversionType.Thumbnail))
ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -vframes 1 \"" + output + "\"";
else if (ConvertType == Convert.ToInt32(ConversionType.AviToMp4))
ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -c:v libx264 -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 \"" + output + "\"";
//ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k -pix_fmt yuv420p \"" + output + "\"";
ffmpeg.StartInfo.FileName = ThumbnailPhysicalPath + @"ffmpeg.exe";
ffmpeg.StartInfo.UseShellExecute = false;
ffmpeg.StartInfo.RedirectStandardOutput = true;
ffmpeg.StartInfo.RedirectStandardError = true;
ffmpeg.StartInfo.CreateNoWindow = true;
try
{
ffmpeg.Start();
ffmpeg.WaitForExit();
string error = ffmpeg.StandardError.ReadToEnd();
}
catch (Exception Ex)
{
Common.WriteLog("Exception occurred during conversion. Error Message :- " + Ex.Message + "\n Input Parameter :- " + input+ "\n Output Paramenter :- "+ output);
}
finally
{
ffmpeg.Close();
if (ConvertType == Convert.ToInt32(ConversionType.AviToMp4))
UpdateConvertedVideoDetails(input,output);
}
}Command Prompt FFMPEG Output :-
Sample 3 Result :-
D:\Client\WebSite\Converter_Tools>ffmpeg -y -i sample.avi -b:v 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 sample.mp4
ffmpeg version N-70239-g111d79a Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
le-zlib
libavutil 54. 19.100 / 54. 19.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 23.105 / 56. 23.105
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.101 / 5. 11.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[avi @ 037c8480] non-interleaved AVI
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'sample.avi':
Duration: 00:00:34.00, start: 0.000000, bitrate: 1433 kb/s
Stream #0:0: Video: cinepak (cvid / 0x64697663), rgb24, 320x240, 15 fps, 15 tbr, 15 tbn, 15 tbc
Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, u8, 176 kb/s
File for preset 'slow' not foundSample 4 Result :-
D:\Client\WebSite\Converter_Tools>ffmpeg -y -i input.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_
aacenc -b:a 128k -pix_fmt yuv420p output.mp4
ffmpeg version N-70239-g111d79a Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
le-zlib
libavutil 54. 19.100 / 54. 19.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 23.105 / 56. 23.105
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.101 / 5. 11.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, avi, from 'input.avi':
Duration: 00:00:03.93, start: 0.000000, bitrate: 3255 kb/s
Stream #0:0: Video: msrle ([1][0][0][0] / 0x0001), pal8, 300x250, 3301 kb/s, 15 fps, 15 tbr, 15 tbn, 15 tbc
[libx264 @ 002ec860] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 002ec860] profile High, level 2.2
[libx264 @ 002ec860] 264 - core 144 r2525 40bb568 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subm
e=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i
nterlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=15 scenecut=40 intra_refresh=0 rc_lookahead=50 rc
=cbr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf56.23.105
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 576x480, q=-1--1, 500 kb/s, 15 fps, 15360 tbn, 15 tbc
Metadata:
encoder : Lavc56.26.100 libx264
Stream mapping:
Stream #0:0 -> #0:0 (msrle (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame= 59 fps= 30 q=-1.0 Lsize= 229kB time=00:00:03.80 bitrate= 493.5kbits/s
video:227kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.637976%
[libx264 @ 002ec860] frame I:3 Avg QP:26.53 size: 10657
[libx264 @ 002ec860] frame P:25 Avg QP:30.49 size: 5608
[libx264 @ 002ec860] frame B:31 Avg QP:32.26 size: 1935
[libx264 @ 002ec860] consecutive B-frames: 22.0% 16.9% 20.3% 40.7%
[libx264 @ 002ec860] mb I I16..4: 16.7% 69.0% 14.4%
[libx264 @ 002ec860] mb P I16..4: 11.1% 29.9% 3.8% P16..4: 21.3% 6.8% 2.6% 0.0% 0.0% skip:24.6%
[libx264 @ 002ec860] mb B I16..4: 1.7% 3.0% 0.3% B16..8: 29.7% 5.6% 0.8% direct: 2.1% skip:56.8% L0:50.5% L1:45.6% BI: 3.9%
[libx264 @ 002ec860] 8x8 transform intra:66.5% inter:79.4%
[libx264 @ 002ec860] direct mvs spatial:93.5% temporal:6.5%
[libx264 @ 002ec860] coded y,uvDC,uvAC intra: 40.3% 48.8% 25.7% inter: 12.4% 8.4% 1.4%
[libx264 @ 002ec860] i16 v,h,dc,p: 19% 59% 6% 17%
[libx264 @ 002ec860] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 25% 16% 7% 8% 6% 11% 7% 10%
[libx264 @ 002ec860] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 21% 9% 7% 9% 8% 10% 7% 10%
[libx264 @ 002ec860] i8c dc,h,v,p: 41% 33% 13% 13%
[libx264 @ 002ec860] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 002ec860] ref P L0: 67.6% 8.1% 9.6% 5.4% 6.6% 2.8%
[libx264 @ 002ec860] ref B L0: 84.6% 10.5% 3.9% 1.0%
[libx264 @ 002ec860] ref B L1: 95.9% 4.1%
[libx264 @ 002ec860] kb/s:472.20 -