Recherche avancée

Médias (91)

Autres articles (64)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (9243)

  • ffmgep stucks while merging two streams at input 0 [closed]

    3 février 2024, par Robi Tagore

    I tried to merge two streams downloaded before, I was using ffmpeg to combine them. I could use the path directly, but I felt it would'nt always be, so I read the steams, after I combine them,
everytime I run the code it std errs the following output, and creates merged.mp4 with 0 bytes, help me find the mistake

    


    code

    


    
const {spawn} = require("child_process");
const fs = require("fs")


var audio = fs.createReadStream("audio.aac")
var video = fs.createReadStream("video.mp4")



var ffprocess = spawn("ffmpeg",[
    '-y',
    '-i', 'pipe:0', 
    '-i', 'pipe:1',  
    '-c', 'copy',  
    '-f', 'mp4',    
    'pipe:2',   
])

video.pipe(ffprocess.stdin)
audio.pipe(ffprocess.stdin)


ffprocess.stdout.on("data")


ffprocess.stderr.on("data", (data) => {
    console.log(`ffmpeg stderr ${data}`);
});
  
ffprocess.on("close", (code) => {
if (code === 0) {
    console.log("FFmpeg process exited successfully");
} else {
    console.error(`FFmpeg process exited with code ${code}`);
}
});


    


    output,

    


    ffmpeg stderr ffmpeg version 6.0-6ubuntu1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.2.0-2ubuntu1)
  configuration: --prefix=/usr --extra-version=6ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libvpl --disable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  libavutil      58.  2.100 / 58.  2.100

ffmpeg stderr   libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100

ffmpeg stderr Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:0':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2023-07-31T07:06:25.000000Z
  Duration: 00:00:34.64, start: 0.000000, bitrate: N/A

ffmpeg stderr   Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 334 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      creation_time   : 2023-07-31T07:06:25.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 07/31/2023.
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2023-07-31T07:06:25.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 07/31/2023.
      vendor_id       : [0][0][0][0]



    


    audio.aac video.mp4 sits in the same directory

    


    I have trying changing the -c flag and the other ones, but it somehow stucks and program dosent end up

    


    I have trying changing the -c flag and the other ones, but it somehow stucks and program dosent end up

    


  • Using aler9/rtsp-simple-server, able to stream HLS from file but not from ffmpeg's stdin

    11 avril 2023, par Powercoder

    UPD : hehe, it actially works, but in chrome, not mozilla

    


    I want to display programmatically generated stream on a webpage in real time. For this I have rtsp-simple-server with RTSP and HLS enabled. I managed to publish a stream from file with command ffmpeg -re -stream_loop -1 -i file.mp4 -vcodec libx264 -f rtsp -rtsp_transport tcp rtsp://localhost:8554/mystream and see it at http://localhost:8888/mystream.

    


    But when I'm trying to do the same with python from the ffmpeg's stdin, I'm getting infinitely loading video instead of stream and browser console says "Uncaught (in promise) DOMException : The fetching process for the media resource was aborted by the user agent at the user's request". Here is my code :

    


    import random
import shlex
import subprocess
import time

import numpy as np


def main():
    width = 1024
    height = 720
    framerate = 1
    frame_duration = 1 / framerate
    cmd = shlex.split(
        f'ffmpeg'
        f' -y'
        f' -f rawvideo'
        f' -vcodec rawvideo'
        f' -s {width}x{height}'
        f' -pix_fmt bgr24'
        f' -r {framerate}'
        f' -i -'
        f' -r {framerate}'
        f' -force_key_frames expr:eq(mod(n,3),0)'
        f' -vcodec libx264'
        f' -crf 18'
        f' -preset ultrafast'
        f' -tune zerolatency'
        f' -f rtsp'
        f' -rtsp_transport tcp'
        f' rtsp://localhost:8554/mystream'
    )
    ffmpeg_process = subprocess.Popen(cmd, stdin=subprocess.PIPE)
    try:
        while True:
            image = np.full(
                (height, width, 3),
                (
                    random.randint(0, 255),
                    random.randint(0, 255),
                    random.randint(0, 255),
                ),
                dtype=np.uint8,
            )
            ffmpeg_process.stdin.write(image.tobytes())
            time.sleep(frame_duration)
    finally:
        ffmpeg_process.stdin.close()
        ffmpeg_process.wait()


if __name__ == '__main__':
    main()



    


    In the server's logs seems like no bad messages instead of single 404 status (is it just about favicon, right ?)

    


    2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] GET /mystream/
2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [c->s] GET /mystream/ HTTP/1.1
Host: localhost:8888
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: ru,en-US;q=0.7,en;q=0.3
Connection: keep-alive
Cookie: csrftoken=iRZDO5rsJzhh5peyyKhViN9yRslNQbuZ; Webstorm-713207de=ca4f5f1e-40e8-4bfd-97da-1be2f15f6e9e
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: cross-site
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0


2023/03/25 13:50:32 INF [HLS] [muxer mystream] created (requested by 172.18.0.1)
2023/03/25 13:50:32 INF [HLS] [muxer mystream] is converting into HLS, 1 track (H264)
2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [s->c] HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: text/html
Server: rtsp-simple-server

(body of 1240 bytes)
2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] GET /favicon.ico
2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [c->s] GET /favicon.ico HTTP/1.1
Host: localhost:8888
Accept: image/avif,image/webp,*/*
Accept-Encoding: gzip, deflate, br
Accept-Language: ru,en-US;q=0.7,en;q=0.3
Connection: keep-alive
Cookie: csrftoken=iRZDO5rsJzhh5peyyKhViN9yRslNQbuZ; Webstorm-713207de=ca4f5f1e-40e8-4bfd-97da-1be2f15f6e9e
Referer: http://localhost:8888/mystream/
Sec-Fetch-Dest: image
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0


2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [s->c] HTTP/1.1 404 Not Found
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Server: rtsp-simple-server


2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] GET /mystream/index.m3u8
2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [c->s] GET /mystream/index.m3u8 HTTP/1.1
Host: localhost:8888
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: ru,en-US;q=0.7,en;q=0.3
Connection: keep-alive
Cookie: csrftoken=iRZDO5rsJzhh5peyyKhViN9yRslNQbuZ; Webstorm-713207de=ca4f5f1e-40e8-4bfd-97da-1be2f15f6e9e
Referer: http://localhost:8888/mystream/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0


2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [s->c] HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/x-mpegURL
Server: rtsp-simple-server

(body of 122 bytes)
2023/03/25 13:50:34 DEB [HLS] [conn 172.18.0.1] GET /mystream/index.m3u8
2023/03/25 13:50:34 DEB [HLS] [conn 172.18.0.1] [c->s] GET /mystream/index.m3u8 HTTP/1.1
Host: localhost:8888
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: ru,en-US;q=0.7,en;q=0.3
Connection: keep-alive
Cookie: csrftoken=iRZDO5rsJzhh5peyyKhViN9yRslNQbuZ; Webstorm-713207de=ca4f5f1e-40e8-4bfd-97da-1be2f15f6e9e
Referer: http://localhost:8888/mystream/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0


2023/03/25 13:50:34 DEB [HLS] [conn 172.18.0.1] [s->c] HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/x-mpegURL
Server: rtsp-simple-server

(body of 122 bytes)
2023/03/25 13:50:36 DEB [HLS] [conn 172.18.0.1] GET /mystream/index.m3u8
2023/03/25 13:50:36 DEB [HLS] [conn 172.18.0.1] [c->s] GET /mystream/index.m3u8 HTTP/1.1
Host: localhost:8888
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: ru,en-US;q=0.7,en;q=0.3
Connection: keep-alive
Cookie: csrftoken=iRZDO5rsJzhh5peyyKhViN9yRslNQbuZ; Webstorm-713207de=ca4f5f1e-40e8-4bfd-97da-1be2f15f6e9e
Referer: http://localhost:8888/mystream/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0


2023/03/25 13:50:36 DEB [HLS] [conn 172.18.0.1] [s->c] HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/x-mpegURL
Server: rtsp-simple-server

(body of 122 bytes)



    


    How do I get my stream from python visible on a webpage ?

    


  • Rotating gyro data in gopro footage with ffpmeg

    2 juillet 2023, par FPV Shenanigans

    I believe orientation of gyro data in some of my gopro clips is wrong. Reelsteady runs stabilization ok but it results in even worse than initial video shaky effect. I have filmed with gopro in 90 degree with orientation locked .

    


    Is it possible to amend metadata if ffmpeg to fix this ?

    


    the below is an example clip

    


    Metadata :
major_brand : isom
minor_version : 512
compatible_brands : isomiso2mp41
encoder : Lavf60.10.100
Duration : 00:04:30.22, start : 0.000000, bitrate : 119132 kb/s
Stream #0:00x1 : Video : hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(pc, bt709), 3840x3360 [SAR 1:1 DAR 8:7], 118934 kb/s, 59.94 fps, 59.94 tbr, 60k tbn (default)
Metadata :
handler_name : GoPro H.265
vendor_id : [0][0][0][0]
encoder : GoPro H.265 encoder
timecode : 13:27:43:05
Side data :
displaymatrix : rotation of -90.00 degrees
Stream #0:10x2 : Audio : aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
Metadata :
handler_name : GoPro AAC
vendor_id : [0][0][0][0]
Stream #0:20x3 : Data : none (tmcd / 0x64636D74)
Metadata :
handler_name : GoPro H.265
timecode : 13:27:43:05

    


    tried this

    


    ffmpeg.exe -i "F :\2023 THE ONLY COPY\Chasing surfers\GX010223.MP4" -c copy -metadata:s:v rotate=90 "F :\2023 THE ONLY COPY\Chasing surfers\GX010223_test.mp4"

    


    but reelsteady can't read metadata from a new video