
Recherche avancée
Autres articles (111)
-
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
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 (...)
Sur d’autres sites (11694)
-
python ffmpeg moov atom not found Invalid data when processing input
11 mai 2018, par IsocratesI have a progress that records the screen, and audio from a microphone, and then combines the video and audio recording (.mp4 and .wav) into one mkv file.
I am using python 3.6 and ffmpeg to achieve this aim. For short videos (<20 sec.) it works, but for longer recordings it presents the following error message :
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55abb3a52540] moov atom not found
tmp/tmp_0.mp4: Invalid data found when processing inputFull output :
ffmpeg version 3.3.7 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7 (GCC)
configuration: --prefix=/usr --bindir=/usr/bin --
datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --
incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --
arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,
-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-
buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-
hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables' --extra-
ldflags='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --
extra-cflags='-I/usr/include/nvenc ' --enable-libopencore-amrnb --
enable-
libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib
--disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --
enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-
libcdio --enable-indev=jack --enable-libfreetype --enable-libfribidi --
enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-
opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-
libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --
enable-libtheora --enable-libvorbis --enable-libv4l2 --enable- libvidstab -
-enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --
enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --
disable-static --enable-shared --enable-gpl --disable-debug --disable-
stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[wav @ 0x55abb3a0b880] Ignoring maximum wav data size, file may be invalid
[wav @ 0x55abb3a0b880] Estimating duration from bitrate, this may be
inaccurate
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'tmp/tmp_0.wav':
Metadata:
encoder : Lavf57.71.100
Duration: 00:00:21.97, bitrate: 768 kb/s
Stream #0:0: Audio: pcm_mulaw ([7][0][0][0] / 0x0007), 48000 Hz,
stereo, s16, 768 kb/s
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55abb3a52540] moov atom not found
tmp/tmp_0.mp4: Invalid data found when processing inputThe python file (ffmpeg.py) is as follows. The class, AV_COMPILE, is not yet complete, held up by the aforementioned error, and therefore still uses the initial test files as defaults. But otherwise it ought to work :
import os, time, glob
TMP_DIR = "tmp"
DISPLAY = os.environ['DISPLAY']
EXT = {
'Video':'mp4',
'Audio':'wav',
'AV':'mkv',
}
class ffmpegVideo:
FFMPEG_BIN = "ffmpeg"
AUDIO = False
def __init__(self, fps = 30, audio = True):
global TMP_DIR, DISPLAY, EXT
self.fps = fps
if audio:
self.AUDIO = True
self.video_filename = self.unique_filename()
self.command = [ self.FFMPEG_BIN,
'-video_size', '1920x1080',
'-framerate', str(fps),
'-f', 'x11grab',
'-i', DISPLAY,
'-vcodec', 'libx264',
'-qp', '0',
'-preset', 'ultrafast',
'-y', TMP_DIR + '/' + self.video_filename
]
def start(self):
import threading as th
thread = th.Thread(target=self.record)
thread.start()
def record(self):
import subprocess as sp
self.pipe = sp.Popen(self.command, stderr=sp.PIPE)
if self.AUDIO:
ffmpegAudio().start()
def stop(self):
self.pipe.terminate()
def unique_filename(self):
global TMP_DIR, EXT
i = 0
while os.path.exists((TMP_DIR + '/' + 'tmp_%s.%s') % (i, EXT['Video'])):
i += 1
return ('tmp_%s.%s') % (i, EXT['Video'])
class ffmpegAudio:
FFMPEG_BIN = "ffmpeg"
def __init__(self):
self.audio_filename = self.unique_filename()
self.command = [ self.FFMPEG_BIN,
'-f', 'pulse',
'-ac', '2',
'-ar', '48000',
'-i', 'default',
'-acodec', 'pcm_mulaw',
'-y', TMP_DIR + '/' + self.audio_filename
]
def start(self):
import threading as th
au_thread = th.Thread(target=self.record)
au_thread.start()
def record(self):
import subprocess as sp
self.pipe = sp.Popen(self.command, stderr=sp.PIPE)
def stop(self):
self.pipe.terminate()
def unique_filename(self):
global TMP_DIR, EXT
i = 0
while os.path.exists((TMP_DIR + '/' + 'tmp_%s.%s') % (i, EXT['Audio'])):
i += 1
return ('tmp_%s.%s') % (i, EXT['Audio'])
class AV_COMPILE:
def __init__(self, au_in = TMP_DIR + '/' + 'out1.wav', vd_in =
TMP_DIR + '/' + 'test4.mp4', out = TMP_DIR + '/' + 'av.mkv'):
import subprocess as sp
au_in = min(glob.iglob(TMP_DIR + '/*.wav'), key=os.path.getctime)
vd_in = min(glob.iglob(TMP_DIR + '/*.mp4'), key=os.path.getctime)
self.command = ('ffmpeg -i %s -r 30 -i %s -shortest -c:a aac -c:v copy %s') % (au_in, vd_in, out)
sp.call(self.command, shell=True)I would be grateful for any assistance you could provide in understanding why this happens and how to solve the error. Also, I am happy to receive any other tips on how to improve this code, or any other problems anyone might notice.
EDIT :
I now believe that the reason for this error in longer videos, and occasionally shorter, is that the program is proceeding to attempt to compile the av output whether or not it has finished compiling the original video file. I tested atime.sleep(10)
function to delay AV_COMPILE, and this seems to work.However, as video files get larger, obviously the delay needs to be adjusted. So I should like to know how I can separately check the integrity of the video file and determine that it is safe to proceed to the next step.
-
Concatenating two videos with different width and height
7 mai 2018, par TahtakafaIf i try to concatenate two videos it throws an error due to different screen sizes of the videos. I have put a setdat=16/9 parameter like described here for each two video. Then i got the error below. How can i concatenate two videos with different screen sizes ?
code :
ffmpeg -i /var/www/html/GetVideo/reklam/muzikli1.mp4 -i /var/www/html/GetVideo/tempvideo/sample.mp4 -filter_complex \ "[0]setdar=16/9[a];[1]setdar=16/9[b]; \ [a][b]concat=n=2:v=1:a=1" /var/www/html/GetVideo/reklam/out.mp4
error :
pi@raspberrypi:/var/www/html/GetVideo $ ffmpeg -i /var/www/html/GetVideo/reklam/muzikli1.mp4 -i /var/www/html/GetVideo/tempvideo/sample.mp4 -filter_complex \ "[0]setdar=16/9[a];[1]setdar=16/9[b]; \ [a][b]concat=n=2:v=1:a=1" /var/www/html/GetVideo/reklam/out.mp4
ffmpeg version git-2018-05-06-652b857 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
libavutil 56. 18.100 / 56. 18.100
libavcodec 58. 19.101 / 58. 19.101
libavformat 58. 13.101 / 58. 13.101
libavdevice 58. 4.100 / 58. 4.100
libavfilter 7. 21.100 / 7. 21.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/html/GetVideo/reklam/muzikli1.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp41isom
Duration: 00:00:13.35, start: 0.000000, bitrate: 244 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 918x512 [SAR 1:1 DAR 459:256], 110 kb/s, 5 fps, 5 tbr, 5k tbn, 10k tbc (default)
Metadata:
handler_name : VideoHandler
encoder : AVC Coding
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 129 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/html/GetVideo/tempvideo/sample.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.65.100
Duration: 00:00:25.57, start: 0.000000, bitrate: 1015 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 896 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 113 kb/s (default)
Metadata:
handler_name : SoundHandler
[AVFilterGraph @ 0x2fa9a20] No such filter: ' '
Error initializing complex filters.
Invalid argument -
FFMPEG : Impossible to convert between the formats supported by the filter
30 avril 2018, par NethemeTrying to decode & encode the video in FFMPEG on my GPU. Using this command :
ffmpeg -y -c:v mpeg2_cuvid -vsync 0 -deint 2 -drop_second_field 1 -surfaces 10 -i 'udp://@227.10.20.149:1234?fifo_size=100000000' -map i:0x12c -r 25 -filter fps=30,scale_npp=640:360:format=same:interp_algo=lanczos -aspect 16:9 -g 96 -vcodec h264_nvenc -b 400K -minrate 400k -maxrate 400k -f mpegts 'udp://@239.0.0.12:1000?overrun_nonfatal_option=1'
But FFMPEG still giving me this output :
Using -vsync 0 and -r can produce invalid output files
Stream mapping:
Stream #0:8 -> #0:0 (mpeg2video (mpeg2_cuvid) -> h264 (h264_nvenc))
Stream #0:8 -> #1:0 (mpeg2video (mpeg2_cuvid) -> h264 (h264_nvenc))
Stream #0:8 -> #2:0 (mpeg2video (mpeg2_cuvid) -> h264 (h264_nvenc))
Stream #0:8 -> #3:0 (mpeg2video (mpeg2_cuvid) -> h264 (h264_nvenc))
Stream #0:9 -> #4:0 (mp2 (native) -> aac (native))
Stream #0:10 -> #5:0 (mp2 (native) -> aac (native))
Press [q] to stop, [?] for help
[mpegts @ 0x55c260173b20] frame size not set
Output #5, mpegts, to 'udp://@239.0.0.12:1005?overrun_nonfatal_option=1':
Metadata:
encoder : Lavf57.83.100
Stream #5:0(eng): Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc57.107.100 aac
[mpegts @ 0x55c260172560] frame size not set
Output #4, mpegts, to 'udp://@239.0.0.12:1004?overrun_nonfatal_option=1':
Metadata:
encoder : Lavf57.83.100
Stream #4:0(por): Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc57.107.100 aac
Impossible to convert between the formats supported by the filter 'Parsed_fps_0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:8
[aac @ 0x55c260173020] Qavg: 347.777
[aac @ 0x55c260173020] 2 frames left in the queue on closing
[aac @ 0x55c260174ac0] Qavg: 339.059
[aac @ 0x55c260174ac0] 2 frames left in the queue on closing
Conversion failed!My version of FFMPEG :
ffmpeg version n3.4.2-9-ga877ab75eb Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --enable-libzvbi --enable-libnpp --enable-cuda --enable-cuvid --enable-nvenc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-gpl --enable-libx264 --disable-x86asm --enable-libx265 --enable-libfdk-aac --enable-nonfree
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'I tried to change the output codec to hevc_nvenc, nvenc_hevc (all available from Nvidia), but still getting this error. What I am doing wrong ?
Thanks for tips.