Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (38)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Changer son thème graphique

    22 février 2011, par

    Le thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
    Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
    Modifier le thème graphique utilisé
    Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
    Il suffit ensuite de se rendre dans l’espace de configuration du (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (7314)

  • Display stream with FFmpeg, python and opencv

    23 février, par Ηλίας Κωνσταντινίδης

    Situation :
I have a basler camera connected to a raspberry pi, and I am trying to livestream it's feed with FFmpg to a tcp port in my windows PC in order to monitor whats happening in front of the camera.

    


    Things that work :
I manage to set up a python script on the raspberry pi which is responsible for recording the frames, feed them to a pipe and streaming them to a tcp port. From that port, I am able to display the stream using FFplay.

    


    My problem :
FFplay is great for testing out quickly and easily if the direction you are heading is correct, but I want to "read" every frame from the stream, do some processing and then displaying the stream with opencv. That, I am not able to do yet.

    


    Minimaly reprsented, that's the code I use on the raspberry pi side of things :

    


    command = ['ffmpeg',
           '-y',
           '-i', '-',
           '-an',
           '-c:v', 'mpeg4',
           '-r', '50',
           '-f', 'rtsp',
           '-rtsp_transport',
           'tcp','rtsp://192.168.1.xxxx:5555/live.sdp']

p = subprocess.Popen(command, stdin=subprocess.PIPE) 

while camera.IsGrabbing():  # send images as stream until Ctrl-C
    grabResult = camera.RetrieveResult(100, pylon.TimeoutHandling_ThrowException)
    
    if grabResult.GrabSucceeded():
        image = grabResult.Array
        image = resize_compress(image)
        p.stdin.write(image)
    grabResult.Release() 



    


    On my PC if I use the following FFplay command on a terminal, it works and it displays the stream in real time :

    


    ffplay -rtsp_flags listen rtsp://192.168.1.xxxx:5555/live.sdp?tcp

    


    On my PC if I use the following python script, the stream begins, but it fails in the cv2.imshow function because I am not sure how to decode it :

    


    import subprocess
import cv2

command = ['C:/ffmpeg/bin/ffmpeg.exe',
           '-rtsp_flags', 'listen',
           '-i', 'rtsp://192.168.1.xxxx:5555/live.sdp?tcp?', 
           '-']

p1 = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)

while True:
    frame = p1.stdout.read()
    cv2.imshow('image', frame)
    cv2.waitKey(1)


    


    Does anyone knows what I need to change in either of those scripts in order to get i to work ?

    


    Thank you in advance for any tips.

    


  • Trying to get frame timestamp with ffmpeg from a RTSP camera

    12 juin 2022, par jaygzixst

    I'm trying to retrieve the timestamp of each frame of a camera using an rstp stream and them.
For recording I use the following command line and it's work :

    


    ffmpeg
-correct_ts_overflow 0
-probesize 1G
-analyzeduration 1G
-i rtsp://user:password@ip:port
-vcodec copy
-bsf:v h264_mp4toannexb
-bufsize 10M
-acodec copy
-f ssegment
-segment_list_flags live
-segment_atclocktime 1
-reset_timestamps 1
-write_empty_segments 1
-segment_time 15
-segment_list C:\Video\Delivery\ffmpeg\list.video
-segment_list_type csv
-strftime 1 "C:\Video\Delivery\ffmpeg\%%Y%%m%%d_%%H-%%M-%%S.ts"


    


    And for some utility I would like to be able to retrieve the timestamp of the machine when I receive a frame, so by searching a bit I found different post on '-mkvtimestamp_v2'. By trying it alone with the camera as if below :

    


    ffmpeg
-copyts ^
-correct_ts_overflow 0 ^
-probesize 1G ^
-analyzeduration 1G ^
-i rtsp://user:password@ip:port
-c copy
-pix_fmt yuv420p
-flush_packets 1
-vframes 10
-reset_timestamps 1
-timestamp now
-copyts
-f mkvtimestamp_v2 timestamp.txt
-vsync 0


    


    It works perfectly.

    


    But from the moment I try to record AND try to retrieve the timestamp simultaneously with the following command :

    


    ffmpeg
-use_wallclock_as_timestamps 1
-correct_ts_overflow 0
-probesize 1G
-analyzeduration 1G
-i rtsp://user:password@ip:port
-vcodec copy
-bsf:v h264_mp4toannexb
-bufsize 10M
-acodec copy
-f ssegment
-segment_list_flags live
-segment_atclocktime 1
-reset_timestamps 1
-write_empty_segments 1
-segment_time 15
-segment_list C:\Video\Delivery\ffmpeg\list.video
-segment_list_type csv
-strftime 1 "C:\Video\Delivery\ffmpeg\%%Y%%m%%d_%%H-%%M-%%S.ts"
-copyts
-vcodec copy
-flush_packets 1
-f mkvtimestamp_v2 log.txt
-vsync 0


    


    I get a lot of : Non-monotonous DTS in output stream 0:0 warning.
I also have on average one minute delay between the recorded timestamps, and the real timestamp.
And the first video recorded have a bugged timer on a video player like this : Here

    


    I've tried arranging the command in different orders but I get nothing conclusive...

    


    So if you have any idea that would be a big help !

    


    I work on Windows 10 and I use ffmpeg-3.4.1.

    


    Cordially,

    


    Jay

    


  • How to stream text and video at the same time ?

    27 octobre 2020, par Mehmet Ali

    I have node.js server that uses node-media-server :

    


    const NodeMediaServer = require('node-media-server');
const config = {
  rtmp: {
    port: 1935,
    chunk_size: 60000,
    gop_cache: true,
    ping: 30,
    ping_timeout: 60
  },
  http: {
    port: 8000,
    allow_origin: '*'
  }
};
 
var nms = new NodeMediaServer(config)
nms.run();


    


    I also have a video that I stream from my computer like this :

    


    ffmpeg -re -i video.mp4 -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/STREAM_NAME


    


    On HTML, I can watch video :

    


    <code class="echappe-js">&lt;script src=&quot;https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js&quot;&gt;&lt;/script&gt;&#xA;&#xA;&lt;script&gt;&amp;#xA;    if (flvjs.isSupported()) {&amp;#xA;        var videoElement = document.getElementById(&amp;#x27;videoElement&amp;#x27;);&amp;#xA;        var flvPlayer = flvjs.createPlayer({&amp;#xA;            type: &amp;#x27;flv&amp;#x27;,&amp;#xA;            url: &amp;#x27;http://localhost:8000/live/STREAM_NAME.flv&amp;#x27;&amp;#xA;        });&amp;#xA;        flvPlayer.attachMediaElement(videoElement);&amp;#xA;        flvPlayer.load();&amp;#xA;        flvPlayer.play();&amp;#xA;    }&amp;#xA;&lt;/script&gt;&#xA;

    &#xA;

    That's OK but I want to add some texts inside this stream like subtitles (but they are actually not subtitles instead random texts) and want to access this data from HTML or Javascript. How can I do that ? I cannot setup another server to just send data since synchronization problems may happen.

    &#xA;