Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (76)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

Sur d’autres sites (2940)

  • Best way to diagnose VideoCapture not opening the rtmp stream

    8 janvier 2021, par Greg0ry

    I am pulling my hair off for a few days and I'm out of ideas.

    


    I have two rtmp streams

    


      

    • first stream is transcoded directly by myself (I use ffmpeg to transcode) and then I attach to that stream with opencv - VideoCapture can open the stream with no problem
    • 


    • second stream is transcoded by 3rd party system (this system captures video through WebRTC and then encodes to h264) - this stream cannot be opened by VideCapture no matter what I do
    • 


    


    I can attach with pure ffmpeg to that dodgy stream and I can restream - but this is not ideal as introduces extra network traffic and latency.

    


    I was playing with OPENCV_FFMPEG_CAPTURE_OPTIONS environmental variable (I was trying to remove audio stream, change the video codec, playing with rtmp options like this OPENCV_FFMPEG_CAPTURE_OPTIONS="loglevel;debug" python my_script.py) - no joy

    


    So I figured I am trying to solve this problem from wrong end. I should somehow collect underlying ffmpeg logs that should be available when calling VideoCapture. So I tried to set OPENCV_FFMPEG_CAPTURE_OPTIONS="v;debug" but I can see no ffmpeg output when calling VideoCapture.

    


    This is very simple python3 script I was using during tests :

    


    import cv2 as cv
dodgy_cap = cv.VideoCapture()
dodgy_cap.open('rtmp://my_local_ip_address/rtmp/dodgy_stream_name')
print(dodgy_cap.isOpened())  # always returns False
healthy_cap = cv.VideoCapture()
healthy_cap.open('rtmp://my_local_ip_address/rtmp/healthy_stream_name')
print(healthy_cap.isOpened())  # always returns True


    


    I collected information about both streams with ffprobe, but even though they look different I cannot see what would be the difference that prevents opencv from opening VideoCapture for dodgy stream..

    


    This is a fragment from (very) verbose log for healthy stream :

    


    RTMP_ClientPacket, received: notify 254 bytes                                                                                                                                                                                               
(object begin)                                                                                                                                                                                                                              
Property:                                                                                                                                                                                  
Property:                                                                                                                                                                                             
(object begin)                                                                                                                                                                                                                              
Property:                                                                                                                                                                                        
Property:                                                                                                                                                                                     
Property:                                                                                                                                                                                     
Property:                                                                                                                                                                                        
Property:                                                                                                                                                                                        
Property:                                                                                                                                                                                        
Property:                                                                                                                                                               
Property:                                                                                                                                                                         
Property:                                                                                                                                                                               
Property:                                                                                                                                                                                        
(object end)                                                                                                                                                                                                                                
(object end)                                                                                                                                                                                                                                
Metadata:
  duration              0.00
  width                 2048.00
  height                1536.00
  videodatarate         0.00
  framerate             6.00
  videocodecid          7.00
  title                 Session streamed by "preview"
  comment               h264Preview_01_main
  encoder               Lavf58.20.100
  filesize              0.00

(... raw network packets ...)

Input #0, flv, from 'rtmp://my_local_ip_address/rtmp/healthy_stream_name':
  Metadata:
    title           : Session streamed by "preview"
    comment         : h264Preview_01_main
    encoder         : Lavf58.20.100
  Duration: 00:00:00.00, start: 159.743000, bitrate: N/A
    Stream #0:0, 41, 1/1000: Video: h264 (High), 1 reference frame, yuv420p(progressive), 2048x1536, 0/1, 6 fps, 6 tbr, 1k tbn



    


    And this is the fragment for dodgy stream :

    


    RTMP_ClientPacket, received: notify 205 bytes                                                                                                                                                                                               
(object begin)                                                                                                                                                                                                                              
Property:                                                                                                                                                                                                 
(object begin)                                                                                                                                                                                                                              
Property:                                                                                                                                                                                
Property:                                                                                                                                                                            
Property:                                                                                                                                                                                       
Property:                                                                                                                                                                                       
Property:                                                                                                                                                                                       
Property:                                                                                                                                                                                    
Property:                                                                                                                                                                                        
Property:                                                                                                                                                                                      
Property:                                                                                                                                                                                      
(object end)                                                                                                                                                                                                                                
(object end)                                                                                                                                                                                                                                
RTMP_ReadPacket: fd=3                                                                                                                                                                                                                       

(... raw network packets ...)

Input #0, flv, from 'rtmp://my_local_ip_address/rtmp/dodgy_stream_name':
  Duration: N/A, start: 4511.449000, bitrate: N/A
    Stream #0:0, 41, 1/1000: Video: h264 (High), 1 reference frame, yuv420p(progressive, left), 640x480, 0/1, 15.17 fps, 15.08 tbr, 1k tbn, 30 tbc
    Stream #0:1, 124, 1/1000: Audio: aac (LC), 48000 Hz, mono, fltp



    


    Both streams don't require any authentication (they are not exposed to the outside world)

    


    Dodgy stream contains audio but I don't think it is source of problem as I was able to connect to other healthy rtmp streams that contained audio..

    


    I have no more ideas how can I debug this problem, please help..

    



    


    I found in VideoCap documentation that I can enable exception mode, however it did not help much (it says where it failed but it does not say why) :

    


    >>> dodgy_stream = cv.VideoCapture()&#xA;>>> dodgy_stream.setExceptionMode(True)&#xA;>>> dodgy_stream.open("rtmp://my_local_ip_address/rtmp/dodgy_stream_name")&#xA;Traceback (most recent call last):&#xA;  File "<stdin>", line 1, in <module>&#xA;cv2.error: OpenCV(4.5.0) /tmp/pip-req-build-s_nildlw/opencv/modules/videoio/src/cap.cpp:177: error: (-2:Unspecified error) could not open &#x27;rtmp://my_local_ip_address/rtmp/dodgy_stream_name&#x27; in function &#x27;open&#x27;&#xA;</module></stdin>

    &#xA;

  • FFMPEG : Use expression calculated from timestamp to drawtext [closed]

    26 décembre 2020, par NicolasV

    Using ffmpeg and draw text, I need write on the video something like that :

    &#xA;

    text=1+floor(BPM * mod(1000*t-StartCounter ;480000/BPM)/60000).

    &#xA;

    I don't know if I need use PTS or t.

    &#xA;

    StartCounter would be a variable in milliseconds, the text would appear at this point.

    &#xA;

    BPM is an integer variable between 100 and 180.

    &#xA;

    I would draw for instance with StartCounter = 3256 and BPM = 120.

    &#xA;

    Any help appreciated, thanks

    &#xA;

  • Convert stream to a stream on the fly with ffmpeg/avconv

    6 juillet 2014, par Apacci

    I’m trying to convert flv stream to another mp3 or ogg stream. The point is I want to use mp3/ogg stream on HTML5 page, because flv stream can’t be played with HTML5. So, I configured avserver.conf :

    Port 8090
    BindAddress 0.0.0.0
    MaxHTTPConnections 2000
    MaxClients 1000
    MaxBandwidth 1000
    CustomLog -

    <feed>
       File /tmp/feed1.ffm
       FileMaxSize 200K
       ACL allow 127.0.0.1
    </feed>

    <stream>
       Feed feed1.ffm
       Format ogg
       AudioBitRate 64
       AudioChannels 1
       AudioSampleRate 44100
       NoVideo
    </stream>

    <stream>
       ACL allow localhost
       ACL allow 192.168.0.0 192.168.255.255
    </stream>

    <redirect>
       URL http://www.libav.org/
    </redirect>

    the command I use :

    avconv -i http://some_stream_service?format=flv -acodec mp3 http://localhost:8090/feed1.ffm

    console output :

    avconv version 9.13-6:9.13-0ubuntu0.14.04.1+fdkaac, Copyright (c) 2000-2014 the Libav developers
     built on May 10 2014 17:26:31 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
    [flv @ 0x126e020] max_analyze_duration reached
    Input #0, flv, from 'http://some_stream_service?format=flv':
     Metadata:
       encoder         : Lavf52.87.1
     Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
       Stream #0.0: Audio: aac, 44100 Hz, stereo, fltp, 31 kb/s
    Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
     Metadata:
       encoder         : Lavf54.20.4
       Stream #0.0: Audio: libmp3lame, 44100 Hz, stereo, fltp
    Stream mapping:
     Stream #0:0 -> #0:0 (aac -> libmp3lame)
    Press ctrl-c to stop encoding
    size=    1080kB time=66.14 bitrate= 133.8kbits/s

    It looks like working, but I keep getting 0 bytes on web page http://localhost:8090/test1.ogg. Does anybody have ideas what I’m doing wrong ?