Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (55)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

Sur d’autres sites (6911)

  • Python - second subprocess won't open if I use sys.argv

    3 juin 2015, par Hyperion

    I’ve got a Python script which download a video using youtube-dl and then extract frames from it using ffmpeg. This is the code :

    def DownloadVideo():
       output_file = "/Users/francesco/Desktop/SOURCE/%(title)s-%(id)s.%(ext)s"
       check_call(["youtube-dl","--output", output_file, "--restrict-filenames", "-f", "best", sys.argv[1]])

    def ConvertVideo(video):
       DEST = "/Users/francesco/Desktop/OUTPUT"
       SOURCE = "/Users/francesco/Desktop/SOURCE"
       ffmpeg_path = "/Users/francesco/Desktop/ffmpeg/ffmpeg"
       video_path = SOURCE + "/" + video
       dest_path = DEST + "/" + os.path.splitext(video)[0] + "-%d.png"
       check_call([ffmpeg_path, "-v", "0", "-i", video_path, "-f", "image2", dest_path])

    def Main():
       DownloadVideo()
       for video in os.listdir("/Users/francesco/Desktop/SOURCE"):
          ConvertVideo(video)

    I run the command python myscript.py myvideolink and everything goes fine in the download process, but the ConvertVideo doesn’t start, it just get frozen for a couple of seconds and then the program exits.

    If I try to run the same command skipping the DownloadVideo() (with the video already downloaded in the folder) it doens’t work too, but if I use python myscript.py without the argv[1], the ffmpeg process works ! Why this happens ?

    Update : I’ve tried to remove the -v 0 option in ffmpeg to see what actually happens, ffmpeg process starts, but get frozen like this :

    ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
     built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
     configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect
     libavutil      54. 20.100 / 54. 20.100
     libavcodec     56. 26.100 / 56. 26.100
     libavformat    56. 25.101 / 56. 25.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 11.102 /  5. 11.102
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100

    Update 2 : This code seems not to work too, so I deduce is an ffmpeg problem with sys.args ?

    import subprocess
    import os
    import sys

    variable = sys.argv[1]


    def ConvertVideo(video):
       DEST = '/Users/francesco/Desktop/OUTPUT'
       SOURCE = '/Users/francesco/Desktop/SOURCE'
       ffmpeg_path = '/Users/francesco/Desktop/PYVIDID/ffmpeg/ffmpeg'
       video_path = SOURCE + '/' + video
       dest_path = DEST + '/' + os.path.splitext(video)[0] + '-%d.png'
       subprocess.check_call(['ffmpeg', '-i', video_path,'-r', '1', '-f', 'image2', dest_path])

    def Main():
       #DownloadVideo()
       for video in os.listdir('/Users/francesco/Desktop/SOURCE'):
           if not video.startswith("."):
               ConvertVideo(video)

    I’m not even using the argv[1] but it still got stuck.

  • Merge commit ’a6f19d6a9f8d1e08653d9d77581e8c823f4955c2’

    8 juin 2015, par Michael Niedermayer
    Merge commit ’a6f19d6a9f8d1e08653d9d77581e8c823f4955c2’
    

    * commit ’a6f19d6a9f8d1e08653d9d77581e8c823f4955c2’ :
    configure : Support MSVC 2015

    Conflicts :
    configure
    libavutil/internal.h

    Merged-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] configure
    • [DH] libavutil/internal.h
  • ffmpeg how to convert stereo to mono using audio pan filter [migrated]

    5 juin 2015, par John T

    From the documentation, it looks like this should work :

    ffmpeg -i input.mp4 -af "pan=1c|c0=.5*c0+.5*c1" output.mp4

    The output is a video with no sound. When I do ffprobe, it says theres a audio mono track, but its only 2kbps.

    However, when I do it this way though, it seems to work and produce a video with a mono track :

    ffmpeg -i input.mp4 -ac 1 output.mp4

    Does anyone know the reason why the first way isn’t working for me ?

    Thanks !

    Adding Console output

    ffmpeg output :

    ffmpeg -loglevel verbose -i video_tong_hua.mp4 -af "pan=1c|c0=.5*c0+.5*c1" output.mp4
    ffmpeg version 2.3.3 Copyright (c) 2000-2014 the FFmpeg developers
     built on Feb 25 2015 23:01:46 with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/2.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
     libavutil      52. 92.100 / 52. 92.100
     libavcodec     55. 69.100 / 55. 69.100
     libavformat    55. 48.100 / 55. 48.100
     libavdevice    55. 13.102 / 55. 13.102
     libavfilter     4. 11.100 /  4. 11.100
     libavresample   1.  3.  0 /  1.  3.  0
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 19.100 /  0. 19.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, matroska,webm, from 'video_tong_hua.mp4':
     Metadata:
       encoder         : google
     Duration: 00:06:18.38, start: 0.000000, bitrate: 283 kb/s
       Stream #0:0: Video: vp8, yuv420p, 322x240, SAR 1:1 DAR 161:120, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default)
       Stream #0:1: Audio: vorbis, 44100 Hz, stereo, fltp (default)
    [graph 0 input from stream 0:0 @ 0x7fc8235003a0] w:322 h:240 pixfmt:yuv420p tb:1/1000 fr:2997/100 sar:1/1 sws_param:flags=2
    [graph 1 input from stream 0:1 @ 0x7fc82340d320] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:0x3
    [audio format for output stream 0:1 @ 0x7fc82340d880] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_pan_0' and the filter 'audio format for output stream 0:1'
    [Parsed_pan_0 @ 0x7fc82340da40] o0 = 0.5 i0 + 0.5 i1
    [auto-inserted resampler 0 @ 0x7fc82340ce40] ch:1 chl:1 channels fmt:fltp r:44100Hz -> ch:1 chl:mono fmt:s16 r:44100Hz
    [libx264 @ 0x7fc823826000] using SAR=1/1
    [libx264 @ 0x7fc823826000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x7fc823826000] profile High, level 1.3
    [libx264 @ 0x7fc823826000] 264 - core 142 r2455 021c0dc - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - 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=12 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 'output.mp4':
     Metadata:
       encoder         : Lavf55.48.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 322x240 [SAR 1:1 DAR 161:120], q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc (default)
       Metadata:
         encoder         : Lavc55.69.100 libx264
       Stream #0:1: Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 44100 Hz, mono, s16, 128 kb/s (default)
       Metadata:
         encoder         : Lavc55.69.100 libfaac
    Stream mapping:
     Stream #0:0 -> #0:0 (vp8 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (vorbis (native) -> aac (libfaac))
    Press [q] to stop, [?] for help
    No more output streams to write to, finishing.e=00:06:06.87 bitrate= 132.5kbits/s    
    frame=11340 fps=992 q=-1.0 Lsize=    6514kB time=00:06:18.31 bitrate= 141.1kbits/s    
    video:5995kB audio:95kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.954813%
    Input file #0 (video_tong_hua.mp4):
     Input stream #0:0 (video): 11970 packets read (8625600 bytes); 11340 frames decoded;
     Input stream #0:1 (audio): 23356 packets read (4543310 bytes); 23355 frames decoded (16675392 samples);
     Total: 35326 packets (13168910 bytes) demuxed
    Output file #0 (output.mp4):
     Output stream #0:0 (video): 11340 frames encoded; 11340 packets muxed (6139214 bytes);
     Output stream #0:1 (audio): 16285 frames encoded (16675392 samples); 16286 packets muxed (97733 bytes);
     Total: 27626 packets (6236947 bytes) muxed
    [libx264 @ 0x7fc823826000] frame I:70    Avg QP:17.29  size:  7924
    [libx264 @ 0x7fc823826000] frame P:4501  Avg QP:21.54  size:  1006
    [libx264 @ 0x7fc823826000] frame B:6769  Avg QP:21.74  size:   156
    [libx264 @ 0x7fc823826000] consecutive B-frames: 16.7%  8.8%  7.4% 67.1%
    [libx264 @ 0x7fc823826000] mb I  I16..4: 37.6% 29.0% 33.4%
    [libx264 @ 0x7fc823826000] mb P  I16..4:  1.9%  2.5%  0.7%  P16..4: 23.3%  8.0%  4.1%  0.0%  0.0%    skip:59.4%
    [libx264 @ 0x7fc823826000] mb B  I16..4:  0.1%  0.1%  0.0%  B16..8: 17.1%  1.2%  0.2%  direct: 0.8%  skip:80.6%  L0:42.2% L1:52.9% BI: 4.8%
    [libx264 @ 0x7fc823826000] 8x8 transform intra:44.2% inter:55.4%
    [libx264 @ 0x7fc823826000] coded y,uvDC,uvAC intra: 33.9% 47.6% 18.3% inter: 5.4% 4.5% 1.1%
    [libx264 @ 0x7fc823826000] i16 v,h,dc,p: 57% 24% 16%  3%
    [libx264 @ 0x7fc823826000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 18% 43%  3%  3%  4%  3%  4%  4%
    [libx264 @ 0x7fc823826000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 30% 14%  4%  6%  6%  6%  5%  5%
    [libx264 @ 0x7fc823826000] i8c dc,h,v,p: 51% 30% 17%  3%
    [libx264 @ 0x7fc823826000] Weighted P-Frames: Y:1.6% UV:0.5%
    [libx264 @ 0x7fc823826000] ref P L0: 66.8% 17.2% 11.7%  4.3%  0.1%
    [libx264 @ 0x7fc823826000] ref B L0: 91.0%  7.4%  1.7%
    [libx264 @ 0x7fc823826000] ref B L1: 96.0%  4.0%
    [libx264 @ 0x7fc823826000] kb/s:129.79

    ffprobe output :

    ffprobe output.mp4
    ffprobe version 2.3.3 Copyright (c) 2007-2014 the FFmpeg developers
     built on Feb 25 2015 23:01:46 with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/2.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
     libavutil      52. 92.100 / 52. 92.100
     libavcodec     55. 69.100 / 55. 69.100
     libavformat    55. 48.100 / 55. 48.100
     libavdevice    55. 13.102 / 55. 13.102
     libavfilter     4. 11.100 /  4. 11.100
     libavresample   1.  3.  0 /  1.  3.  0
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 19.100 /  0. 19.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf55.48.100
     Duration: 00:06:18.38, start: 0.010227, bitrate: 141 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 322x240 [SAR 1:1 DAR 161:120], 129 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 59.94 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 2 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    digitaltsai:videos jtsai$