
Recherche avancée
Autres articles (73)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (13326)
-
Unexpected result from Python re.search for command line output
23 mai 2020, par Fernando OrtegaI'm using
subprocess.Popen
to run an ffmpeg command (in Windows) and then extract the part of the output that has the frame count with a regex expression usingre.search
. Sometimes, not always, I get the wrong result from search even if the printed command output string clearly shows what I expect.


When I use
re.findall
I get 2 results, the "wrong" one and the expected one, but in the output string of the command I still only see one option. I'd like to understand why this is happening.


Here's the code I'm running :



import re
import subprocess

# path to video with 300 frames
cmd = r'ffmpeg -i C:\...\300frames_HUD.avi -map 0:v:0 -c copy -f null -'
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output_info = p.communicate()[0]

regex = r'(frame=\s*)([0-9]+)'
search_result = re.search(regex, output_info)
findall_result = re.findall(regex, output_info)
print "SEARCH"
print '0', search_result.group(0)
print '1', search_result.group(1)
print '2', search_result.group(2)

print "FIND ALL"
print findall_result




Here are the results I get :



SEARCH
0 frame= 293
1 frame= 
2 293
FIND ALL
[('frame= ', '293'), ('frame= ', '300')]




And here is the printed
output_info
, the ffmpeg command output I'm searching on :


ffmpeg version git-2020-03-15-c467328 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9.2.1 (GCC) 20200122
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
 libavutil 56. 42.100 / 56. 42.100
 libavcodec 58. 75.100 / 58. 75.100
 libavformat 58. 41.100 / 58. 41.100
 libavdevice 58. 9.103 / 58. 9.103
 libavfilter 7. 77.100 / 7. 77.100
 libswscale 5. 6.101 / 5. 6.101
 libswresample 3. 6.100 / 3. 6.100
 libpostproc 55. 6.100 / 55. 6.100
Input #0, avi, from 'C:\...\300frames_HUD.avi':
 Duration: 00:00:10.00, start: 0.000000, bitrate: 373255 kb/s
 Stream #0:0: Video: rawvideo, bgr24, 960x540, 374496 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
 Metadata:
 title : V
Output #0, null, to 'pipe:':
 Metadata:
 encoder : Lavf58.41.100
 Stream #0:0: Video: rawvideo, bgr24, 960x540, q=2-31, 374496 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
 Metadata:
 title : V
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 300 fps=0.0 q=-1.0 Lsize=N/A time=00:00:10.00 bitrate=N/A speed=19.4x 
video:455625kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown




I'm essentially looking for the 300 number in
frame= 300
.
I can reproduce this easily when I execute it inside my IDE (pycharm) twice in a row quickly.

-
ffmpeg, lower fps with gpu - too many packets buffered
29 mai 2020, par AlterI'm trying to lower the fps for a large set of videos. Unfortunately, I don't have much experience with ffmpeg



This is my current command, which is a hybrid of multiple posts. At this point it's more guess work than anything else



ffmpeg \
 -y -hwaccel_output_format cuda -hwaccel_device 0 -hwaccel cuvid -c:v mpeg2_cuvid \
 -i myinput.mp4 -r 25 -c:v hevc_nvenc-b:v 128K -strict -2 -movflags faststart \ 
 /workspace/videos/24fps_trial2/rat1-control2.mp4 -c:v hevc_nvenc




The gist of it is just that I'm trying to lower fps and use hardware acceleration since my dataset is large



The message I get is



Trailing option(s) found in the command: may be ignored.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x453a100] decoding for stream 0 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x453a100] Could not find codec parameters for stream 0 (Video: mpeg2video (hvc1 / 0x31637668), none(tv), 2704x1520, 59946 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/workspace/gs/Rat Controls Jan 2020 /Rat 1 Control 2 .MP4':
 Metadata:
 major_brand : mp41
 minor_version : 538120216
 compatible_brands: mp41
 creation_time : 2020-01-07T09:45:34.000000Z
 firmware : HD7.01.01.70.00
 Duration: 00:01:49.63, start: 0.000000, bitrate: 60202 kb/s
 Stream #0:0(eng): Video: mpeg2video (hvc1 / 0x31637668), none(tv), 2704x1520, 59946 kb/s, 119.88 fps, 119.88 tbr, 120k tbn, 120k tbc (default)
 Metadata:
 creation_time : 2020-01-07T09:45:34.000000Z
 handler_name : GoPro H.265
 encoder : GoPro H.265 encoder
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
 Metadata:
 creation_time : 2020-01-07T09:45:34.000000Z
 handler_name : GoPro AAC
 Stream #0:2(eng): Data: bin_data (gpmd / 0x646D7067), 29 kb/s (default)
 Metadata:
 creation_time : 2020-01-07T09:45:34.000000Z
 handler_name : GoPro MET
 Stream #0:3(eng): Data: none (fdsc / 0x63736466), 21 kb/s (default)
 Metadata:
 creation_time : 2020-01-07T09:45:34.000000Z
 handler_name : GoPro SOS
Stream mapping:
 Stream #0:0 -> #0:0 (mpeg2video (mpeg2_cuvid) -> hevc (hevc_nvenc))
 Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Too many packets buffered for output stream 0:1.
[aac @ 0x45bf880] Qavg: 746.362
[aac @ 0x45bf880] 2 frames left in the queue on closing
Conversion failed!




-
how to play video with an Image onit in ffmpeg [closed]
22 mai 2020, par Naveen Kumarhttps://i.stack.imgur.com/Yqt2i.jpg



Need to play a video with an image over it in ffmpeg



i have tried



ffmpeg -i s.mp4 -i l.png -filter_complex 'overlay=10:main_h-overlay_h-10' avi - | ffplay -




but giving "Error initializing complex filters" even though i am using exact sysntax in ffmpeg documentation





ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 9.2.1 (GCC) 20200122
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
 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
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
ffplay version 4.2.2 Copyright (c) 2003-2019 the FFmpeg developers
 built with gcc 9.2.1 (GCC) 20200122
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
 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
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 's.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2020-01-19T02:20:09.000000Z
 Duration: 00:00:05.29, start: 0.000000, bitrate: 1252 kb/s
 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1120 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
 Metadata:
 creation_time : 2020-01-19T02:20:09.000000Z
 handler_name : ISO Media file produced by Google Inc. Created on: 01/18/2020.
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 2020-01-19T02:20:09.000000Z
 handler_name : ISO Media file produced by Google Inc. Created on: 01/18/2020. nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
Input #1, png_pipe, from 'l.png': 0KB vq= 0KB sq= 0B f=0/0
 Duration: N/A, bitrate: N/A
 Stream #1:0: Video: png, rgba(pc), 2000x2000 [SAR 3779:3779 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
[AVFilterGraph @ 000001584ea4c180] No such filter: 'overlay=10:main_h-overlay_h-10'
Error initializing complex filters.
Invalid argument
pipe:: Invalid data found when processing input