Recherche avancée

Médias (0)

Mot : - Tags -/upload

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (47)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

Sur d’autres sites (6561)

  • ffmpeg how can I get the overlay to apply to all images in the slideshow

    7 avril 2022, par user2785245

    This command applies the overlay image to only the first image of the slideshow series. I messed with labeling and can't figure out the correct labels to get the overlay to apply to all images in the video.

    


    /opt/bin/ffmpeg -y -framerate 1/3 -start_number 1 -i %01d.jpg -i $watermark.png -filter_complex "pad=500:500:(500-iw*min(500/iw\,500/ih))/2:(500-ih*min(500/iw\,500/ih))/2:color=white,overlay=250:420" out.mp4 2>&1


    


  • Audio clipping after amerge in FFmpeg

    23 avril 2021, par gooey_duck

    Hoping someone out there can help me with this audio issue I'm having using FFmpeg. I've written a bash script using FFmpeg that processes as source a broadcast quality ProRes (HQ) file with four mono tracks of audio. Source audio is LPCM 24-bit, 48kHz signed little endian, and I am exporting the same. Track 1 is full mix left, track 2 is full mix right, track 3 is music/FX left and track 4 is music/FX right. The script takes the source video and trims the video asset using in and out points from a sidecar XML. It also adds a custom slate at the head that uses a separate slate-only MOV file and is joined together via concat. Custom text is added to the slate via the drawtext filter and, finally, audio tracks 3 and 4 are removed and tracks 1 and 2 are merged together into a single stereo interleaved track using amerge.

    


    All of this, seemingly, works like a charm. The problem I'm noticing occurs when I run the resulting export through our in-house QC software. This software detects audio signal clipping at multiple points throughout the file created by FFmpeg. When I create this exact same file via Adobe Premiere or another transcode system, our QC does not detect any clipping. Our QC tools also do not detect any clipping in the source file. This leads me to believe that the clipping is being introduced either by FFmpeg or by my implementation of it. I've tried multiple additional filters within FFmpeg, including pan, amix, volume, etc., but nothing seems to help.

    


    Anyone have any ideas ? Pasting the relevant section of my script for reference :

    


    ffmpeg \
-ss "$hour":"$min":"$sec""$mil_fin" \
-t "$hour_minus":"$min_b":"$sec_b""$mil_fin_b" \
-i "$vid" \
-i "$elements_path"Slate_HD.mov \
-filter_complex \
"[0:a:0] [0:a:1] amerge=inputs=2 [stereo]; \
[1:0] [1:1] [0:0] [stereo] concat=n=2:v=1:a=1 [v] [a]; \
[v]drawtext=enable='between(t,0,28)':fontfile="$fonts"Arial.ttf:fontsize=50:fontcolor=white\
:x=170:y=170:text='$title', \
drawtext=enable='between(t,0,28)':fontfile="$fonts"Arial.ttf:fontsize=50:fontcolor=white\
:x=170:y=170+50:text='Series $series_number Episode $episode_number', \
drawtext=enable='between(t,0,28)':fontfile="$fonts"Arial.ttf:fontsize=50:fontcolor=white\
:x=170:y=170+150:text='$transcode_date', \
yadif=0:-1:0 [o]" \
-map '[o]' -map '[a]' \
-timecode 09:59:30:00 \
-c:v prores_ks -profile:v 3 \
-c:a pcm_s24le \
-threads 3 \
"$output_name".mov


    


    Per suggestion, simplified audio only command line was run as follows :

    


    ffmpeg -i test.mov -i Slate_HD.mov -filter_complex "[0:a:0] [0:a:1] amerge=inputs=2 [stereo];[1:a][stereo]concat=n=2:a=1:v=0" -c:a pcm_s24le test_output.mov


    


    ...and the log from that command line :

    


    ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.2_3 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/input/test.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2021-04-22T18:58:58.000000Z
  Duration: 00:02:00.04, start: 0.000000, bitrate: 170739 kb/s
    Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080, 166061 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : Apple ProRes 422 HQ
      timecode        : 00:00:00:00
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #0:4(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #0:5(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Time Code Media Handler
      timecode        : 00:00:00:00
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/input/Slate_HD.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2021-03-22T17:23:16.000000Z
  Duration: 00:00:30.00, start: 0.000000, bitrate: 77599 kb/s
    Stream #1:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709, progressive), 1920x1080, 75783 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2021-03-22T17:23:16.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : Apple ProRes 422 HQ
      timecode        : 00:00:00:00
    Stream #1:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2021-03-22T17:23:16.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #1:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2021-03-22T17:23:16.000000Z
      handler_name    : Time Code Media Handler
      timecode        : 00:00:00:00
Stream mapping:
  Stream #0:1 (pcm_s24le) -> amerge:in0 (graph 0)
  Stream #0:2 (pcm_s24le) -> amerge:in1 (graph 0)
  Stream #1:1 (pcm_s16le) -> concat:in0:a0 (graph 0)
  concat (graph 0) -> Stream #0:0 (pcm_s24le)
  Stream #0:0 -> #0:1 (prores (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x7feadf81a600] using SAR=1/1
[libx264 @ 0x7feadf81a600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7feadf81a600] profile High 4:2:2, level 4.0, 4:2:2, 10-bit
[libx264 @ 0x7feadf81a600] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - 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=2 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=81 qpstep=4 ip_ratio=1.40 aq=1:1.00
[Parsed_amerge_0 @ 0x7feade41dfc0] No channel layout for input 1
[Parsed_amerge_0 @ 0x7feade41dfc0] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
Output #0, mov, to '/output/test_output.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf58.45.100
    Stream #0:0: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32, 2304 kb/s (default)
    Metadata:
      encoder         : Lavc58.91.100 pcm_s24le
    Stream #0:1(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv422p10le(top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 0.04 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Video Media Handler
      timecode        : 00:00:00:00
      encoder         : Lavc58.91.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=   47 fps=0.0 q=0.0 size=       0kB time=00:00:00.02 bitrate=  15.0kbits/sframe=   88 fps= 80 q=40.0 size=     256kB time=00:00:01.17 bitrate=1791.7kbits/frame=  133 fps= 82 q=40.0 size=     768kB time=00:00:02.98 bitrate=2110.4kbits/frame=  164 fps= 76 q=40.0 size=    1280kB time=00:00:04.21 bitrate=2488.8kbits/frame=  185 fps= 70 q=40.0 size=    1792kB time=00:00:05.06 bitrate=2899.0kbits/frame=  195 fps= 61 q=40.0 size=    2048kB time=00:00:05.44 bitrate=3079.6kbits/frame=  206 fps= 55 q=40.0 size=    2560kB time=00:00:05.89 bitrate=3557.0kbits/frame=  218 fps= 51 q=40.0 size=    3072kB time=00:00:06.38 bitrate=3942.1kbits/frame=  230 fps= 47 q=40.0 size=    3584kB time=00:00:06.85 bitrate=4284.1kbits/frame=  242 fps= 44 q=40.0 size=    4096kB time=00:00:07.34 bitrate=4570.7kbits/frame=  251 fps= 42 q=37.0 size=    4352kB time=00:00:07.70 bitrate=4627.7kbits/frame=  265 fps= 41 q=40.0 size=    5376kB time=00:00:08.25 bitrate=5334.4kbits/frame=  272 fps= 39 q=40.0 size=    5632kB time=00:00:08.53 bitrate=5406.8kbits/frame=  283 fps= 37 q=40.0 size=    5888kB time=00:00:08.98 bitrate=5370.6kbits/frame=  296 fps= 37 q=40.0 size=    6400kB .04 bitrate=5549.0kbits/frame= 3001 fps= 21 q=-1.0 Lsize=  106530kB time=00:02:30.04 bitrate=5816.4kbits/s speed=1.07x    
video:64287kB audio:42199kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.041280%
[libx264 @ 0x7feadf81a600] frame I:33    Avg QP:33.56  size:113497
[libx264 @ 0x7feadf81a600] frame P:984   Avg QP:36.20  size: 35478
[libx264 @ 0x7feadf81a600] frame B:1984  Avg QP:37.44  size: 13696
[libx264 @ 0x7feadf81a600] consecutive B-frames: 11.5%  0.9%  0.9% 86.8%
[libx264 @ 0x7feadf81a600] mb I  I16..4:  3.4% 86.8%  9.7%
[libx264 @ 0x7feadf81a600] mb P  I16..4:  1.6% 13.7%  0.7%  P16..4: 44.3%  8.5%  7.0%  0.0%  0.0%    skip:24.2%
[libx264 @ 0x7feadf81a600] mb B  I16..4:  0.1%  1.1%  0.0%  B16..8: 47.6%  2.4%  0.3%  direct: 1.3%  skip:47.3%  L0:47.0% L1:51.3% BI: 1.7%
[libx264 @ 0x7feadf81a600] 8x8 transform intra:85.9% inter:88.3%
[libx264 @ 0x7feadf81a600] coded y,uvDC,uvAC intra: 67.9% 73.8% 13.9% inter: 20.8% 21.6% 0.6%
[libx264 @ 0x7feadf81a600] i16 v,h,dc,p: 48% 15%  4% 33%
[libx264 @ 0x7feadf81a600] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 11% 27%  6%  7%  7%  7%  8%  7%
[libx264 @ 0x7feadf81a600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 15% 14%  7%  9%  9%  8%  6%  5%
[libx264 @ 0x7feadf81a600] i8c dc,h,v,p: 57% 12% 24%  7%
[libx264 @ 0x7feadf81a600] Weighted P-Frames: Y:0.1% UV:0.1%
[libx264 @ 0x7feadf81a600] ref P L0: 69.1% 21.7%  9.2%  0.0%
[libx264 @ 0x7feadf81a600] ref B L0: 87.2% 10.4%  2.5%
[libx264 @ 0x7feadf81a600] ref B L1: 94.9%  5.1%
[libx264 @ 0x7feadf81a600] kb/s:4387.16
WU:~ user$ 
ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.2_3 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/input/test.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2021-04-22T18:58:58.000000Z
  Duration: 00:02:00.04, start: 0.000000, bitrate: 170739 kb/s
    Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080, 166061 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : Apple ProRes 422 HQ
      timecode        : 00:00:00:00
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #0:4(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #0:5(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Time Code Media Handler
      timecode        : 00:00:00:00
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/input/Slate_HD.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2021-03-22T17:23:16.000000Z
  Duration: 00:00:30.00, start: 0.000000, bitrate: 77599 kb/s
    Stream #1:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709, progressive), 1920x1080, 75783 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2021-03-22T17:23:16.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : Apple ProRes 422 HQ
      timecode        : 00:00:00:00
    Stream #1:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2021-03-22T17:23:16.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #1:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2021-03-22T17:23:16.000000Z
      handler_name    : Time Code Media Handler
      timecode        : 00:00:00:00
Stream mapping:
  Stream #0:1 (pcm_s24le) -> amerge:in0 (graph 0)
  Stream #0:2 (pcm_s24le) -> amerge:in1 (graph 0)
  Stream #1:1 (pcm_s16le) -> concat:in0:a0 (graph 0)
  concat (graph 0) -> Stream #0:0 (pcm_s24le)
  Stream #0:0 -> #0:1 (prores (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x7feadf81a600] using SAR=1/1
[libx264 @ 0x7feadf81a600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7feadf81a600] profile High 4:2:2, level 4.0, 4:2:2, 10-bit
[libx264 @ 0x7feadf81a600] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - 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=2 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=81 qpstep=4 ip_ratio=1.40 aq=1:1.00
[Parsed_amerge_0 @ 0x7feade41dfc0] No channel layout for input 1
[Parsed_amerge_0 @ 0x7feade41dfc0] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
Output #0, mov, to '/output/test_output.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf58.45.100
    Stream #0:0: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32, 2304 kb/s (default)
    Metadata:
      encoder         : Lavc58.91.100 pcm_s24le
    Stream #0:1(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv422p10le(top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 0.04 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2021-04-22T18:58:58.000000Z
      handler_name    : Apple Video Media Handler
      timecode        : 00:00:00:00
      encoder         : Lavc58.91.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=   47 fps=0.0 q=0.0 size=       0kB time=00:00:00.02 bitrate=  15.0kbits/sframe=   88 fps= 80 q=40.0 size=     256kB time=00:00:01.17 bitrate=1791.7kbits/frame=  133 fps= 82 q=40.0 size=     768kB time=00:00:02.98 bitrate=2110.4kbits/frame=  164 fps= 76 q=40.0 size=    1280kB time=00:00:04.21 bitrate=2488.8kbits/frame=  185 fps= 70 q=40.0 size=    1792kB time=00:00:05.06 bitrate=2899.0kbits/frame=  195 fps= 61 q=40.0 size=    2048kB time=00:00:05.44 bitrate=3079.6kbits/frame=  206 fps= 55 q=40.0 size=    2560kB time=00:00:05.89 bitrate=3557.0kbits/frame=  218 fps= 51 q=40.0 size=    3072kB time=00:00:06.38 bitrate=3942.1kbits/frame=  230 fps= 47 q=40.0 size=    3584kB time=00:00:06.85 bitrate=4284.1kbits/frame=  242 fps= 44 q=40.0 size=    4096kB time=00:00:07.34 bitrate=4570.7kbits/frame=  251 fps= 42 q=37.0 size=    4352kB time=00:00:07.70 bitrate=4627.7kbits/frame=  265 fps= 41 q=40.0 size=    5376kB time=00:00:08.25 bitrate=5334.4kbits/frame=  272 fps= 39 q=40.0 size=    5632kB time=00:00:08.53 bitrate=5406.8kbits/frame=  283 fps= 37 q=40.0 size=    5888kB time=00:00:08.98 bitrate=5370.6kbits/frame=  296 fps= 37 q=40.0 size=    6400kB .04 bitrate=5549.0kbits/frame= 3001 fps= 21 q=-1.0 Lsize=  106530kB time=00:02:30.04 bitrate=5816.4kbits/s speed=1.07x    
video:64287kB audio:42199kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.041280%
[libx264 @ 0x7feadf81a600] frame I:33    Avg QP:33.56  size:113497
[libx264 @ 0x7feadf81a600] frame P:984   Avg QP:36.20  size: 35478
[libx264 @ 0x7feadf81a600] frame B:1984  Avg QP:37.44  size: 13696
[libx264 @ 0x7feadf81a600] consecutive B-frames: 11.5%  0.9%  0.9% 86.8%
[libx264 @ 0x7feadf81a600] mb I  I16..4:  3.4% 86.8%  9.7%
[libx264 @ 0x7feadf81a600] mb P  I16..4:  1.6% 13.7%  0.7%  P16..4: 44.3%  8.5%  7.0%  0.0%  0.0%    skip:24.2%
[libx264 @ 0x7feadf81a600] mb B  I16..4:  0.1%  1.1%  0.0%  B16..8: 47.6%  2.4%  0.3%  direct: 1.3%  skip:47.3%  L0:47.0% L1:51.3% BI: 1.7%
[libx264 @ 0x7feadf81a600] 8x8 transform intra:85.9% inter:88.3%
[libx264 @ 0x7feadf81a600] coded y,uvDC,uvAC intra: 67.9% 73.8% 13.9% inter: 20.8% 21.6% 0.6%
[libx264 @ 0x7feadf81a600] i16 v,h,dc,p: 48% 15%  4% 33%
[libx264 @ 0x7feadf81a600] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 11% 27%  6%  7%  7%  7%  8%  7%
[libx264 @ 0x7feadf81a600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 15% 14%  7%  9%  9%  8%  6%  5%
[libx264 @ 0x7feadf81a600] i8c dc,h,v,p: 57% 12% 24%  7%
[libx264 @ 0x7feadf81a600] Weighted P-Frames: Y:0.1% UV:0.1%
[libx264 @ 0x7feadf81a600] ref P L0: 69.1% 21.7%  9.2%  0.0%
[libx264 @ 0x7feadf81a600] ref B L0: 87.2% 10.4%  2.5%
[libx264 @ 0x7feadf81a600] ref B L1: 94.9%  5.1%
[libx264 @ 0x7feadf81a600] kb/s:4387.16
WU:~ user$ 


    


  • Broken Pipe Error [Errno 32] after saving more than ten PNG images using PIL

    6 septembre 2019, par Blinko

    I am using the ffmpeg pipeline to compress a series of png frames and output an mp4 video, while also saving each frame as a separate png image. The problem is that every time I run the script, I get a Broken Pipe error on the 11th image :

    Traceback (most recent call last):
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/ImageFile.py", line 487, in _save
       fh = fp.fileno()
    AttributeError: '_idat' object has no attribute 'fileno'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
     File "gen_clip.py", line 173, in <module>
       main()
     File "gen_clip.py", line 167, in main
       ts_pos = (0,frame.samplesperbeam-50)
     File "/Users/Amanda/Desktop/data/pyARIS.py", line 1028, in make_video
       im.save(pipe.stdin, 'PNG')
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/Image.py", line 1994, in save
       save_handler(self, fp, filename)
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/PngImagePlugin.py", line 868, in _save
       [("zip", (0, 0)+im.size, 0, rawmode)])
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/ImageFile.py", line 502, in _save
       fp.write(d)
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/PngImagePlugin.py", line 730, in write
       self.chunk(self.fp, b"IDAT", data)
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/PngImagePlugin.py", line 717, in putchunk
       fp.write(data)
    BrokenPipeError: [Errno 32] Broken pipe
    </module>

    I am not too familiar with PIL or ffmpeg, so I am not sure whether it’s a problem with the pipe parameters that I am passing in or something to do with the code itself. No matter what the starting frame number is, the error always appears after 10 images are saved.

    Here is the array of pipe parameters I’m sending to the command prompt :

    command = ['ffmpeg',
          '-y',
          '-f', 'image2pipe',
          '-vcodec', 'png',
          '-r', '1',
          '-r', str(fps), # frames per second
          '-i', '-', # The input comes from a pipe
          '-an', # Tells FFMPEG not to expect any audio
          '-vcodec', 'mpeg4',
          '-b:v', '5000k',
          '../'+filename+"/"+filename+".mp4",
          '-hide_banner',
          '-loglevel', 'panic']

    This is the loop that generates and saves each image :

       for i in tqdm.tqdm(range(start_frame, end_frame)):
           frame = FrameRead(data, i)
           frame_image = np.zeros([ydim, xdim], dtype=np.uint8)
           frame_image[image_write_rows, image_write_cols] = frame.frame_data[sample_read_rows, sample_read_cols]

           all_frame_data.append(frame.frame_data)
           im = Image.fromarray(cm(frame_image, bytes=True))

           if timestamp == True:
               ts = str(datetime.datetime.fromtimestamp(frame.sonartimestamp/1000000, pytz.timezone('UTC')).strftime('%Y-%m-%d %H:%M:%S'))
               text = "%s\n%d" % (ts, i)
               draw = ImageDraw.Draw(im)
               draw.text(ts_pos,text,font=font, fill = 'white')

           im.save(directory+filename+'/frames/'+str(i)+'_'+str(frame.sonartimestamp)+'_'+filename+'.png'  , "PNG")
           im.save(pipe.stdin, 'PNG')
           j += 1

    I am running this on MacOS, Python 3.6. Help on the cause of the error and/or possible solutions will be greatly appreciated !