
Recherche avancée
Autres articles (20)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Qualité du média après traitement
21 juin 2013, parLe bon réglage du logiciel qui traite les média est important pour un équilibre entre les partis ( bande passante de l’hébergeur, qualité du média pour le rédacteur et le visiteur, accessibilité pour le visiteur ). Comment régler la qualité de son média ?
Plus la qualité du média est importante, plus la bande passante sera utilisée. Le visiteur avec une connexion internet à petit débit devra attendre plus longtemps. Inversement plus, la qualité du média est pauvre et donc le média devient dégradé voire (...)
Sur d’autres sites (4219)
-
ffmpeg Progress Bar in php - fps=0.1 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x for every frame
5 mai 2020, par Mahmood HussainI want the progress of FFmpeg command like how much time is remaining or how much percentage is finished.



this ffmpeg Progress Bar - Encoding Percentage in PHP do the job for dealing with audio and video but failed in my case i.e creating video from images.



similar question Can ffmpeg show a progress bar ? in my case the command is follows



exec("$FFmpegPath -protocol_whitelist file,http,https,tcp,tls,crypto -f concat -safe 0 -i '$image_txt_file' -vsync vfr -pix_fmt yuv420p -vf 'pad=ceil(iw/2)*2:ceil(ih/2)*2' '$out_vid_name' 1>'output.txt' 2>&1", $output, $return_var);




and in my output file this is what I have



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, concat, from '../LiveLapseData/image_file_5eb13b6cb0bb6.txt':
 Duration: 00:00:02.50, start: 0.000000, bitrate: 33 kb/s
 Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 2697x1800 [SAR 1:1 DAR 899:600], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
 Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 0x10c679000] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x7f9def030200] using SAR=1/1
[libx264 @ 0x7f9def030200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7f9def030200] profile High, level 5.0
[libx264 @ 0x7f9def030200] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - 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
Output #0, mp4, to '../LiveLapseData/init_video_5eb13b6cb0bc2.mp4':
 Metadata:
 encoder : Lavf58.29.100
 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 2698x1800 [SAR 1:1 DAR 1349:900], q=-1--1, 25 fps, 12800 tbn, 25 tbc
 Metadata:
 encoder : Lavc58.54.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 3 fps=0.2 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 4 fps=0.1 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 5 fps=0.1 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 6 fps=0.1 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 7 fps=0.1 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 8 fps=0.1 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 9 fps=0.1 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 10 fps=0.1 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 11 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 12 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 13 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 14 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 





<?php
// The file has JSON type.
header('Content-Type: application/json');

$content = @file_get_contents('output.txt');

if ($content) {
 //get duration of source
 preg_match("/Duration: (.*?), start:/", $content, $matches);

 $rawDuration = $matches[1];
 //rawDuration is in 00:00:00.00 format. This converts it to seconds.
 $ar = array_reverse(explode(":", $rawDuration));
 $duration = floatval($ar[0]);
 if (!empty($ar[1])) $duration += intval($ar[1]) * 60;
 if (!empty($ar[2])) $duration += intval($ar[2]) * 60 * 60;

 //get the time in the file that is already encoded
 preg_match_all("/time=(.*?) bitrate/", $content, $matches);

 $rawTime = array_pop($matches);

 //this is needed if there is more than one match
 if (is_array($rawTime)) {
 $rawTime = array_pop($rawTime);
 }

 //rawTime is in 00:00:00.00 format. This converts it to seconds.
 $ar = array_reverse(explode(":", $rawTime));
 $time = floatval($ar[0]);
 if (!empty($ar[1])) $time += intval($ar[1]) * 60;
 if (!empty($ar[2])) $time += intval($ar[2]) * 60 * 60;

 //calculate the progress
 $progress = round(($time / $duration) * 100);

 echo "Duration: " . $duration . "<br />";
 echo "Current Time: " . $time . "<br />";
 echo "Progress: " . $progress . "%";






and always I receive is progress 0 and last progress 88


-
Problems video playing in some android devices (version 4+) but not in others
5 juin 2014, par anquegifollowing the settings for video in android developers, http://developer.android.com/guide/appendix/media-formats.html I encoded a video using ffmpeg like this :
ffmpeg -i gravityTrailer.mp4 -y -f mp4 -vcodec libx264 -profile:v baseline -acodec aac -strict -2 -profile:a aac_low -b:v 500k -ar 44100 -b:a 128k -ac 2 -r 30 -s 480x360 output_hq.mp4
which corresponds on sd highquality in table 2 from android developers (link above).
Then i put this video in a server and use the class android.media.MediaPlayer to reproduce it from that URL like this
https://cloudapp.somedomain.com/bmftvideos/output_hq.mp4
The problem is that the video is played on android version 4+
you can see the video on :
LG G2,
Sony xperia Syou cannot see the video on :
Samsung galaxy S4,
BQ (spanish) aquaris 4.5And I don not know why
this is the ffmpeg output :
ffmpeg version 1.2.6 Copyright (c) 2000-2014 the FFmpeg developers
built on Mar 5 2014 08:21:01 with gcc 4.8.2 (GCC) 20131212 (Red Hat 4.8.2-7)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14e5ba0] stream 0, timescale not set
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14e5ba0] max_analyze_duration 5000000 reached at 5013333 microseconds
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'gravityTrailer.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2013-12-01 03:59:56
genre : Trailer
artist : Warner Bros.
title : Gravity - 2K Trailer
encoder : HandBrake 0.9.9 2013051800
date : 2013
Duration: 00:02:27.07, start: 0.000000, bitrate: 20296 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2048x858, 20149 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Metadata:
creation_time : 2013-12-01 03:59:56
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 153 kb/s
Metadata:
creation_time : 2013-12-01 03:59:56
Stream #0:2: Video: mjpeg, yuvj420p, 102x150 [SAR 72:72 DAR 17:25], 90k tbr, 90k tbn, 90k tbc
[libx264 @ 0x1667680] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x1667680] profile Constrained Baseline, level 3.0
[libx264 @ 0x1667680] 264 - core 130 r2282 1db4621 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 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=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output_hq.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
date : 2013
genre : Trailer
artist : Warner Bros.
title : Gravity - 2K Trailer
encoder : Lavf54.63.104
Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 480x360, q=-1--1, 500 kb/s, 15360 tbn, 30 tbc
Metadata:
creation_time : 2013-12-01 03:59:56
Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
creation_time : 2013-12-01 03:59:56
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> libx264)
Stream #0:1 -> #0:1 (aac -> aac)
Press [q] to stop, [?] for help
frame= 4410 fps= 65 q=-1.0 Lsize= 11154kB time=00:02:27.07 bitrate= 621.3kbits/s dup=885 drop=0
video:9062kB audio:1969kB subtitle:0 global headers:0kB muxing overhead 1.115392%
[libx264 @ 0x1667680] frame I:186 Avg QP:28.41 size: 4446
[libx264 @ 0x1667680] frame P:4224 Avg QP:29.20 size: 2001
[libx264 @ 0x1667680] mb I I16..4: 75.5% 0.0% 24.5%
[libx264 @ 0x1667680] mb P I16..4: 7.5% 0.0% 3.6% P16..4: 23.1% 6.2% 1.8% 0.0% 0.0% skip:57.7%
[libx264 @ 0x1667680] final ratefactor: 27.96
[libx264 @ 0x1667680] coded y,uvDC,uvAC intra: 24.0% 31.9% 8.6% inter: 7.4% 7.6% 0.6%
[libx264 @ 0x1667680] i16 v,h,dc,p: 58% 15% 13% 14%
[libx264 @ 0x1667680] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 9% 27% 7% 6% 8% 5% 7% 3%
[libx264 @ 0x1667680] i8c dc,h,v,p: 80% 7% 12% 2%
[libx264 @ 0x1667680] ref P L0: 84.7% 9.4% 5.9%
[libx264 @ 0x1667680] kb/s:504.98 -
ffmpeg : Input link parameters do not match the corresponding output link parameters, when concatenating same size videos
4 mars 2021, par mSourireI'm trying to combine a video and an audio, using the following command :


ffmpeg -y -i 1.mkv -i 1.mka 
-max_muxing_queue_size 10000 -preset veryfast -r 30 -crf 20 -b:a 96000 -vbr on
-strict experimental
-filter_complex '
color=black:s=320x240:d=7ms[black0];
aevalsrc=0:d=15ms[silence1];
[black0][0]concat=n=2:v=1:a=0[video];
[1][silence1]concat=n=2:v=0:a=1[audio]'
-map [video] -map [audio] -c:v libvpx -c:a libopus output.webm



But ffmpeg returns an error :


[Parsed_concat_2 @ 0x7f8004506d00] Input link in0:v0 parameters (size 640x480, SAR 1:1) do not match the corresponding output link in0:v0 parameters (320x240, SAR 1:1)
[Parsed_concat_2 @ 0x7f8004506d00] Failed to configure output pad on Parsed_concat_2
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
[libopus @ 0x7f800500c000] 1 frames left in the queue on closing
Conversion failed!



It looks like ffmpeg is unable to concatenate video and black frames, complaining, that video has a distinct resolution, but that's not true :


#> ffprobe 1.mkv
Input #0, matroska,webm, from '1.mkv':
 Metadata:
 encoder : GStreamer matroskamux version 1.8.1.1
 creation_time : 2021-03-02T13:44:03.000000Z
 Duration: 00:01:48.41, start: 0.710000, bitrate: 757 kb/s
 Stream #0:0(eng): Video: vp8, yuv420p(progressive), 320x240, SAR 1:1 DAR 4:3, 120 tbr, 1k tbn, 1k tbc (default)
 Metadata:
 title : Video



So, both the input source and the filter has the same resolution.


When I'm trying to change the color filter to "color=s=640x480", ffmpeg says an opposite thing :


[Parsed_concat_2 @ 0x7fca3ca185c0] Input link in0:v0 parameters (size 320x240, SAR 1:1) do not match the corresponding output link in0:v0 parameters (640x480, SAR 1:1)
[Parsed_concat_2 @ 0x7fca3ca185c0] Failed to configure output pad on Parsed_concat_2
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument



Help please to solve this !


Full listing :


ffmpeg -y -i 1.mkv -i 1.mka
-max_muxing_queue_size 10000
-preset veryfast -r 30 -crf 20 -b:a 96000 -vbr on
-strict experimental
-filter_complex '
color=black:s=320x240:d=7ms[black0];
aevalsrc=0:d=15ms[silence1];
[black0][0]concat=n=2:v=1:a=0[video];
[1][silence1]concat=n=2:v=0:a=1[audio]'
-map [video] -map [audio] -c:v libvpx -c:a libopus output.webm

ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with Apple clang version 11.0.0 (clang-1100.0.33.17)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_9 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --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 --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack
 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
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, matroska,webm, from '1.mkv':
 Metadata:
 encoder : GStreamer matroskamux version 1.8.1.1
 creation_time : 2021-03-02T13:44:03.000000Z
 Duration: 00:01:48.41, start: 0.710000, bitrate: 757 kb/s
 Stream #0:0(eng): Video: vp8, yuv420p(progressive), 320x240, SAR 1:1 DAR 4:3, 120 tbr, 1k tbn, 1k tbc (default)
 Metadata:
 title : Video
Input #1, matroska,webm, from '1.mka':
 Metadata:
 encoder : GStreamer matroskamux version 1.8.1.1
 creation_time : 2021-03-02T13:44:03.000000Z
 Duration: 00:01:48.40, start: 0.703000, bitrate: 38 kb/s
 Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
 Metadata:
 title : Audio
Codec AVOption preset (Configuration preset) specified for output file #0 (output.webm) 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.
Stream mapping:
 Stream #0:0 (vp8) -> concat:in1:v0
 Stream #1:0 (opus) -> concat:in0:a0
 concat -> Stream #0:0 (libvpx)
 concat -> Stream #0:1 (libopus)
Press [q] to stop, [?] for help
[libvpx @ 0x7fe08a80bc00] v1.9.0
[libvpx @ 0x7fe08a80bc00] Bitrate not specified for constrained quality mode, using default of 256kbit/sec
Output #0, webm, to 'output.webm':
 Metadata:
 encoder : Lavf58.45.100
 Stream #0:0: Video: vp8 (libvpx), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=-1--1, 256 kb/s, 30 fps, 1k tbn, 30 tbc (default)
 Metadata:
 encoder : Lavc58.91.100 libvpx
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
 Stream #0:1: Audio: opus (libopus), 48000 Hz, stereo, flt, 96 kb/s (default)
 Metadata:
 encoder : Lavc58.91.100 libopus
[Parsed_color_0 @ 0x7fe089815940] EOF timestamp not reliable
[Parsed_concat_2 @ 0x7fe088501980] Input link in0:v0 parameters (size 640x480, SAR 1:1) do not match the corresponding output link in0:v0 parameters (320x240, SAR 1:1)
[Parsed_concat_2 @ 0x7fe088501980] Failed to configure output pad on Parsed_concat_2
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
[libopus @ 0x7fe08a810c00] 1 frames left in the queue on closing
Conversion failed!