
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (98)
-
Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur
8 février 2011, parLa visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
Configuration de la boite multimédia
Dès (...) -
Formulaire personnalisable
21 juin 2013, parCette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire. (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (9236)
-
Using FFmpeg to encode 2pass mp4
30 juin 2016, par Erin.YangI am trying to use FFmpeg to encode my 4K mp4 file to a 2pass 265 mp4 file for the purposes of testing. I am new to video compression and hope I’m making a simple mistake that someone can correct.
All infos in command line as below :
C:\Ying\FF>C:\Ying\FF\ffmpeg.exe -y -i C:\Ying\FF\Xman-4K_50sec_3840x2160.mp4 -preset veryslow -x265-params pass=1 -vcodec hevc -b:v 15M -acodec libvo
_aacenc -b:a 128K C:\Ying\FF\Xman-4K_3840x2160_50sec_15M_H265_veryslow_2pass.mp4
ffmpeg version N-74286-ge5774f2 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.3 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontco
nfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-l
ibfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-am
rwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --en
able-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 30.100 / 54. 30.100
libavcodec 56. 57.100 / 56. 57.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 32.100 / 5. 32.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Ying\FF\Xman-4K_50sec_3840x2160.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : X-MEN__DAYS_OF_FUTURE_PAST.Title800
encoder : Lavf56.40.101
Duration: 00:00:50.01, start: 0.000000, bitrate: 11067 kb/s
Chapter #0:0: start 0.000000, end 50.000000
Metadata:
title : (26)01:17:27:726
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 3840x2160 [SAR 1:1 DAR 16:9], 11492 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (de
fault)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574), 0 kb/s
Metadata:
handler_name : SubtitleHandler
x265 [info]: HEVC encoder version 1.7
x265 [info]: build info [Windows][GCC 4.9.2][64 bit] 8bpp
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x265 [info]: Main profile, Level-5 (Main tier)
x265 [info]: Thread pool created using 32 threads
x265 [info]: frame threads / pool features : 8 / wpp(34 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 3 inter / 3 intra
x265 [info]: ME / range / subpel / merge : dia / 57 / 2 / 1
x265 [info]: Keyframe min / max / scenecut : 25 / 250 / 40
x265 [info]: Lookahead / bframes / badapt : 40 / 8 / 2
x265 [info]: b-pyramid / weightp / weightb / refs: 1 / 1 / 1 / 1
x265 [info]: AQ: mode / str / qg-size / cu-tree : 1 / 1.0 / 64 / 1
x265 [info]: Rate Control / qCompress : ABR-15000 kbps / 0.60
x265 [info]: tools: rd=2 psy-rd=0.30 rdoq=2 psy-rdoq=1.00 early-skip signhide
x265 [info]: tools: tmvp b-intra fast-intra strong-intra-smoothing deblock sao
x265 [info]: tools: stats-write
Output #0, mp4, to 'C:\Ying\FF\Xman-4K_3840x2160_50sec_15M_H265_veryslow_2pass.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : X-MEN__DAYS_OF_FUTURE_PAST.Title800
encoder : Lavf56.40.101
Chapter #0:0: start 0.000000, end 50.000000
Metadata:
title : (26)01:17:27:726
Stream #0:0(und): Video: hevc (libx265) ([35][0][0][0] / 0x0023), yuv420p, 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 15000 kb/s, 30 fps, 15360 tbn, 30
tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc56.57.100 libx265
Stream #0:1(und): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc56.57.100 libvo_aacenc
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
Stream #0:1 -> #0:1 (aac (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
frame= 1502 fps=2.6 q=-0.0 Lsize= 100652kB time=00:00:50.01 bitrate=16485.9kbits/s dup=75 drop=0
video:99814kB audio:782kB subtitle:0kB other streams:0kB global headers:1kB muxing overhead: 0.054657%
x265 [info]: frame I: 11, Avg QP:13.26 kb/s: 59293.48
x265 [info]: frame P: 443, Avg QP:15.21 kb/s: 33977.10
x265 [info]: frame B: 1048, Avg QP:18.35 kb/s: 8420.64
x265 [info]: global : 1502, Avg QP:17.39 kb/s: 16330.84
x265 [info]: Weighted P-Frames: Y:4.5% UV:4.5%
x265 [info]: Weighted B-Frames: Y:1.9% UV:1.6%
x265 [info]: consecutive B-frames: 23.8% 11.9% 14.8% 22.9% 17.8% 7.0% 0.0% 0.0% 1.8%
C:\Ying\FF>C:\Ying\FF\ffmpeg.exe -y -i C:\Ying\FF\Xman-4K_50sec_3840x2160.mp4 -preset veryslow -x265-params pass=2 -vcodec hevc -b:v 15M -acodec libvo
_aacenc -b:a 128K C:\Ying\FF\Xman-4K_3840x2160_50sec_15M_H265_veryslow_2pass.mp4
ffmpeg version N-74286-ge5774f2 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.3 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontco
nfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-l
ibfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-am
rwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --en
able-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 30.100 / 54. 30.100
libavcodec 56. 57.100 / 56. 57.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 32.100 / 5. 32.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Ying\FF\Xman-4K_50sec_3840x2160.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : X-MEN__DAYS_OF_FUTURE_PAST.Title800
encoder : Lavf56.40.101
Duration: 00:00:50.01, start: 0.000000, bitrate: 11067 kb/s
Chapter #0:0: start 0.000000, end 50.000000
Metadata:
title : (26)01:17:27:726
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 3840x2160 [SAR 1:1 DAR 16:9], 11492 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (de
fault)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574), 0 kb/s
Metadata:
handler_name : SubtitleHandler
x265 [info]: HEVC encoder version 1.7
x265 [info]: build info [Windows][GCC 4.9.2][64 bit] 8bpp
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x265 [info]: Main profile, Level-6 (Main tier)
x265 [info]: Thread pool created using 32 threads
x265 [info]: frame threads / pool features : 8 / wpp(34 rows)
x265 [error]: statistics are damaged at line 1495, parser out=1
[libx265 @ 0000000001e97d00] Cannot open libx265 encoder.
Output #0, mp4, to 'C:\Ying\FF\Xman-4K_3840x2160_50sec_15M_H265_veryslow_2pass.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : X-MEN__DAYS_OF_FUTURE_PAST.Title800
encoder : Lavf56.40.101
Chapter #0:0: start 0.000000, end 50.000000
Metadata:
title : (26)01:17:27:726
Stream #0:0(und): Video: hevc, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 30 fps (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc56.57.100 libx265
Stream #0:1(und): Audio: aac, 0 channels, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc56.57.100 libvo_aacenc
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
Stream #0:1 -> #0:1 (aac (native) -> aac (libvo_aacenc))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or heightMediaInfo :
General
Complete name : E:\4K\2ndRound\Xman-4K_50sec_3840x2160.mp4.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 66.0 MiB
Duration : 50s 6ms
Overall bit rate : 11.1 Mbps
Movie name : X-MEN__DAYS_OF_FUTURE_PAST.Title800
Writing application : Lavf56.40.101
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 47s 567ms
Bit rate : 11.5 Mbps
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.046
Stream size : 65.2 MiB (99%)
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 50s 6ms
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 781 KiB (1%)
Menu #1
ID : 3
Codec ID : text
Duration : 50s 0ms
Language : English
Menu #2
00:00:00.000 : (26)01:17:27:726
-
Why when converting avi video file to another format the first 2-3 seconds are blurry ?
13 juin 2016, par Sharon GabrielThe source file is avi. The target new file is mp4.
The first 2-3 seconds are blurry. Then after 2-3 second the whole video until the end is smooth and sharp.Another sub question is how come that 2.16 GB avi file after conversion using ffmpeg is only 1.34 MB ? It’s not part of a movie or something it’s collection of screenshots images i did in c# and then used AviFile Lib to create from them a avi video file. and yet from 2.16 GB to 1.34 MB and it keep the quality i think almost the same quality like the original avi file and the same duration 2:20 minutes.
About the blurry problem this is my code where i set the ffmpeg arguments and set the process :
private void Convert()
{
try
{
Control.CheckForIllegalCrossThreadCalls = false;
if (ComboBox1.SelectedIndex == 3)
{
strFFCMD = " -i " + (char)34 + InputFile + (char)34 + " -c:v libx264 -s 1920x1080 -pix_fmt yuv420p -qp 18 -profile high444 -c:a libvo_aacenc -b:a 128k -ar 44100 -ac 2 -y " + OutputFile;
}
psiProcInfo.FileName = exepath;
psiProcInfo.Arguments = strFFCMD;
psiProcInfo.UseShellExecute = false;
psiProcInfo.WindowStyle = ProcessWindowStyle.Hidden;
psiProcInfo.RedirectStandardError = true;
psiProcInfo.RedirectStandardOutput = true;
psiProcInfo.CreateNoWindow = true;
prcFFMPEG.StartInfo = psiProcInfo;
prcFFMPEG.Start();
ffReader = prcFFMPEG.StandardError;
do
{
if (Bgw1.CancellationPending)
{
return;
}
Button5.Enabled = true;
Button3.Enabled = false;
strFFOUT = ffReader.ReadLine();
RichTextBox1.Text = strFFOUT;
if (strFFOUT != null)
{
if (strFFOUT.Contains("frame="))
{
currentFramestr = strFFOUT.Substring(7, 6).Trim();
Regex rx = new Regex(@"^\d+");
Match m = rx.Match(currentFramestr);
if (m.Success)
{
currentFrameInt = System.Convert.ToInt32(m.Value);
}
}
}
string percentage = ((double)ProgressBar1.Value / (double)ProgressBar1.Maximum * 100.0).ToString();
textBox3.Text = ProgressBar1.Value.ToString();
ProgressBar1.Maximum = FCount + 1;
ProgressBar1.Value = (currentFrameInt);
Label12.Text = "Current Encoded Frame: " + currentFrameInt;
Label11.Text = percentage;
} while (!(prcFFMPEG.HasExited || string.IsNullOrEmpty(strFFOUT)));
}
catch(Exception err)
{
string errors = err.ToString();
}
}psiProcInfo is ProcessStartInfo
prcFFMPEG is Process
And this is how it looks like when i play the target the new created converted video file the mp4 the first seconds :
Duration : 00:02:20
Width : 1920 Height : 1080
Data Rate and Total Rate both : 80kbps
Frame rate : 2 frames/second
This is the output of the ffmpeg console while converting the file.
ffmpeg version 2.8.git 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-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 11.100 / 55. 11.100
libavcodec 57. 17.100 / 57. 17.100
libavformat 57. 20.100 / 57. 20.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 21.100 / 6. 21.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
[avi @ 00000147a882b660] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, avi, from 'C:\temp\video\new.avi':
Duration: 00:02:20.50, start: 0.000000, bitrate: 132710 kb/s
Stream #0:0: Video: rawvideo, bgra, 1920x1080, 2 fps, 2 tbr, 2 tbn, 2 tbc
Please use -profile:a or -profile:v, -profile is ambiguous
Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (C:\temp\video\5.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
[libx264 @ 00000147a882c820] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 00000147a882c820] profile High, level 4.0
[libx264 @ 00000147a882c820] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=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_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=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=2 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=18 ip_ratio=1.40 pb_ratio=1.30 aq=0
Output #0, mp4, to 'C:\temp\video\5.mp4':
Metadata:
encoder : Lavf57.20.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080, q=-1--1, 2 fps, 16384 tbn, 2 tbc
Metadata:
encoder : Lavc57.17.100 libx264
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame= 8 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
frame= 15 fps= 14 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
frame= 21 fps= 13 q=18.0 size= 92kB time=00:00:00.00 bitrate=N/A speed= 0x
frame= 30 fps= 14 q=18.0 size= 141kB time=00:00:04.50 bitrate= 257.3kbits/s speed=2.03x
frame= 37 fps= 13 q=20.0 size= 164kB time=00:00:08.00 bitrate= 167.6kbits/s speed=2.82x
frame= 46 fps= 14 q=18.0 size= 185kB time=00:00:12.50 bitrate= 121.0kbits/s speed= 3.7x
frame= 51 fps= 13 q=19.0 size= 194kB time=00:00:15.00 bitrate= 106.1kbits/s speed=3.87x
frame= 58 fps= 13 q=18.0 size= 210kB time=00:00:18.50 bitrate= 93.2kbits/s speed=4.19x
frame= 65 fps= 13 q=20.0 size= 224kB time=00:00:22.00 bitrate= 83.6kbits/s speed=4.46x
frame= 71 fps= 13 q=19.0 size= 238kB time=00:00:25.00 bitrate= 78.1kbits/s speed=4.56x
frame= 78 fps= 13 q=18.0 size= 253kB time=00:00:28.50 bitrate= 72.6kbits/s speed=4.75x
frame= 83 fps= 13 q=19.0 size= 265kB time=00:00:31.00 bitrate= 70.0kbits/s speed= 4.7x
frame= 89 fps= 12 q=20.0 size= 280kB time=00:00:34.00 bitrate= 67.4kbits/s speed=4.73x
frame= 95 fps= 12 q=19.0 size= 291kB time=00:00:37.00 bitrate= 64.5kbits/s speed=4.73x
frame= 102 fps= 12 q=18.0 size= 308kB time=00:00:40.50 bitrate= 62.3kbits/s speed=4.84x
frame= 107 fps= 12 q=19.0 size= 317kB time=00:00:43.00 bitrate= 60.4kbits/s speed=4.82x
frame= 115 fps= 12 q=19.0 size= 336kB time=00:00:47.00 bitrate= 58.6kbits/s speed=4.96x
frame= 123 fps= 12 q=20.0 size= 354kB time=00:00:51.00 bitrate= 56.8kbits/s speed=5.09x
frame= 132 fps= 12 q=20.0 size= 371kB time=00:00:55.50 bitrate= 54.8kbits/s speed=5.25x
frame= 139 fps= 13 q=20.0 size= 392kB time=00:00:59.00 bitrate= 54.5kbits/s speed=5.32x
frame= 146 fps= 13 q=19.0 size= 408kB time=00:01:02.50 bitrate= 53.5kbits/s speed=5.37x
frame= 150 fps= 12 q=20.0 size= 417kB time=00:01:04.50 bitrate= 52.9kbits/s speed=5.28x
frame= 155 fps= 12 q=18.0 size= 428kB time=00:01:07.00 bitrate= 52.4kbits/s speed=5.25x
frame= 161 fps= 12 q=20.0 size= 441kB time=00:01:10.00 bitrate= 51.6kbits/s speed=5.26x
frame= 167 fps= 12 q=19.0 size= 462kB time=00:01:13.00 bitrate= 51.9kbits/s speed=5.29x
frame= 174 fps= 12 q=20.0 size= 483kB time=00:01:16.50 bitrate= 51.7kbits/s speed=5.33x
frame= 181 fps= 12 q=18.0 size= 614kB time=00:01:20.00 bitrate= 62.8kbits/s speed=5.36x
frame= 187 fps= 12 q=20.0 size= 763kB time=00:01:23.00 bitrate= 75.3kbits/s speed=5.35x
frame= 193 fps= 12 q=19.0 size= 852kB time=00:01:26.00 bitrate= 81.2kbits/s speed=5.36x
frame= 199 fps= 12 q=18.0 size= 865kB time=00:01:29.00 bitrate= 79.6kbits/s speed=5.37x
frame= 206 fps= 12 q=20.0 size= 932kB time=00:01:32.50 bitrate= 82.6kbits/s speed=5.39x
frame= 211 fps= 12 q=20.0 size= 943kB time=00:01:35.00 bitrate= 81.3kbits/s speed=5.38x
frame= 217 fps= 12 q=18.0 size= 1007kB time=00:01:38.00 bitrate= 84.1kbits/s speed=5.38x
frame= 223 fps= 12 q=20.0 size= 1175kB time=00:01:41.00 bitrate= 95.3kbits/s speed=5.38x
frame= 230 fps= 12 q=20.0 size= 1195kB time=00:01:44.50 bitrate= 93.7kbits/s speed=5.42x
frame= 235 fps= 12 q=18.0 size= 1205kB time=00:01:47.00 bitrate= 92.3kbits/s speed= 5.4x
frame= 241 fps= 12 q=20.0 size= 1222kB time=00:01:50.00 bitrate= 91.0kbits/s speed= 5.4x
frame= 247 fps= 12 q=19.0 size= 1232kB time=00:01:53.00 bitrate= 89.3kbits/s speed=5.39x
frame= 255 fps= 12 q=19.0 size= 1252kB time=00:01:57.00 bitrate= 87.7kbits/s speed=5.45x
frame= 260 fps= 12 q=20.0 size= 1274kB time=00:01:59.50 bitrate= 87.3kbits/s speed=5.44x
frame= 267 fps= 12 q=20.0 size= 1287kB time=00:02:03.00 bitrate= 85.7kbits/s speed=5.45x
frame= 272 fps= 12 q=18.0 size= 1304kB time=00:02:05.50 bitrate= 85.1kbits/s speed=5.43x
frame= 278 fps= 12 q=20.0 size= 1314kB time=00:02:08.50 bitrate= 83.8kbits/s speed=5.41x
frame= 281 fps= 12 q=-1.0 Lsize= 1376kB time=00:02:19.50 bitrate= 80.8kbits/s speed=5.76x
video:1372kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.299861%
[libx264 @ 00000147a882c820] frame I:2 Avg QP:15.00 size: 98930
[libx264 @ 00000147a882c820] frame P:80 Avg QP:18.00 size: 7068 -
Why calling libav* library doesn't have same quality as ffmpeg command line ?
10 mai 2016, par seaguestI am using the ffmpeg 3 to do the video format conversion, it works fine when I use the command line mode, but when I call the libav* library, I get a audio quality loss problem (there is a lot of noises in the audio).
Here are the two files :
mv.webm - original file
mv2.mp4 converted with libarary , a lot of noisesHere is the probe information for the mv.webm :
$ ffprobe mv.webm
ffprobe version N-79826-g64fd62d Copyright (c) 2007-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413
configuration: --prefix=/home/seaguest/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/seaguest/ffmpeg_build/include --extra-ldflags=-L/home/seaguest/ffmpeg_build/lib --enable-gpl --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 39.100 / 57. 39.100
libavformat 57. 36.100 / 57. 36.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 45.100 / 6. 45.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, matroska,webm, from 'mv.webm':
Metadata:
encoder : Lavf57.36.100
Duration: 00:00:30.00, start: 0.000000, bitrate: 935 kb/s
Stream #0:0: Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 25 fps, 25 tbr, 1k tbn (default)
Stream #0:1: Audio: vorbis, 44100 Hz, stereo, fltp (default)I checked the log printed by command line mode and calling code mode, the setting looks like the same, here are the logs :
$ ffmpeg -i mv.webm -c:a aac -c:v libx264 mv.mp4
ffmpeg version N-79826-g64fd62d Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413
configuration: --prefix=/home/seaguest/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/seaguest/ffmpeg_build/include --extra-ldflags=-L/home/seaguest/ffmpeg_build/lib --enable-gpl --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 39.100 / 57. 39.100
libavformat 57. 36.100 / 57. 36.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 45.100 / 6. 45.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, matroska,webm, from 'mv.webm':
Metadata:
encoder : Lavf57.36.100
Duration: 00:00:30.00, start: 0.000000, bitrate: 935 kb/s
Stream #0:0: Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 25 fps, 25 tbr, 1k tbn (default)
Stream #0:1: Audio: vorbis, 44100 Hz, stereo, fltp (default)
[libx264 @ 0x3e5d880] using SAR=1/1
[libx264 @ 0x3e5d880] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x3e5d880] profile High, level 3.0
[libx264 @ 0x3e5d880] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=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_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=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
[mp4 @ 0x3e2f680] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Last message repeated 1 times
Output #0, mp4, to 'mv.mp4':
Metadata:
encoder : Lavf57.36.100
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 25 fps, 12800 tbn (default)
Metadata:
encoder : Lavc57.39.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
encoder : Lavc57.39.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (vp8 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (vorbis (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 750 fps=229 q=-1.0 Lsize= 2508kB time=00:00:30.02 bitrate= 684.5kbits/s speed=9.17x
video:2023kB audio:459kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.052857%
[libx264 @ 0x3e5d880] frame I:11 Avg QP:15.29 size: 20395
[libx264 @ 0x3e5d880] frame P:345 Avg QP:20.93 size: 4350
[libx264 @ 0x3e5d880] frame B:394 Avg QP:23.55 size: 879
[libx264 @ 0x3e5d880] consecutive B-frames: 25.2% 3.2% 33.2% 38.4%
[libx264 @ 0x3e5d880] mb I I16..4: 44.1% 32.5% 23.4%
[libx264 @ 0x3e5d880] mb P I16..4: 1.5% 3.6% 0.6% P16..4: 28.9% 11.2% 4.7% 0.0% 0.0% skip:49.5%
[libx264 @ 0x3e5d880] mb B I16..4: 0.0% 0.1% 0.0% B16..8: 27.4% 2.0% 0.4% direct: 0.8% skip:69.3% L0:40.0% L1:53.3% BI: 6.7%
[libx264 @ 0x3e5d880] 8x8 transform intra:52.6% inter:74.9%
[libx264 @ 0x3e5d880] coded y,uvDC,uvAC intra: 57.5% 68.6% 35.9% inter: 10.6% 11.9% 2.6%
[libx264 @ 0x3e5d880] i16 v,h,dc,p: 36% 42% 7% 15%
[libx264 @ 0x3e5d880] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 23% 15% 6% 7% 7% 10% 7% 10%
[libx264 @ 0x3e5d880] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 27% 14% 6% 8% 7% 7% 6% 6%
[libx264 @ 0x3e5d880] i8c dc,h,v,p: 46% 34% 11% 9%
[libx264 @ 0x3e5d880] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x3e5d880] ref P L0: 63.9% 20.8% 11.2% 4.1%
[libx264 @ 0x3e5d880] ref B L0: 93.1% 6.1% 0.8%
[libx264 @ 0x3e5d880] ref B L1: 95.8% 4.2%
[libx264 @ 0x3e5d880] kb/s:552.32
[aac @ 0x3e5ec00] Qavg: 3030.804
$ ffprobe mv.mp4
ffprobe version N-79826-g64fd62d Copyright (c) 2007-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413
configuration: --prefix=/home/seaguest/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/seaguest/ffmpeg_build/include --extra-ldflags=-L/home/seaguest/ffmpeg_build/lib --enable-gpl --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 39.100 / 57. 39.100
libavformat 57. 36.100 / 57. 36.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 45.100 / 6. 45.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'mv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.36.100
Duration: 00:00:30.01, start: 0.000000, bitrate: 684 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 552 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandlerFor the calling code mode :
$ go run transcode.go mv.webm mv1.mp4
# github.com/3d0c/gmf
../packet.go: In function ‘_cgo_3c42eeb63b1e_Cfunc_avcodec_decode_audio4’:
../packet.go:87:2: warning: ‘avcodec_decode_audio4’ is deprecated [-Wdeprecated-declarations]
func (this *Packet) decode(cc *CodecCtx, frame *Frame) (*Frame, bool, int, error) {
^
In file included from ../packet.go:7:0:
/home/seaguest/ffmpeg_build/include/libavcodec/avcodec.h:4685:5: note: declared here
int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
^
../packet.go: In function ‘_cgo_3c42eeb63b1e_Cfunc_avcodec_decode_video2’:
../packet.go:104:2: warning: ‘avcodec_decode_video2’ is deprecated [-Wdeprecated-declarations]
}
^
In file included from ../packet.go:7:0:
/home/seaguest/ffmpeg_build/include/libavcodec/avcodec.h:4734:5: note: declared here
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
^
[libx264 @ 0x2d82400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x2d82400] profile High, level 3.0
[libx264 @ 0x2d82400] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=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_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=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
[mp4 @ 0x2d480c0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
[mp4 @ 0x2d480c0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[mp4 @ 0x2d480c0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
[mp4 @ 0x2d480c0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
$ ffprobe mv1.mp4
ffprobe version N-79826-g64fd62d Copyright (c) 2007-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413
configuration: --prefix=/home/seaguest/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/seaguest/ffmpeg_build/include --extra-ldflags=-L/home/seaguest/ffmpeg_build/lib --enable-gpl --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 39.100 / 57. 39.100
libavformat 57. 36.100 / 57. 36.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 45.100 / 6. 45.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'mv1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.36.100
Duration: 00:00:30.00, start: 0.000000, bitrate: 751 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480, 613 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 130 kb/s (default)
Metadata:
handler_name : SoundHandlerChecking the setting section, crf=23.0 for both (the rest are exactly the same), but the output bitrate are different (the audio for calling code mode has a lot of noises), how is that possible ?
Why the command line mode and use libav* library mode with same setting, but have different output ?
What should I do to call libav* library to get lossless video conversion ?