Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (66)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie 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 (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (10202)

  • subprocess call of ffmpeg returns negative value

    11 juin 2019, par Zak44

    Here is the original command line call that works at shell :

    ffmpeg -i /Users/abc/Desktop/Test/Full_Mov.mov -vf "drawtext=fontfile=/System/Library/Fonts/Keyboard.ttf: text='SCENE BLAH BLAH - %{frame_num}': start_number=1: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: fontsize=20: box=1: boxcolor=black: boxborderw=5","format=yuv420p" -f segment -segment_frames 123 -reset_timestamps 1 -c:a copy -map 0 "/Users/abc/Desktop/Test/%03d_test40.mov"

    Getting a negative value when trying to run ffmpeg via subprocess, causing it to fail and not process. I’ve even tried dumbing down the call to just run ffmpeg by itself with no arguments, and it still returns a negative value.

    import subprocess
    ffmpeg = "/usr/local/bin/ffmpeg"
    source = "/Users/abc/Desktop/Test/Full_Mov.mov"
    destination = "/Users/abc/Desktop/Test/%03d_test40.mov"
    cmd = "%s -i %s -vf \"drawtext=fontfile=/System/Library/Fonts/Keyboard.ttf: text='SCENE BLAH BLAH - %%{frame_num}': start_number=1: x=(w-tw)/2: y=h-(2*lh): fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=5\",\"format=yuv420p\" -f segment -segment_frames 123 -reset_timestamps 1 -c:a copy -map 0 \"%s\"" % (ffmpeg, source, destination)
    log("ffmpeg cmd: %s" % cmd)
    log(subprocess.check_output(cmd, shell=True))

    When running full command :

    CalledProcessError: Command '/usr/local/bin/ffmpeg -i /Users/abc/Desktop/Full_Mov.mov -vf "drawtext=fontfile=/System/Library/Fonts/Keyboard.ttf: text='SCENE BLAH BLAH - %{frame_num}': start_number=1: x=(w-tw)/2: y=h-(2*lh): fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=5","format=yuv420p" -f segment -segment_frames 318 -reset_timestamps 1 -c:a copy -map 0 "/Users/abc/Desktop/Test/%03d.tmp.mov"' returned non-zero exit status -8
       raise CalledProcessError(retcode, cmd, output=output)

    When running just ffmpeg no arguments :

    CalledProcessError: Command '/usr/local/bin/ffmpeg' returned non-zero exit status 1
       raise CalledProcessError(retcode, cmd, output=output)

    Latest output with suggested changes below :

    subprocess.CalledProcessError: Command '['/usr/local/bin/ffmpeg', '-i', '/Users/szaharak/Desktop/Flix_Test/ep888_sq66_main_mov_2019_05_20_14_15.mov', '-vf', 'drawtext=fontfile=/System/Library/Fonts/Keyboard.ttf:', 'text=SCENE BLAH BLAH - %%{frame_num}:', 'start_number=1:', 'x=(w-tw)/2:', 'y=h-(2*lh):', 'fontcolor=black:', 'fontsize=20:', 'box=1:', 'boxcolor=white:', 'boxborderw=5', 'format=yuv420p', '-f', 'segment', '-segment_frames', '123', '-reset_timestamps', '1', '-c:a', 'copy', '-map', '0', '/Users/szaharak/Desktop/Flix_Test/%03d_test40.mov']' returned non-zero exit status 1

    [NULL @ 0x7f88c3012200] Unable to find a suitable output format for 'text=SCENE BLAH BLAH - %%{frame_num}:'
    text=SCENE BLAH BLAH - %%{frame_num}:: Invalid argument

    And here is latest...

       >>> rc = subprocess.check_call(cmd)
    ffmpeg version N-93891-ge1839283bc-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
     built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
     configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay

     libavutil      56. 28.100 / 56. 28.100
     libavcodec     58. 52.102 / 58. 52.102
     libavformat    58. 27.103 / 58. 27.103
     libavdevice    58.  7.100 / 58.  7.100
     libavfilter     7. 53.101 /  7. 53.101
     libswscale      5.  4.101 /  5.  4.101
     libswresample   3.  4.100 /  3.  4.100
     libpostproc    55.  4.100 / 55.  4.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/szaharak/Desktop/Flix_Test/ep888_sq66_main_mov_2019_05_20_14_15.mov':
     Metadata:
       major_brand     : qt  
       minor_version   : 537199360
       compatible_brands: qt  
       creation_time   : 2019-05-14T17:58:24.000000Z
       com.apple.quicktime.player.movie.audio.gain: 1.000000
       com.apple.quicktime.player.movie.audio.treble: 0.000000
       com.apple.quicktime.player.movie.audio.bass: 0.000000
       com.apple.quicktime.player.movie.audio.balance: 0.000000
       com.apple.quicktime.player.movie.audio.pitchshift: 0.000000
       com.apple.quicktime.player.movie.audio.mute:
       com.apple.quicktime.player.movie.visual.brightness: 0.000000
       com.apple.quicktime.player.movie.visual.color: 1.000000
       com.apple.quicktime.player.movie.visual.tint: 0.000000
       com.apple.quicktime.player.movie.visual.contrast: 1.000000
       com.apple.quicktime.player.version: 7.6.6 (7.6.6)
       com.apple.quicktime.version: 7.7.3 (2943.14) 0x7738000 (Mac OS X, 10.11.6, 15G22010)
     Duration: 00:01:12.67, start: 0.000000, bitrate: 23379 kb/s
       Stream #0:0(eng): Video: mjpeg (Baseline) (jpeg / 0x6765706A), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 72:72 DAR 16:9], 21838 kb/s, 24 fps, 24 tbr, 24k tbn, 24k tbc (default)
       Metadata:
         creation_time   : 2019-05-14T17:58:24.000000Z
         handler_name    : Apple Video Media Handler
         encoder         : Photo - JPEG
       Stream #0:1(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, s16, 1536 kb/s (default)
       Metadata:
         creation_time   : 2019-05-14T17:58:24.000000Z
         handler_name    : Apple Sound Media Handler
    [NULL @ 0x7f8ddc8ce200] Unable to find a suitable output format for 'text=SCENE BLAH BLAH - %{frame_num}: start_number=1: x=(w-tw)/2: y=h-(2*lh): fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=5: format=yuv420p'
    text=SCENE BLAH BLAH - %{frame_num}: start_number=1: x=(w-tw)/2: y=h-(2*lh): fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=5: format=yuv420p: Invalid argument
    Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call
       raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/local/bin/ffmpeg', '-i', '/Users/szaharak/Desktop/Flix_Test/ep888_sq66_main_mov_2019_05_20_14_15.mov', '-vf', 'drawtext=fontfile=/System/Library/Fonts/Keyboard.ttf:', 'text=SCENE BLAH BLAH - %{frame_num}: start_number=1: x=(w-tw)/2: y=h-(2*lh): fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=5: format=yuv420p', '-f', 'segment', '-segment_frames', '123', '-reset_timestamps', '1', '-c:a', 'copy', '-map', '0', '/Users/szaharak/Desktop/Flix_Test/%03d_test40.mov']' returned non-zero exit status 1
    </module></stdin>
  • os.walk returns file names but when trying to modify the files it says directory not found

    13 avril 2021, par epWILL

    Im trying to walk through music folder and find all sub folders in it and convert the mp4's in all folders to wav. It prints out the correct file name but when it trys to convert it says directory not found.

    &#xA;

    I would like to us os.walk to go through all folders instead going through 1 folder and changing the name in the code for the other folders

    &#xA;

    This code works for one folder

    &#xA;

    import os&#xA;import ffmpeg&#xA;import time&#xA;&#xA;path = &#x27;./musicTest/&#x27;&#xA;&#xA;&#xA;os.chdir(path)&#xA;aud_files = os.listdir()&#xA;count = 0&#xA;count2 = 0&#xA;&#xA;&#xA;    ##convert mp4 to wav&#xA;for file in aud_files:&#xA;    os.system(&#x27;ffmpeg -i "{}" -acodec pcm_s16le -ac 1 -ar 16000 output-{}.wav&#x27;.format(file, count))&#xA;    count = count &#x2B; 1&#xA;    os.remove(file)&#xA;

    &#xA;

    this is the code that gives me no directory found when using os.walk but it prints the file name

    &#xA;

    import os&#xA;from pydub import AudioSegment&#xA;import ffmpeg&#xA;&#xA;path = "./musicTest/"&#xA;count = 0&#xA;&#xA;for i, (root, dirs, files) in enumerate(os.walk(path)):&#xA;   if root is not path:&#xA;      for file in files:&#xA;           print(file)&#xA;           os.system(&#x27;ffmpeg -i "{}" -acodec pcm_s16le -ac 1 -ar 16000 output-{}.wav&#x27;.format(file, count))&#xA;           count = count &#x2B; 1&#xA;

    &#xA;

  • Reading RTMP streams using FFMPEG returns AVERROR_EOF randomly

    9 octobre 2013, par user2628781

    I am using FFMpeg to receive RTMP streams. This logic is placed in a custom video player I am building.

    I managed to successfully connect to the RTMP stream and display the video correctly. However, after a period in time, the stream terminates prematurely with an AVERROR_EOF when I perform av_read_frame().

    This indicates to me that the file has ended so my demux, video and audio threads terminates thinking that the video has ended.
    However, the video playback hasn't yet reached its end (in the case of a file streamed through rtmp) or from a live stream (which runs forever). The EOFs are received very randomly so it may run for say 7 min before this occurs or after 3 mins.

    Is this a characteristic behaviour of RTMP or am I doing something incorrectly ?
    I am also having a similar problem with Http Live Streams using FFMpeg.

    A small snippet of the code is provided below :

    AVPacket packet;
    //start timeout timer and timeout
    __interrupt_timer.start();

    int ret = av_read_frame(format_context, &amp;packet); //0: ok, &lt;0: error/end


    //invalidate the timer
    __interrupt_timer.invalidate();

    if (ret != 0) {
       if (ret == AVERROR_EOF) { //end of file. FIXME: why no eof if replaying by seek(0)?            
           if (!eof) {
               eof = true;
               started_ = false;
               pkt->data = QByteArray(); //flush
               pkt->markEnd();
               qDebug("End of file. %s %d", __FUNCTION__, __LINE__);
               emit finished();
               return true;
           }
           pkt->data = QByteArray(); //flush
           //return true;
           return false; //frames after eof are eof frames
       } else if (ret == AVERROR_INVALIDDATA) {
           qWarning("AVERROR_INVALIDDATA");
       } else if (ret == AVERROR(EAGAIN)) {
           return true;
       }
       qWarning("[AVDemuxer] error: %s", av_err2str(ret));
       return false;
    }