Recherche avancée

Médias (91)

Autres articles (60)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Participer à sa documentation

    10 avril 2011

    La documentation est un des travaux les plus importants et les plus contraignants lors de la réalisation d’un outil technique.
    Tout apport extérieur à ce sujet est primordial : la critique de l’existant ; la participation à la rédaction d’articles orientés : utilisateur (administrateur de MediaSPIP ou simplement producteur de contenu) ; développeur ; la création de screencasts d’explication ; la traduction de la documentation dans une nouvelle langue ;
    Pour ce faire, vous pouvez vous inscrire sur (...)

Sur d’autres sites (9190)

  • FFMPEG - local video to UDP streaming to OpenCV - video quality degraded

    6 juin 2021, par user3925023

    my goal is to re-stream local video content / desktop screencasting, to an UDP flow that I need to process on a Python script.

    



    Here is the FFMPEG script that I'm using :

    



    ffmpeg -re -i C:\Users\test\Downloads\out.ts -strict -2 -c:v copy -an -preset slower -tune stillimage -b 11200k -f rawvideo udp://127.0.0.1:5000


    



    And here is the simple Python script supposed to read the stream flow :

    



    import cv2

cap = cv2.VideoCapture('udp://127.0.0.1:5000',cv2.CAP_FFMPEG)
if not cap.isOpened():
    print('VideoCapture not opened')
    exit(-1)
width = cap.get(cv2.CAP_PROP_FRAME_WIDTH)  # float
height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)  # float
print(str(width))
print(str(height))
while True:
    ret, frame = cap.read()
    imgray = frame[int(round((height/100)*70,0)):int(round((width/100)*42,0)), int(round((height/100)*74,0)):int(round((width/100)*54,0))]
    if not ret:
        print('frame empty')
        break
    cv2.imshow('image', imgray)
    if cv2.waitKey(1)&0XFF == ord('q'):
        break
cap.release()


    



    I'm able to visualize portion of the stream video as expect, but I'm facing lot of issue in video quality degradation, specially video artifact probably due missing packet processing :

    



    enter image description here

    



    Also these are error log I'm geting from script :

    



    [h264 @ 0000026eb272f280] error while decoding MB 105 66, bytestream -21
[h264 @ 0000026eb2fcb740] error while decoding MB 100 53, bytestream -11
[h264 @ 0000026eb272f280] error while decoding MB 32 22, bytestream -11
[h264 @ 0000026ead9ee300] error while decoding MB 60 20, bytestream -25
[h264 @ 0000026eb27f00c0] error while decoding MB 9 62, bytestream -5
[h264 @ 0000026ead9ee780] error while decoding MB 85 44, bytestream -5
[h264 @ 0000026eb27f0800] error while decoding MB 64 25, bytestream -15
[h264 @ 0000026eb272f280] error while decoding MB 112 23, bytestream -17
[h264 @ 0000026eb2735200] error while decoding MB 30 21, bytestream -7


    



    Actually I don't care about video fluidity,I can also reduce the FPS, important thing is the video quality. Not sure if I'm doing wrong on the scripting python part or if I'm using wrong FFMPEG command.

    



    Many Thanks

    


  • Combining 2 FFMPEG Commands

    11 juillet 2020, par John Doe

    I'm trying to combine 2 ffmpeg commands, one which creates the video, and another which adds a simple fade to the beginning of the created video. Here's what I have :

    


    ffmpeg -y -stream_loop -1 -i "video.mp4" -stream_loop -1 -i "music.mp3" -i "audio.mp3" -filter_complex "[1:a]volume=0.1[a1];[2:a]adelay=5000|5000,apad=pad_dur=10[a2];[a1][a2]amerge=inputs=2,afade=in:st=0:d=5[audio]" -map "0:v" -map "[audio]" -c:v libx264 -c:a aac -ac 2 -ar 22050 -preset veryfast -shortest "output.mp4"

ffmpeg -y -i "output.mp4" -filter_complex "[0:v]fade=in:0:d=5" -c:a copy -preset veryfast -movflags faststart -fflags genpts "done.mp4"


    


    The two commands work perfectly fine, however the second one takes about the same amount of time to process as the first, and I feel it should be relatively easy to do the fade-in during the first encode. For my skillset atleast, I was wrong. Please could someone with more experience lend a helping hand ?

    


    Thanks.

    


  • How to use FFmpeg & "tee" to UDP video (only) stream to another computer while recording to computer with USB camera

    13 juillet 2020, par pomptondrive

    I'm trying to get "tee muxer" to work with FFmpeg, but I'm not having much luck. Basically I would like to stream a USB camera with UDP to another computer with an decent/acceptable result to monitor, while recording around 15 FPS in an economical (compressed) fashion that won't take up too much disk space. Honestly, I don't understand the entire syntax of using "tee"—I guess that's obvious. I have looked at some of the FFmpeg documentation, but it doesn't seem comprehensive enough in this instance.

    


    So, currently, I have experimented a little and this works for streaming (picking up with VLC on the other computer) :

    


    ffmpeg -f v4l2 -i /dev/video0 -profile:v high -pix_fmt yuvj420p -level:v 4.1 -preset ultrafast -tune zerolatency -vcodec libx264 -r 15 -b:v 512k -s 640x480 -f mpegts -flush_packets 0 udp://192.168.0.19:5000?pkt_size=1316


    


    I've also checked and this records OK (I do NOT actually want it to ffplay on this machine ; this was just some code I found to test.) :

    


    ffmpeg -f v4l2 -i /dev/video0 -map 0 -c:v libx264 -f tee "Documents/video01.mkv|[f=nut]pipe:" | ffplay pipe:


    


    So the next objective is to combine the two with tee, and do a UDP stream to the other computer, while recording an mkv file to the computer with the camera. I've tried several ways to do this with no success ; results have been just one or the other, because my syntax is crap, or I'm just particularly inept at this particular task. ;-)

    


    After that (icing on the cake) would be to create separate *.mkv files at 15-minute intervals, and have them self-destruct after a couple of days.

    


    Any help with the tee business would be greatly appreciated.