
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (100)
-
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 (...) -
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 (...)
-
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 (...)
Sur d’autres sites (8982)
-
ffmpeg errors in the daemon
3 octobre 2020, par smoto_sheiI created a shell script to compress a video using ffmpeg(4.3.1).


ffmpeg -y -i \
 '/var/www/System/Backend/Outputs/TempSaveMovie/200703_4_short_5fr_p2(100_20)_r(50_20).mp4' \
 -vcodec h264 -an \
 '/var/www/System/Backend/Outputs/MovieOutputs/200703_4_short_5fr_p2(100_20)_r(50_20).mp4'




If you run this code from the console, it will run without problems.
In fact, we're using the python
subscript.call()
to execute it. It works fine too.

cmd = 'sh /var/www/System/Backend/cv2toffmpeg.sh'
subprocess.call(cmd, shell=True)



Secondly, if I run it from a daemonized python program, I'll get an error. I get the following error.
You'll get an error like this


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './Outputs/TempSaveMovie/200703_4_short_5fr_p2(100_20)_r(50_20).mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2mp41
 encoder : Lavf58.35.100
 Duration: 00:00:06.15, start: 0.000000, bitrate: 10246 kb/s
 Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 10244 kb/s, 13 fps, 13 tbr, 13312 tbn, 13 tbc (default)
 Metadata:
 handler_name : VideoHandler
Stream mapping:
 Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
[mpeg4 @ 0x55cec17c5480] header damaged
[mpeg4 @ 0x55cec17c6840] header damaged
[mpeg4 @ 0x55cec1855f80] header damaged
[mpeg4 @ 0x55cec1866e00] header damaged
Output #0, mp4, to './Outputs/MovieOutputs/200703_4_short_5fr_p2(100_20)_r(50_20).mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2mp41
 encoder : Lavf58.45.100
 Stream #0:0(und): Video: h264 (h264_nvenc) (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 13 fps, 13312 tbn, 13 tbc (default)
 Metadata:
 handler_name : VideoHandler
 encoder : Lavc58.91.100 h264_nvenc
 Side data:
 cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: N/A
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg4 @ 0x55cec17c8780] header damaged
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg4 @ 0x55cec17c5480] header damaged



I think the problem is when you run it from a daemonized process. There seems to be a similar problem in the past.
Ffmpeg does not properly convert videos when run as daemon
I would like to ask for your help to solve this problem. Thank you for your help from Japan.


-
Fatal Python error : could not acquire lock for at interpreter shutdown, possibly due to daemon threads
3 octobre 2019, par JavNoorRunning the following :
import imageio
class vidrdf:
def __init__(self, vidfile):
self.vid = imageio.get_reader(vidfile, 'ffmpeg')
vidfile = 'movie.mov'
rdfobj = vidrdf(vidfile)I get :
Fatal Python error: could not acquire lock for <_io.BufferedReader name=8> at interpreter shutdown, possibly due to daemon threads
Thread 0x00007fd2dc2a8700 (most recent call first):
File “/path/miniconda3/envs/flower/lib/python3.7/site-packages/imageio_ffmpeg/_parsing.py", line 61 in run
File "miniconda3/envs/flower/lib/python3.7/threading.py", line 926 in _bootstrap_inner
File “/path/miniconda3/envs/flower/lib/python3.7/threading.py", line 890 in _bootstrap
Current thread 0x00007fd2f0bb9700 (most recent call first):
File “/path/miniconda3/envs/flower/lib/python3.7/subprocess.py", line 1704 in _communicate
File “/path/miniconda3/envs/flower/lib/python3.7/subprocess.py", line 939 in communicate
File “/path/miniconda3/envs/flower/lib/python3.7/site-packages/imageio_ffmpeg/_io.py", line 193 in read_frames
File “/path/miniconda3/envs/flower/lib/python3.7/site-packages/imageio/plugins/ffmpeg.py", line 342 in _close
File “/path/miniconda3/envs/flower/lib/python3.7/site-packages/imageio/core/format.py", line 252 in close
File “/path/miniconda3/envs/flower/lib/python3.7/site-packages/imageio/core/format.py", line 241 in __del__
Aborted (core dumped)It doesn’t happen if I try :
import imageio
class vidrdf:
def __init__(self, vidfile):
self.vid = imageio.get_reader(vidfile, 'ffmpeg')
vidfile = 'movie.mov'
vidrdf(vidfile)or
import imageio
class vidrdf:
def __init__(self, vidfile):
vid = imageio.get_reader(vidfile, 'ffmpeg')
vidfile = 'movie.mov'
rdfobj = vidrdf(vidfile)So this is clearly an issue with copying the object. I’ve searched about daemon threads, but since I’m using imageio directly I can’t figure out why and how to resolve it. I would appreciate any recommendations.
-
Ffmpeg does not properly convert videos when run as daemon
20 janvier 2019, par DGoikoI’m using ffmpeg to convert and split videos from a Python process. When I run it from console as a normal user everything works as expected, however, if I run it as a daemon it produces the same amount of files but with silence in almost the whole file.
This is the line I execute from python :
def convert_to_ffmpeg(file, ffmpeg_folder, chunk_length):
res = -1
try:
file_name = os.path.join(ffmpeg_folder, ntpath.basename(file) + ".flac")
res = os.system("ffmpeg -i " + file + " -f segment -segment_time "+str(chunk_length)+" " + file_name + " -y >/dev/null 2>&1")
except Exception as e:
raise MyException(code=210005, detalails=file, cause=e)
if not res == 0:
raise MyException(code=210004, detalails=str(res) + " - " + file)
return file_nameWhen I run it from a normal console it works as expected : it splits the video in chunks of "self._chunk_length" seconds.
However, if I run the program using python-daemon with this code :
if daemon_run:
pid_file = check_unclean_exit(config['pidfile'], log)
context = daemon.DaemonContext(
working_directory=approot,
umask=0o002,
pidfile=pid_file,
)
context.signal_map = {
signal.SIGTERM: programa_cleanup,
signal.SIGHUP: 'terminate',
# signal.SIGUSR1: reload_program_config,
}
with context:
convert_to_ffmpeg("/foo/testfile.mkv", "/foo/ffmpeg", 40)It produces EXACTLY the same chunks, however, most of the content of the chunks is just silence. It splits in the proper point, but doesn’t fill the contents of the audio output properly. Of course, no exception is thrown, as ffmpeg always returns 0
I did even install a completly fresh Debian 9 into a virtual machine to discard problems with ffmpeg and my old-good computer’s setup.
Of course this is a simplified example. The real thing is a multithread application which watches a directory for files to convert.