Recherche avancée

Médias (0)

Mot : - Tags -/logo

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

Autres articles (69)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (8427)

  • How to add BGM when pipe opencv images to ffmpeg - python

    23 mars 2020, par karobben

    Basically, I know how to stream by Pipe opencv to ffmpeg using python.
    But my problem is I can’t add an audio file (BGM) for it. Does anyone know how to make it with python ?

    my python code is :

    import cv2 as cv
    import subprocess as sp

    # ffmpeg command

    command = ['ffmpeg',
           #'-re', '-stream_loop', '-1',
           #'-i', '/home/pi/scrpt/Blive/StarBucks_BGN.mp3',
           '-y',
           '-f', 'rawvideo',
           '-vcodec','rawvideo',
           '-pix_fmt', 'bgr24',
           '-s', "{}x{}".format(width, height),
           '-r', str(fps),
           '-i', '-',
           '-c:v', 'libx264',
           '-pix_fmt', 'yuv420p',
           '-preset', 'ultrafast',
           '-f', 'flv',
           rtmpUrl]

    I know that I can achieve this by :

    sudo raspivid -o - -t 0 -w 1280 -h 720 -fps 24 -b 1000000 |
                   ffmpeg  -re -stream_loop -1 -i  "/home/pi/scrpt/Blive/StarBucks_BGN.mp3" \
           -f h264 -i - -vcodec copy -r 30 -acodec aac -b:a 100k -preset ultrafast \
           -tune zerolatency -f flv "rtmp://"

    So, I tried to add -re -stream_loop -1 -i  "/home/pi/scrpt/Blive/StarBucks_BGN.mp3" into the python pipe, but it crashed with :

    [libx264 @ 0x1952aa0] using cpu capabilities: ARMv6 NEON
    [libx264 @ 0x1952aa0] profile Constrained Baseline, level 3.1
    [libx264 @ 0x1952aa0] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
    [flv @ 0x1951d00] FLV does not support sample rate 48000, choose from (44100, 22050, 11025)
    [flv @ 0x1951d00] Audio codec mp3 not compatible with flv
    Could not write header for output file #0 (incorrect codec parameters ?): Function not implementedStream mapping:
     Stream #1:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
     Stream #0:0 -> #0:1 (mp3 (native) -> mp3 (libmp3lame))
       Last message repeated 1 times
    Traceback (most recent call last):
     File "With_BG.py", line 57, in <module>
       p.stdin.write(BG.tostring())
    BrokenPipeError: [Errno 32] Broken pipe
    </module>
  • How to pipe rawvideo to v4l2loopback using ffmpeg ?

    3 août 2020, par sepehr78

    I am trying to process a video by OpenCV in Python and then send each frame to a virtual camera (i.e., v4l2loopback). I have seen questions asked where OpenCV output is piped to ffmpeg and saved into a file, and other questions where a video file is piped to v4l2 using ffmpeg, but no question where these two are combined. I can do either of the above two things on their own, but not combined.

    &#xA;&#xA;

    My Python code uses a subprocess to pipe each frame to ffmpeg. The ffmpeg command for piping the output of OpenCV to an .mp4 file is

    &#xA;&#xA;

    ffmpeg -y -f rawvideo -vcodec rawvideo -s 1280x720 -pix_fmt bgr24 -i - -vcodec libx264 -crf 0 -preset fast output.mp4&#xA;

    &#xA;&#xA;

    This works and I have tested it.

    &#xA;&#xA;

    The ffmpeg command to pipe a video file to the v4l2 virtual camera is

    &#xA;&#xA;

    ffmpeg -re -i input.mp4 -map 0:v -f v4l2 /dev/video0&#xA;

    &#xA;&#xA;

    This also works and I have tested it.

    &#xA;&#xA;

    I tried combining the above two commands and came up with

    &#xA;&#xA;

    ffmpeg -y -f rawvideo -vcodec rawvideo -s 1280x720 -pix_fmt bgr24 -i - -vcodec libx264 -crf 0 -preset fast -map 0:v -f v4l2 /dev/video0&#xA;

    &#xA;&#xA;

    but I get the following error

    &#xA;&#xA;

    &#xA;

    [NULL @ 0x55a12fcc60] Unable to find a suitable output format for ''&#xA; : Invalid argument

    &#xA;

    &#xA;&#xA;

    I would be glad if anyone could help me figure this out.

    &#xA;&#xA;

    Thanks.

    &#xA;

  • How to pipe frames in stdout using FFMPEG and Golang

    6 avril 2020, par Sven.DG

    I am fairly new to Golang, my goal is to build a script in Golang that :

    &#xA;&#xA;

      &#xA;
    1. Transcodes the video input .MOV file into frames, using FFMPEG
    2. &#xA;

    3. Some downstream process that does something with the emitted frames.
    4. &#xA;

    &#xA;&#xA;

    Currently I have the following code as a first attempt :

    &#xA;&#xA;

    package main&#xA;&#xA;import (&#xA;    "fmt"&#xA;    "os/exec"&#xA;    "strconv"&#xA;    "io"&#xA;)&#xA;&#xA;const (&#xA;    frameX      = 240&#xA;    frameY      = 135&#xA;    frameSize   = frameX * frameY * 3&#xA;)&#xA;&#xA;func main() {&#xA;    ffmpeg := exec.Command("ffmpeg", "-i", "project/data/sample.mov", "-vf",  "fps=fps=1/2", "-s", strconv.Itoa(frameX)&#x2B;"x"&#x2B;strconv.Itoa(frameY), "-f", "rawvideo", "pipe:1") //nolint&#xA;    ffmpegOut, _ := ffmpeg.StdoutPipe()&#xA;&#xA;    if err := ffmpeg.Start(); err != nil {&#xA;        panic(err)&#xA;    }&#xA;&#xA;    reader(ffmpegOut)&#xA;    fmt.Println("Completed. YAY")&#xA;}&#xA;&#xA;func reader(ffmpegOut io.Reader) {&#xA;    buf := make([]byte, frameSize)&#xA;    fmt.Println("Looping..")&#xA;    counter := 0&#xA;    for {&#xA;        if _, err := io.ReadFull(ffmpegOut, buf); err != nil {&#xA;            // fmt.Println(err)&#xA;        }&#xA;        if buf[0] != 0 {&#xA;            fmt.Println("Got a frame!!")&#xA;            counter&#x2B;&#x2B;&#xA;            fmt.Println(counter)&#xA;        }&#xA;    }&#xA;    fmt.Println("total amount of frames", counter)&#xA;}&#xA;

    &#xA;&#xA;

    This is mainly based on this example : https://github.com/pion/example-webrtc-applications/blob/master/gocv-receive/main.go

    &#xA;&#xA;

    However, when running this code, it appears that I'm getting an endless amount of data in my downstream reader. I would expect that the counter equals the amount of frames but that is clearly not the case looking at the rate at which the counter increases, so obviously I am doing something wrong. Can anybody point me in the right direction ?

    &#xA;&#xA;

    I used the sample .mov file with 1280 x 720 resolution here : https://file-examples.com/index.php/sample-video-files/sample-mov-files-download/.&#xA;The video is about 31 seconds so I would expect to see 15 frames downstream in the reader.

    &#xA;&#xA;

    Cheers !

    &#xA;