Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (42)

Sur d’autres sites (7783)

  • Thumbnail generation using golang+ffmpeg

    23 avril 2024, par godvlpr

    I try to generate thumbnail from video mp4 using Golang+ffmpeg.

    


    Let me provide some steps :

    


      

    1. Tried to generate using terminal ffmpeg -i test.mp4 -ss 00:00:00 -vframes 1 thumbnail.jpg - all works successfully
    2. 


    3. Tried to generate from golang and put result into stdout   cmd := exec.Command("ffmpeg", "-i", "test.mp4", "-ss", "00:00:00", "-vframes", "1", "-f", "image2pipe", "-") - all works successfully
    4. 


    5. Trying to open video using os.ReadFile and bytes.NewReader and after that -   cmd := exec.Command("ffmpeg", "-i", "pipe:", "-ss", "00:00:00", "-vframes", "1", "-f", "image2pipe", "-") And in this step I have an error.
Below provided all code and na error
    6. 


    


        r, err := os.ReadFile("test.mp4")
    if err != nil {
        log.Fatalf("Failed to read video file: %v", err)
    }
    
    videoBuffer := bytes.NewReader(r)

    cmd := exec.Command("ffmpeg", "-i", "pipe:", "-ss", "00:00:00", "-vframes", "1", "-f", "image2pipe", "-")

    cmd.Stdin = videoBuffer

    // Capture output as bytes
    var out bytes.Buffer
    cmd.Stdout = &out

    var stderr bytes.Buffer
    cmd.Stderr = &stderr

    // Run the command
    err = cmd.Run()
    if err != nil {
        log.Fatalf("ffmpeg command failed: %v, stderr: %s", err, stderr.String())
    }

    // Convert bytes to image.Image
    img, _, err := image.Decode(&out)
    if err != nil {
        log.Fatalf("Failed to decode thumbnail: %v", err)
    }


    


    Error

    


    2024/04/23 13:25:51 ffmpeg command failed: exit status 183, stderr: ffmpeg version 7.0 Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 15.0.0 (clang-1500.3.9.4)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --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
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x136504080] stream 0, offset 0x30: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x136504080] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1920x1080, 3496 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.100
  Duration: 00:00:02.01, start: 0.000000, bitrate: N/A
  Stream #0:0[0x1](und): Video: h264 (avc1 / 0x31637661), none, 1920x1080, 3496 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x136504080] stream 0, offset 0x30: partial file
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x600001134000] Error during demuxing: Invalid data found when processing input
Cannot determine format of input 0:0 after EOF
[vf#0:0 @ 0x600001f2c000] Task finished with error code: -1094995529 (Invalid data found when processing input)
[vf#0:0 @ 0x600001f2c000] Terminating thread with return code -1094995529 (Invalid data found when processing input)
[vost#0:0/mjpeg @ 0x104a04650] Could not open encoder before EOF
[vost#0:0/mjpeg @ 0x104a04650] Task finished with error code: -22 (Invalid argument)
[vost#0:0/mjpeg @ 0x104a04650] Terminating thread with return code -22 (Invalid argument)
[out#0/image2pipe @ 0x60000182c000] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A    
Conversion failed!


    


    Also tried to do something like this cmd := exec.Command("ffmpeg", "-analyzeduration", "10000M", "-probesize", "10000M", "-i", "pipe:", "-ss", "00:00:00", "-vframes", "1", "-f", "image2pipe", "-") - and had the same error (almost the same).

    


    How to fix code or ffmpeg command - to bring this code workable ?

    


  • Nginx - RTMP module - VLC wont start

    15 janvier, par Diana Sari

    Why my vlc only show background colour ?
did i miss something important ?

    


    Im running Nginx with RTMP module on
Linux DESKTOP-RJHVE83 5.15.167.4-microsoft-standard-WSL2 #1 SMP x86_64 GNU/Linux
Kali release : 2024.4 (kali-rolling) WSL on Windows 10 Pro

    


    Screenshot of my VLC

    


    /etc/nginx/nginx.conf
i add this from the default :

    


    rtmp {
    server {
        listen 1935;
        chunk_size 4096;
  allow publish 127.0.0.1;
  deny publish all;

        application live {
            live on;
            record off;
        push rtmp://127.0.0.1/live/stream;
        }
    }
}


    


    Stream my mp4 file using ffmpeg :

    


    


    Kali$> ffmpeg -re -i file.mp4 -c:v libx264 -c:a aac -flvflags no_duration_filesize -f flv rtmp ://localhost:1935/live/

    


    


    VLC on the same machine on WIndows 10 Pro
Open Network Protocol : rtmp ://192.168.1.1:1935/live/

    


    The Vlc Show only Background colour (attach)

    


    -Access.log
172.27.96.1 [14/Jan/2025:14:28:02 +0700] PLAY "live" "" "" - 556 1612142 "" "LNX 9,0,124,2" (25s)
127.0.0.1 [14/Jan/2025:14:28:34 +0700] PUBLISH "live" "" "" - 4573293 529 "" "FMLE/3.0 (compatible ; Lavf61.7." (1m 3s)
172.27.96.1 [14/Jan/2025:14:29:47 +0700] PLAY "live" "" "" - 365 1578527 "" "LNX 9,0,124,2" (1m 43s)

    


    -Error.log
Blank

    


    i tried this on :
Ubuntu Focal 20.04.6 (WSL)
Ubuntu Noble24.04.1 LTS (WSL)
id read 2 tutorials
https://www.hostinger.com/tutorials/how-to-set-up-a-streaming-server
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-video-streaming-server-using-nginx-rtmp-on-ubuntu-20-04

    


  • Introducing Updates to the Funnels Feature

    29 mai 2024, par Erin

    We’ve made improvements to the Funnels feature to be more user-friendly and offer you greater flexibility. 

    &lt;script type=&quot;text/javascript&quot;&gt;<br />
           if ('function' === typeof window.playMatomoVideo){<br />
           window.playMatomoVideo(&quot;FunnelsProductUpdate2024&quot;, &quot;#FunnelsProductUpdate2024&quot;)<br />
           } else {<br />
           document.addEventListener(&quot;DOMContentLoaded&quot;, function() { window.playMatomoVideo(&quot;FunnelsProductUpdate2024&quot;, &quot;#FunnelsProductUpdate2024&quot;); });<br />
           }<br />
      &lt;/script&gt;

    Here’s what’s changing :

    Setting up and managing funnels is now easier than ever 

    Previously, creating funnels was tedious and required going through the Goals feature. But we’ve changed that with the introduction of a separate page to configure funnels. 

    Dedicated Manage Funnels page in Matomo

    Create funnels with greater flexibility—no longer tied to goals 

    Funnels is now a standalone feature, providing you with more flexibility. Before, you could only create a funnel if it was tied to a goal, in other words, the final step in the funnel had to be a goal. What’s more, you also couldn’t use goals for steps in the funnel.  

    Previous configuration requirements of Funnels in Matomo
    Previous configuration requirements of Funnels

    Now, funnels are independent of goals, and goals can serve as steps within the funnel. This means you have the freedom to configure any combination of steps in a funnel : 

    • All steps can be goals 
    • No steps need to be goals 
    • Or some steps can be goals, some steps can be events 
    Goals no longer required in Matomo Funnels

    No matter what your customer journey looks like, funnels now offer the versatility to meet your business’s specific needs. 

    Find friction points faster with intuitive visuals 

    One of the most significant improvements is the visual upgrade of the Funnels feature. The new Funnels graph is now visually in line with industry standards and intuitive. 

    New Funnel Analytics chart in Matomo

    The new visual provides a clearer view of your drop-off and conversion rates so you can instantly find points of friction in your funnel to improve the user experience and overall conversion rate.  

    This visualisation also provides a detailed overview of the number of visitors who enter, exit, skip, or proceed at each step of your funnel by using different coloured bars for visual clarity on each step’s performance. 

    With this update, we’ve also replaced ‘backfilled visits’ with ‘skipped steps’ to avoid misinterpretation of the data. 

    New data table for more granular insights 

    Accompanying this visual improvement is a new data table, allowing for more granular insights, segment comparison, and easy data export.

    We’ve also increased Funnel analysis limits. You can now compare funnel data for 2 date periods and 6 segments (up to 12 compared datasets in total). 

    Sign up for our newsletter to receive all the latest Matomo updates.