Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

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

Autres articles (95)

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

  • 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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (5138)

  • Matomo Celebrates 15 Years of Building an Open-Source & Transparent Web Analytics Solution

    30 juin 2022, par Matthieu Aubry — About, Community
    &lt;script type=&quot;text/javascript&quot;&gt;<br />
           if ('function' === typeof window.playMatomoVideo){<br />
           window.playMatomoVideo(&quot;brand&quot;, &quot;#brand&quot;)<br />
           } else {<br />
           document.addEventListener(&quot;DOMContentLoaded&quot;, function() { window.playMatomoVideo(&quot;brand&quot;, &quot;#brand&quot;); });<br />
           }<br />
      &lt;/script&gt;

    Fifteen years ago, I realised that people (myself included) were increasingly integrating the internet into their everyday lives, and it was clear that it would only expand in the future. It was an exciting new world, but the amount of personal data shared online, level of tracking and lack of security was a growing concern. Google Analytics was just launched then and was already gaining huge traction – so data from millions of websites started flowing into Google’s database, creating what was then the biggest centralised database about people worldwide and their actions online.

    So as a young engineering student, I decided we needed to build an open source and transparent solution that could help make the internet more secure and private while still providing organisations with powerful insights. I aimed to create a win-win solution for businesses and their digital consumers.

    And in 2007, I started developing Matomo with the help from Scott Switzer and Jennifer Langdon (who offered me an internship and support).   

    All thanks to the Matomo Community

    We have reached significant milestones and made major changes over the last 15 years, but we wouldn’t be where we are today without the Matomo Community.

    So I would like to celebrate and thank the hundreds of volunteer developers who have donated their time to develop Matomo, the thousands of contributors who provided feedback to improve Matomo, the countless supportive forum members, our passionate team of 40 at Matomo, the numerous translators who have translated Matomo and the 1.5 million websites that choose Matomo as their analytics platform.

    Matomo's Birthday
    Team Meetup in Paris in 2012

    Matomo has been a community effort built on the shoulders of many, and we will continue to work for you. 

    So let’s look at some milestones we have achieved over the last 15 years.

    Looking back on milestones in our timeline

    2007

    • Birth of Matomo
    • First alpha version released

    2008

    • Release first public 0.1.0 version

    2009

    • 50,000 websites use Matomo

    2010

    • Matomo first stable 1.0.0 released
    • Mobile app launched

    2011

    • Released Ecommerce Analytics, Custom Variables, First Party Cookies

    • Released Privacy control features (first of many privacy features to come !)

    2012

    • Released Log Analytics feature
    • 1 Million Downloads !
    • 300,000 websites worldwide use Matomo

    2013

    • Matomo is now available in 50 languages !
    • Matomo brand redesign

    2016

    2017

    • Launched Matomo Cloud service 
    • Released Multi Channel Conversion Attribution Premium Feature, Custom Reports Premium Feature, Login Saml Premium Feature, WooCommerceAnalytics Premium Feature and Heatmap & Session Recording Premium Feature 

    2018

    2019

    2020

    2021

    • 1,000,000 websites worldwide use Matomo
    • including 30,000 active Matomo for WordPress installations
    • Released SEO Web Vitals, Advertising Conversion Export and Tracking Spam Prevention feature

    2022

    • Released WP Statistics to Matomo importer

    Our efforts continue

    While we’ve seen incredible growth over the years, our work doesn’t stop there. In fact, we’re only just getting started.

    Today over 55% of the internet continues to use privacy-threatening web analytics solutions, while 1.5% uses Matomo. So there are still great strides to be made to create a more private internet, and joining the Matomo Community is one way to support this movement.

    There are many ways to get involved too, such as :

    So what comes next for Matomo ?

    The future of Matomo is approachable, powerful and flexible. We’re strengthening the customers’ voice, expanding our resources internally (we’re continuously hiring !) and conducting rigorous customer research to craft a tool that balances usability and functionality.

    I look forward to the next 15 years and seeing what the future holds for Matomo and our community.

  • Transcode WEBM to RTMP

    7 avril 2024, par Justin White

    Summary

    &#xA;

    My goal is to take a webcam stream from the browser and feed it into a program called Restreamer that takes in an RTMP stream.

    &#xA;

    I've deduced that the browser Recording API produces Blobs that can be saved as WEBM.

    &#xA;

    In order to stream the WEBM content to Restreamer I am attempting to use FFmpeg. I've read that forcing FLV format is required but otherwise all of the arguments are Greek to me. I've been unable to find a comparable topic where someone has tried to go from WEBM to RTMP. I have found examples of going the other direction, but reversing the FFmpeg command proved unfruitful.

    &#xA;

    Saving to FLV works fine. Using the following command, I am able to transcode a WEBM file to FLV and play it on VLC :
    &#xA;ffmpeg -i ~/big-buck-bunny_trailer.webm -f flv out.flv

    &#xA;

    However, if instead of outputting to a file I pass it to RTMP I get the following output :
    &#xA;ffmpeg -i ~/Downloads/big-buck-bunny_trailer.webm -f flv "rtmp://example.com/live"

    &#xA;

    ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with gcc 12 (GCC)&#xA;  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags=&#x27;-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection&#x27; --extra-ldflags=&#x27;-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 &#x27; --extra-cflags=&#x27; -I/usr/include/rav1e&#x27; --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --enable-chromaprint --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libbs2b --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librav1e --enable-librtmp --enable-librubberband --enable-libsmbclient --enable-version3 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libglslang --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-avfilter --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libmfx --enable-runtime-cpudetect&#xA;  libavutil      57. 17.100 / 57. 17.100&#xA;  libavcodec     59. 18.100 / 59. 18.100&#xA;  libavformat    59. 16.100 / 59. 16.100&#xA;  libavdevice    59.  4.100 / 59.  4.100&#xA;  libavfilter     8. 24.100 /  8. 24.100&#xA;  libswscale      6.  4.100 /  6.  4.100&#xA;  libswresample   4.  3.100 /  4.  3.100&#xA;  libpostproc    56.  3.100 / 56.  3.100&#xA;Input #0, matroska,webm, from &#x27;/home/kyjus25/big-buck-bunny_trailer.webm&#x27;:&#xA;  Metadata:&#xA;    encoder         : http://sourceforge.net/projects/yamka&#xA;    creation_time   : 2010-05-20T08:21:12.000000Z&#xA;  Duration: 00:00:32.48, start: 0.000000, bitrate: 533 kb/s&#xA;  Stream #0:0(eng): Video: vp8, yuv420p(progressive), 640x360, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn (default)&#xA;  Stream #0:1(eng): Audio: vorbis, 44100 Hz, mono, fltp (default)&#xA;HandShake: client signature does not match!&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (vp8 (native) -> flv1 (flv))&#xA;  Stream #0:1 -> #0:1 (vorbis (native) -> mp3 (libmp3lame))&#xA;Press [q] to stop, [?] for help&#xA;Output #0, flv, to &#x27;rtmp://example.com/live&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf59.16.100&#xA;  Stream #0:0(eng): Video: flv1 ([2][0][0][0] / 0x0002), yuv420p(tv, bt470bg/unknown/unknown, progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 1k tbn (default)&#xA;    Metadata:&#xA;      encoder         : Lavc59.18.100 flv&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A&#xA;  Stream #0:1(eng): Audio: mp3 ([2][0][0][0] / 0x0002), 44100 Hz, mono, fltp (default)&#xA;    Metadata:&#xA;      encoder         : Lavc59.18.100 libmp3lame&#xA;WriteN, RTMP send error 32 (136 bytes)7kB time=00:00:00.39 bitrate= 136.7kbits/s speed=71.2x    &#xA;WriteN, RTMP send error 32 (35 bytes)&#xA;WriteN, RTMP send error 9 (42 bytes)&#xA;av_interleaved_write_frame(): Operation not permitted&#xA;    Last message repeated 1 times&#xA;[flv @ 0x55d0dd0af700] Failed to update header with correct duration.&#xA;[flv @ 0x55d0dd0af700] Failed to update header with correct filesize.&#xA;Error writing trailer of rtmp://example.com/live: Operation not permitted&#xA;frame=   53 fps=0.0 q=4.3 Lsize=     146kB time=00:00:02.45 bitrate= 486.8kbits/s speed=42.8x    &#xA;video:128kB audio:19kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;Error closing file rtmp://example.com/live: Operation not permitted&#xA;Conversion failed!&#xA;

    &#xA;

    There are several interesting rabbit holes to follow here, but after following all of them I've come up with nothing.

    &#xA;

    HandShake: client signature does not match! :
    &#xA;More of a warning than an error, I assumed because I was going from "WEBM -> FLV" instead of the more traditional "MP4 -> FLV".

    &#xA;

    av_interleaved_write_frame(): Operation not permitted :
    &#xA;I found several issues on this. One of them calling it a storage issue, the other calling it a file permissions issue. I have plenty of disk space and have tried setting the input file to 777 permissions. However, the examples I've found on it being a file permissions issue all deal with outputting to a file rather than to an an RTMP IP.

    &#xA;

    Failed to update header with correct duration :
    &#xA;Advice I found was to add -flvflags no_duration_filesize to the command, which does suppress both "Failed to update..." errors, but does not fix the over-arching issue.

    &#xA;

    What I've Tried

    &#xA;

    • Multi-format transcoding

    &#xA;

    MP4 to RTMP does work correctly :
    &#xA;ffmpeg -i ~/Downloads/big-buck-bunny_trailer.mp4 -f flv "rtmp://example.com/live"
    &#xA;Theoretically, I could stream the WEBM to a file, transcode that to an MP4 file, and then transcode that to FLV/RTMP. Sounds awful.

    &#xA;

    • Pay for a service (Wowza, Flashphoner, api.video, etc)

    &#xA;

    Unfortunately precisely what I am trying to avoid.

    &#xA;

    • WebRTC to RTMP ?

    &#xA;

    WebRTC seems to be a peer-to-peer connection and doesn't play nicely with a server/client scenario.

    &#xA;

    • WebRTC to other ingest formats

    &#xA;

    Restreamer also supports incoming streams of HLS, DASH, RTP, RTSP, RTMP, and SRT. However, these all seem to be examples of network sources that would be exposed via an IP URL. I am not sure that FFmpeg can do that.

    &#xA;

    • Utilizing ffmpeg-wasm instead of CLI

    &#xA;

    Available here, I thought that maybe by using a browser implementation I may get different results. But no. Not even an error to the console.

    &#xA;

    • Streaming from OBS

    &#xA;

    For the record, yes, I have tried streaming from OBS instead of going through FFmpeg and the Restreamer platform itself does work for normal use. I use it often.

    &#xA;

    Post Script

    &#xA;

    I've not been able to find any relevant solutions online. I am shocked that streaming from a browser webcam has not been solved 1000 times prior. This is related to a question made 7 years ago but it was not resolved and Flash is no longer an option.

    &#xA;

    Recommendations

    &#xA;

    • Adding -c:v libx264 -flags:v &#x2B;global_header -c:a aac -ac 2 :

    &#xA;

    ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with gcc 12 (GCC)&#xA;  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags=&#x27;-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection&#x27; --extra-ldflags=&#x27;-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 &#x27; --extra-cflags=&#x27; -I/usr/include/rav1e&#x27; --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --enable-chromaprint --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libbs2b --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librav1e --enable-librtmp --enable-librubberband --enable-libsmbclient --enable-version3 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libglslang --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-avfilter --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libmfx --enable-runtime-cpudetect&#xA;  libavutil      57. 17.100 / 57. 17.100&#xA;  libavcodec     59. 18.100 / 59. 18.100&#xA;  libavformat    59. 16.100 / 59. 16.100&#xA;  libavdevice    59.  4.100 / 59.  4.100&#xA;  libavfilter     8. 24.100 /  8. 24.100&#xA;  libswscale      6.  4.100 /  6.  4.100&#xA;  libswresample   4.  3.100 /  4.  3.100&#xA;  libpostproc    56.  3.100 / 56.  3.100&#xA;Input #0, matroska,webm, from &#x27;/home/kyjus25/big-buck-bunny_trailer.webm&#x27;:&#xA;  Metadata:&#xA;    encoder         : http://sourceforge.net/projects/yamka&#xA;    creation_time   : 2010-05-20T08:21:12.000000Z&#xA;  Duration: 00:00:32.48, start: 0.000000, bitrate: 533 kb/s&#xA;  Stream #0:0(eng): Video: vp8, yuv420p(progressive), 640x360, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn (default)&#xA;  Stream #0:1(eng): Audio: vorbis, 44100 Hz, mono, fltp (default)&#xA;HandShake: client signature does not match!&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (vp8 (native) -> h264 (libx264))&#xA;  Stream #0:1 -> #0:1 (vorbis (native) -> aac (native))&#xA;Press [q] to stop, [?] for help&#xA;[libx264 @ 0x561564271fc0] using SAR=1/1&#xA;[libx264 @ 0x561564271fc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2&#xA;[libx264 @ 0x561564271fc0] profile High, level 3.0, 4:2:0, 8-bit&#xA;[libx264 @ 0x561564271fc0] 264 - core 163 r3060 5db6aa6 - 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=11 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&#xA;Output #0, flv, to &#x27;rtmp://example.com/live&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf59.16.100&#xA;  Stream #0:0(eng): Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv, bt470bg/unknown/unknown, progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 1k tbn (default)&#xA;    Metadata:&#xA;      encoder         : Lavc59.18.100 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A&#xA;  Stream #0:1(eng): Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 128 kb/s (default)&#xA;    Metadata:&#xA;      encoder         : Lavc59.18.100 aac&#xA;Larger timestamp than 24-bit: 0xffffff77kB time=00:00:30.18 bitrate= 460.0kbits/s speed=19.7x    &#xA;[flv @ 0x56156425e440] Failed to update header with correct duration.&#xA;[flv @ 0x56156425e440] Failed to update header with correct filesize.&#xA;frame=  812 fps=475 q=-1.0 Lsize=    1901kB time=00:00:32.52 bitrate= 479.0kbits/s speed=  19x    &#xA;video:1354kB audio:508kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.123872%&#xA;[libx264 @ 0x561564271fc0] frame I:21    Avg QP:15.05  size:  8839&#xA;[libx264 @ 0x561564271fc0] frame P:293   Avg QP:20.78  size:  3087&#xA;[libx264 @ 0x561564271fc0] frame B:498   Avg QP:22.20  size:   593&#xA;[libx264 @ 0x561564271fc0] consecutive B-frames: 14.7%  7.6%  9.2% 68.5%&#xA;[libx264 @ 0x561564271fc0] mb I  I16..4: 42.6% 41.9% 15.5%&#xA;[libx264 @ 0x561564271fc0] mb P  I16..4:  4.0%  8.0%  0.9%  P16..4: 22.7%  8.0%  4.0%  0.0%  0.0%    skip:52.4%&#xA;[libx264 @ 0x561564271fc0] mb B  I16..4:  1.4%  1.5%  0.2%  B16..8: 12.0%  1.0%  0.2%  direct: 3.3%  skip:80.5%  L0:44.1% L1:47.1% BI: 8.8%&#xA;[libx264 @ 0x561564271fc0] 8x8 transform intra:53.6% inter:57.0%&#xA;[libx264 @ 0x561564271fc0] coded y,uvDC,uvAC intra: 35.1% 37.7% 11.2% inter: 7.8% 9.5% 2.4%&#xA;[libx264 @ 0x561564271fc0] i16 v,h,dc,p: 56% 21% 14%  9%&#xA;[libx264 @ 0x561564271fc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 26% 21%  3%  3%  4%  4%  3%  4%&#xA;[libx264 @ 0x561564271fc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 21% 18%  4%  7%  7%  6%  5%  4%&#xA;[libx264 @ 0x561564271fc0] i8c dc,h,v,p: 62% 21% 15%  2%&#xA;[libx264 @ 0x561564271fc0] Weighted P-Frames: Y:20.8% UV:19.5%&#xA;[libx264 @ 0x561564271fc0] ref P L0: 70.3% 17.7%  9.0%  2.9%  0.0%&#xA;[libx264 @ 0x561564271fc0] ref B L0: 89.3%  8.9%  1.9%&#xA;[libx264 @ 0x561564271fc0] ref B L1: 96.4%  3.6%&#xA;[libx264 @ 0x561564271fc0] kb/s:341.30&#xA;[aac @ 0x561564223140] Qavg: 952.636&#xA;

    &#xA;

    Seems to complete successfully, but does so rather quickly. Log outputs a new Larger timestamp than 24-bit: 0xffffff77kB

    &#xA;

  • FFmpeg fails to draw text

    6 avril 2024, par Edoardo Balducci

    I've rarely used ffmpeg before, so, sorry If the question is too dumb.&#xA;I have a problem adding a text layer to a video frame using ffmpeg.

    &#xA;

    This is my current code :

    &#xA;

    import subprocess&#xA;from PyQt5.QtGui import QPixmap, QImage&#xA;from PyQt5.QtWidgets import QLabel&#xA;&#xA;class VideoThumbnailLabel(QLabel):&#xA;    def __init__(self, file_path, *args, **kwargs):&#xA;        super().__init__(*args, **kwargs)&#xA;        self.video = video&#xA;        video_duration = self.get_video_duration(file_path)&#xA;        thumbnail_path = self.get_thumbnail(file_path, video_duration)&#xA;        if thumbnail_path:&#xA;            self.setPixmap(QPixmap(thumbnail_path).scaled(160, 90, Qt.KeepAspectRatio))&#xA;        self.setToolTip(f"{video.title}\n{video.description}")&#xA;&#xA;    def get_video_duration(self, video_path):&#xA;        """Returns the duration of the video in seconds."""&#xA;        command = [&#xA;            &#x27;ffprobe&#x27;, &#x27;-v&#x27;, &#x27;error&#x27;, &#x27;-show_entries&#x27;,&#xA;            &#x27;format=duration&#x27;, &#x27;-of&#x27;,&#xA;            &#x27;default=noprint_wrappers=1:nokey=1&#x27;, video_path&#xA;        ]&#xA;        try:&#xA;            result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)&#xA;            if result.returncode != 0:&#xA;                print(f"ffprobe error: {result.stderr}")&#xA;                return 0&#xA;            duration = float(result.stdout)&#xA;            return int(duration)  # Returning duration as an integer for simplicity&#xA;        except Exception as e:&#xA;            print(f"Error getting video duration: {e}")&#xA;            return 0&#xA;&#xA;    def get_thumbnail(self, video_path, duration):&#xA;        """Generates a thumbnail with the video duration overlaid."""&#xA;        output_path = "thumbnail.jpg"  # Temporary thumbnail file&#xA;        duration_str = f"{duration // 3600:02d}:{(duration % 3600) // 60:02d}:{duration % 60:02d}"&#xA;        command = [&#xA;            &#x27;ffmpeg&#x27;, &#x27;-i&#x27;, video_path,&#xA;            &#x27;-ss&#x27;, &#x27;00:00:01&#x27;,  # Time to take the screenshot&#xA;            &#x27;-frames:v&#x27;, &#x27;1&#x27;,  # Number of frames to capture&#xA;            &#x27;-vf&#x27;, f"drawtext=text=&#x27;Duration: {duration_str}&#x27;:x=10:y=10:fontsize=24:fontcolor=white",&#xA;            &#x27;-q:v&#x27;, &#x27;2&#x27;,  # Output quality&#xA;            &#x27;-y&#x27;,  # Overwrite output files without asking&#xA;            output_path&#xA;        ]&#xA;        try:&#xA;            result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)&#xA;            if result.returncode != 0:&#xA;                print(f"ffmpeg error: {result.stderr}")&#xA;                return None&#xA;            return output_path&#xA;        except Exception as e:&#xA;            print(f"Error generating thumbnail with duration: {e}")&#xA;            return None&#xA;

    &#xA;

    and it is used like this :

    &#xA;

    for i, video in enumerate(self.videos):&#xA;    video_widget = VideoThumbnailLabel(video.file)&#xA;    video_widget.mousePressEvent = lambda event, v=video: self.onThumbnailClick(&#xA;        v&#xA;    )&#xA;    self.layout.addWidget(video_widget, i // 3, i % 3)&#xA;

    &#xA;

    I'm facing a problem where I am not able to get the thumbnail if I try to add the duration (I've tested it without the draw filter and worked fine)

    &#xA;

    I get this error (from the result.returncode) that I'm not able to comprehend :

    &#xA;

    ffmpeg error: b"ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers\n  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)\n  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1_4 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=&#x27;-Wl,-ld_classic&#x27; --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --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-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon\n  libavutil      58. 29.100 / 58. 29.100\n  libavcodec     60. 31.102 / 60. 31.102\n  libavformat    60. 16.100 / 60. 16.100\n  libavdevice    60.  3.100 / 60.  3.100\n  libavfilter     9. 12.100 /  9. 12.100\n  libswscale      7.  5.100 /  7.  5.100\n  libswresample   4. 12.100 /  4. 12.100\n  libpostproc    57.  3.100 / 57.  3.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;/Users/edoardo/Projects/work/test/BigBuckBunny.mp4&#x27;:\n  Metadata:\n    major_brand     : mp42\n    minor_version   : 0\n    compatible_brands: isomavc1mp42\n    creation_time   : 2010-01-10T08:29:06.000000Z\n  Duration: 00:09:56.47, start: 0.000000, bitrate: 2119 kb/s\n  Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)\n    Metadata:\n      creation_time   : 2010-01-10T08:29:06.000000Z\n      handler_name    : (C) 2007 Google Inc. v08.13.2007.\n      vendor_id       : [0][0][0][0]\n  Stream #0:1[0x2](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 1991 kb/s, 24 fps, 24 tbr, 24k tbn (default)\n    Metadata:\n      creation_time   : 2010-01-10T08:29:06.000000Z\n      handler_name    : (C) 2007 Google Inc. v08.13.2007.\n      vendor_id       : [0][0][0][0]\n[Parsed_drawtext_0 @ 0x60000331cd10] Both text and text file provided. Please provide only one\n[AVFilterGraph @ 0x600002018000] Error initializing filters\n[vost#0:0/mjpeg @ 0x13ce0c7e0] Error initializing a simple filtergraph\nError opening output file thumbnail.jpg.\nError opening output files: Invalid argument\n"&#xA;

    &#xA;

    I've installed both ffmpeg and ffmprobe in my machine :

    &#xA;

    ┌(edoardomacbook-air)-[~/Projects/work/tests-scripts]                                                                                                                                   &#xA;└─ $ ffmpeg -version &amp;&amp; ffprobe -version                                                                                                                                                              2 ⚙ &#xA;ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers&#xA;built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1_4 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=&#x27;-Wl,-ld_classic&#x27; --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --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-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon&#xA;libavutil      58. 29.100 / 58. 29.100&#xA;libavcodec     60. 31.102 / 60. 31.102&#xA;libavformat    60. 16.100 / 60. 16.100&#xA;libavdevice    60.  3.100 / 60.  3.100&#xA;libavfilter     9. 12.100 /  9. 12.100&#xA;libswscale      7.  5.100 /  7.  5.100&#xA;libswresample   4. 12.100 /  4. 12.100&#xA;libpostproc    57.  3.100 / 57.  3.100&#xA;ffprobe version 6.1.1 Copyright (c) 2007-2023 the FFmpeg developers&#xA;built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1_4 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=&#x27;-Wl,-ld_classic&#x27; --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --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-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon&#xA;libavutil      58. 29.100 / 58. 29.100&#xA;libavcodec     60. 31.102 / 60. 31.102&#xA;libavformat    60. 16.100 / 60. 16.100&#xA;libavdevice    60.  3.100 / 60.  3.100&#xA;libavfilter     9. 12.100 /  9. 12.100&#xA;libswscale      7.  5.100 /  7.  5.100&#xA;libswresample   4. 12.100 /  4. 12.100&#xA;libpostproc    57.  3.100 / 57.  3.100&#xA;

    &#xA;

    Does anyone see the problem ?

    &#xA;


    &#xA;

    P.S. : I know that I havent provided a minimal reproducible example, but since I don't know where the problem lies I didn't want to exclude anything

    &#xA;