Recherche avancée

Médias (91)

Autres articles (65)

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

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (8639)

  • hevc : store the escaped/raw bitstream in HEVCNAL

    25 janvier 2015, par Hendrik Leppkes
    hevc : store the escaped/raw bitstream in HEVCNAL
    

    Hardware Accelerators require access to the escaped bitstream.

    Signed-off-by : Anton Khirnov <anton@khirnov.net>

    • [DBH] libavcodec/hevc.c
    • [DBH] libavcodec/hevc.h
  • FFMPEG - Green cast with Splash image in video

    30 mai 2020, par rossmcm

    I'm using FFMPEG to produce a video consisting of a single monchrome JPG image :

    &#xA;&#xA;

    ffmpeg -y -loop 1 -framerate 30 -t 5 -i SplashBW.jpg Splash.mp4&#xA;

    &#xA;&#xA;

    There are two issues with the resulting video :

    &#xA;&#xA;

      &#xA;
    • When viewed with VLC it has a green cast
    • &#xA;

    • When viewed with "Film and TV" (I suspect this is the Windows 10&#xA;viewer - the association for MP4 files seems to have been hijacked&#xA;on my PC) it has a green cast and a predominant flickering every&#xA;0.5 seconds or so.
    • &#xA;

    &#xA;&#xA;

    When viewed with Irfan View it looks fine. I don't know whether the issue is with the original JPG, the FFMPEG command, or the viewers. Naturally, I want it to render properly on all outputs.

    &#xA;&#xA;

    The first two links below look fine in my browser (Chrome) when I open them. The third link is a screen recording of what I see when I try to play the video with the Film and TVapp.

    &#xA;&#xA;

    B&W image

    &#xA;&#xA;

    Resulting video

    &#xA;&#xA;

    screen grab of video playing on my PC

    &#xA;&#xA;

    A log of the FFMPEG run :

    &#xA;&#xA;

    C:\Users\Raymond\Desktop\Chorus\Videos\Virtual Choir>call ffmpeg -y -loglevel verbose -loop 1 -framerate 30 -t 5 -i SplashBW.jpg Splash.mp4&#xA;ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers&#xA;  built with gcc 9.2.1 (GCC) 20200122&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libope&#xA;ncore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --&#xA;enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuv&#xA;id --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;[AVIOContext @ 000001e6f6ccdd00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6ccde80] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6d59b00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6ccde40] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6ccdf00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6ccdfc0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cce180] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cce240] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd33c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd3480] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd3640] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd3700] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 19 times&#xA;Input #0, image2, from &#x27;SplashBW.jpg&#x27;:&#xA;  Duration: 00:00:00.03, start: 0.000000, bitrate: 38348 kb/s&#xA;    Stream #0:0: Video: mjpeg (Baseline), 1 reference frame, gray(bt470bg/unknown/unknown, center), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 30 tbn, 30 tbc&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))&#xA;Press [q] to stop, [?] for help&#xA;[graph 0 input from stream 0:0 @ 000001e6f6cd2ec0] w:1920 h:1080 pixfmt:gray tb:1/30 fr:30/1 sar:1/1 sws_param:flags=2&#xA;[libx264 @ 000001e6f6d57100] using SAR=1/1&#xA;[libx264 @ 000001e6f6d57100] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2&#xA;[libx264 @ 000001e6f6d57100] profile High, level 4.0, 4:0:0, 8-bit&#xA;[libx264 @ 000001e6f6d57100] 264 - core 159 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - 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 chro&#xA;ma_me=0 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 weigh&#xA;tb=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&#xA;Output #0, mp4, to &#x27;Splash.mp4&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf58.29.100&#xA;    Stream #0:0: Video: h264 (libx264), 1 reference frame (avc1 / 0x31637661), gray(center), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc&#xA;    Metadata:&#xA;      encoder         : Lavc58.54.100 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1&#xA;[AVIOContext @ 000001e6f8b98e00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5980] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeksspeed=   0x&#xA;[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks1.0kbits/s speed=0.359x&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks0.3kbits/s speed=0.828x&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks0.2kbits/s speed=1.16x&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 2 times&#xA;[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5980] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks&#xA;    Last message repeated 1 times&#xA;[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks&#xA;[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks&#xA;No more output streams to write to, finishing.&#xA;frame=  150 fps= 51 q=-1.0 Lsize=     142kB time=00:00:04.90 bitrate= 237.8kbits/s speed=1.65x&#xA;video:140kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.855892%&#xA;Input file #0 (SplashBW.jpg):&#xA;  Input stream #0:0 (video): 151 packets read (24127535 bytes); 151 frames decoded;&#xA;  Total: 151 packets (24127535 bytes) demuxed&#xA;Output file #0 (Splash.mp4):&#xA;  Output stream #0:0 (video): 150 frames encoded; 150 packets muxed (143004 bytes);&#xA;  Total: 150 packets (143004 bytes) muxed&#xA;[AVIOContext @ 000001e6f6d59240] Statistics: 2 seeks, 4 writeouts&#xA;[libx264 @ 000001e6f6d57100] frame I:1     Avg QP:18.13  size:131209&#xA;[libx264 @ 000001e6f6d57100] frame P:38    Avg QP:16.03  size:    87&#xA;[libx264 @ 000001e6f6d57100] frame B:111   Avg QP:24.33  size:    70&#xA;[libx264 @ 000001e6f6d57100] consecutive B-frames:  1.3%  0.0%  0.0% 98.7%&#xA;[libx264 @ 000001e6f6d57100] mb I  I16..4:  1.8% 96.0%  2.2%&#xA;[libx264 @ 000001e6f6d57100] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:99.9%&#xA;[libx264 @ 000001e6f6d57100] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%  L0:21.7% L1:78.3% BI: 0.0%&#xA;[libx264 @ 000001e6f6d57100] 8x8 transform intra:96.0% inter:98.7%&#xA;[libx264 @ 000001e6f6d57100] coded y intra: 94.7% inter: 0.0%&#xA;[libx264 @ 000001e6f6d57100] i16 v,h,dc,p: 24% 37%  5% 34%&#xA;[libx264 @ 000001e6f6d57100] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46% 22% 11%  3%  3%  3%  4%  3%  5%&#xA;[libx264 @ 000001e6f6d57100] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 79%  9%  2%  1%  2%  1%  4%  1%  1%&#xA;[libx264 @ 000001e6f6d57100] i8c dc,h,v,p: 100%  0%  0%  0%&#xA;[libx264 @ 000001e6f6d57100] Weighted P-Frames: Y:0.0%&#xA;[libx264 @ 000001e6f6d57100] ref P L0: 96.6%  0.7%  1.3%  1.3%&#xA;[libx264 @ 000001e6f6d57100] ref B L0: 96.9%  2.1%  1.0%&#xA;[libx264 @ 000001e6f6d57100] ref B L1: 94.8%  5.2%&#xA;[libx264 @ 000001e6f6d57100] kb/s:227.72&#xA;[AVIOContext @ 000001e6f6ccb880] Statistics: 32768 bytes read, 0 seeks&#xA;

    &#xA;

  • Bash : bash script to download trimmed mp3 from youtube url

    25 août 2017, par Bhishan Poudel

    I would like to download the initially x seconds trimmed mp3 from a video url of youtube.
    I found that youtube-dl can download the video from youtube to local machine. But, when I looked at the man pages of youtube-dl, I could not find any trim options.

    So I tried to use the ffmpeg to trim downloaded mp3 file.
    Instead of doing this is two steps, I like to write one bash script which does the same thing.
    My attempt is given below.

    However, I was stuck at one place :
    "HOW TO GET THE VARIABLE NAME OF OUTPUT MP3 FILE FROM YOUTUBE-DL ?"
    The script is given below :

    # trim initial x seconds of mp3 file
    # e.g. mytrim https://www.youtube.com/watch?v=dD5RgCf1hrI 30
    function mytrim() {
       youtube-dl --extract-audio --embed-thumbnail --audio-format mp3 -o "%(title)s.%(ext)s" $1
       ffmpeg -ss $2 -i $OUTPUT_MP3 -acodec copy -y temp.mp3
       mv temp.mp3 $OUTPUT_MP3
       }

    How to get the variable value $OUTPUT_MP3 ?
    echo "%(title)s.%(ext)s" gives the verbatim output, does not give the output filename.

    How could we make the script work ?

    The help will be appreciated.