Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (100)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (6966)

  • ffmpeg errors in the daemon

    3 octobre 2020, par smoto_shei

    I 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 JavNoor

    Running 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 DGoiko

    I’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_name

    When 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.