Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (19)

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (3871)

  • How to retrieve, process and display frames from a capture device with minimal latency

    14 mars 2024, par valle

    I'm currently working on a project where I need to retrieve frames from a capture device, process them, and display them with minimal latency and compression. Initially, my goal is to maintain the video stream as close to the source signal as possible, ensuring no noticeable compression or latency. However, as the project progresses, I also want to adjust framerate and apply image compression.

    


    I have experimented using FFmpeg, since that was the first thing that came to my mind when thinking about capturing video(frames) and processing them.

    


    However I am not satisfied yet, since I am experiencing delay in the stream. (No huge delay but definately noticable)
The command that worked best so far for me :

    


    ffmpeg -rtbufsize 512M -f dshow -i video="Blackmagic WDM Capture (4)" -vf format=yuv420p -c:v libx264 -preset ultrafast -qp 0 -an -tune zerolatency -f h264 - | ffplay -fflags nobuffer -flags low_delay -probesize 32 -sync ext -

    


    I also used OBS to capture the video stream from the capture device and when looking into the preview there was no noticable delay. I then tried to simulate the exact same settings using ffmpeg :

    


    ffmpeg -rtbufsize 512M -f dshow -i video="Blackmagic WDM Capture (4)" -vf format=yuv420p -r 60 -c:v libx264 -preset veryfast -b:v 2500K -an -tune zerolatency -f h264 - | ffplay -fflags nobuffer -flags low_delay -probesize 32 -sync ext -

    


    But the delay was kind of similar to the one of the command above.
I know that OBS probably has a lot complexer stuff going on (Hardware optimization etc.) but atleast I know this way that it´s somehow possible to display the stream from the capture device without any noticable latency (On my setup).

    


    The approach that so far worked best for me (In terms of delay) was to use Python and OpenCV to read frames of the capture device and display them. I also implemented my own framerate (Not perfect I know) but when it comes to compression I am rather limited compared to FFmpeg and the frame processing is also too slow when reaching framerates about 20 fps and more.

    


    import cv2
import time

# Set desired parameters
FRAME_RATE = 15  # Framerate in frames per second
COMPRESSION_QUALITY = 25  # Compression quality for JPEG format (0-100)
COMPRESSION_FLAG = True   # Enable / Disable compression

# Set capture device index (replace 0 with the index of your capture card)
cap = cv2.VideoCapture(4, cv2.CAP_DSHOW)

# Check if the capture device is opened successfully
if not cap.isOpened():
    print("Error: Could not open capture device")
    exit()

# Create an OpenCV window
# TODO: The window is scaled to fullscreen here (The source video is 1920x1080, the display is 1920x1200)
#       I don´t know the scaling algorithm behind this, but it seems to be a simple stretch / nearest neighbor
cv2.namedWindow('Frame', cv2.WINDOW_NORMAL)
cv2.setWindowProperty('Frame', cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)

# Loop to capture and display frames
while True:
    # Start timer for each frame processing cycle
    start_time = time.time()

    # Capture frame-by-frame
    ret, frame = cap.read()

    # If frame is read correctly, proceed
    if ret:
        if COMPRESSION_FLAG:
            # Perform compression
            _, compressed_frame = cv2.imencode('.jpg', frame, [int(cv2.IMWRITE_JPEG_QUALITY), COMPRESSION_QUALITY])
            # Decode the compressed frame
            frame = cv2.imdecode(compressed_frame, cv2.IMREAD_COLOR)

        # Display the frame
        cv2.imshow('Frame', frame)

        # Calculate elapsed time since the start of this frame processing cycle
        elapsed_time = time.time() - start_time

        # Calculate available time for next frame
        available_time = 1.0 / FRAME_RATE

        # Check if processing time exceeds available time
        if elapsed_time > available_time:
            print("Warning: Frame processing time exceeds available time.")

        # Calculate time to sleep to achieve desired frame rate -> maintain a consistent frame rate
        sleep_time = 1.0 / FRAME_RATE - elapsed_time

        # If sleep time is positive, sleep to control frame rate
        if sleep_time > 0:
            time.sleep(sleep_time)

    # Break the loop if 'q' is pressed
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# Release the capture object and close the display window
cap.release()
cv2.destroyAllWindows()


    


    I also thought about getting the SDK of the capture device in order to upgrade the my performance.
But Since I am not used to low level programming but rather to scripting languages, I thought I would reach out to the StackOverflow community at first, and see if anybody has some hints to better approaches or any tips how I could increase my performance.

    


    Any Help is appreciated !

    


  • How to contribute to open source, for companies

    18 octobre 2010, par Dark Shikari — development, open source, x264

    I have seen many nigh-incomprehensible attempts by companies to contribute to open source projects, including x264. Developers are often simply boggled, wondering why the companies seem incapable of proper communication. The companies assume the developers are being unreceptive, while the developers assume the companies are being incompetent, idiotic, or malicious. Most of this seems to boil down to a basic lack of understanding of how open source works, resulting in a wide variety of misunderstandings. Accordingly, this post will cover the dos and don’ts of corporate contribution to open source.

    Do : contact the project using their preferred medium of communication.

    Most open source projects use public methods of communication, such as mailing lists and IRC. It’s not the end of the world if you mistakenly make contact with the wrong people or via the wrong medium, but be prepared to switch to the correct one once informed ! You may not be experienced using whatever form of communication the project uses, but if you refuse to communicate through proper channels, they will likely not be as inclined to assist you. Larger open source projects are often much like companies in that they have different parts to their organization with different roles. Don’t assume that everyone is a major developer !

    If you don’t know what to do, a good bet is often to just ask someone.

    Don’t : contact only one person.

    Open source projects are a communal effort. Major contributions are looked over by multiple developers and are often discussed by the community as a whole. Yet many companies tend to contact only a single person in lieu of dealing with the project proper. This has many flaws : to begin with, it forces a single developer (who isn’t paid by you) to act as your liaison, adding yet another layer between what you want and the people you want to talk to. Contribution to open source projects should not be a game of telephone.

    Of course, there are exceptions to this : sometimes a single developer is in charge of the entirety of some particular aspect of a project that you intend to contribute to, in which case this might not be so bad.

    Do : make clear exactly what it is you are contributing.

    Are you contributing code ? Development resources ? Money ? API documentation ? Make it as clear as possible, from the start ! How developers react, which developers get involved, and their expectations will depend heavily on what they think you are providing. Make sure their expectations match reality. Great confusion can result when they do not.

    This also applies in the reverse — if there’s something you need from the project, such as support or assistance with development of your patch, make that explicitly clear.

    Don’t : code dump.

    Code does not have intrinsic value : it is only useful as part of a working, living project. Most projects react very negatively to large “dumps” of code without associated human resources. That is, they expect you to work with them to finalize the code until it is ready to be committed. Of course, it’s better to work with the project from the start : this avoids the situation of writing 50,000 lines of code independently and then finding that half of it needs to be rewritten. Or, worse, writing an enormous amount of code only to find it completely unnecessary.

    Of course, the reverse option — keeping such code to yourself — is often even more costly, as it forces you to maintain the code instead of the official developers.

    Do : ignore trolls.

    As mentioned above, many projects use public communication methods — which, of course, allow anyone to communicate, by nature of being public. Not everyone on a project’s IRC or mailing list is necessarily qualified to officially represent the project. It is not too uncommon for a prospective corporate contributor to be turned off by the uninviting words of someone who isn’t even involved in the project due to assuming that they were. Make sure you’re dealing with the right people before making conclusions.

    Don’t : disappear.

    If you are going to try to be involved in a project, you need to stay in contact. We’ve had all too many companies who simply disappear after the initial introduction. Some tell us that we’ll need an NDA, then never provide it or send status updates. You may know why you’re not in contact — political issues at the company, product launch crunches, a nice vacation to the Bahamas — but we don’t ! If you disappear, we will assume that you gave up.

    Above all, don’t assume that being at a large successful company makes you immune to these problems. If anything, these problems seem to be the most common at the largest companies. I didn’t name any names in this post, but practically every single one of these rules has been violated at some point by companies looking to contribute to x264. In the larger scale of open source, these problems happen constantly. Don’t fall into the same traps that many other companies have.

    If you’re an open source developer reading this post, remember it next time you see a company acting seemingly nonsensically in an attempt to contribute : it’s quite possible they just don’t know what to do. And just because they’re doing it wrong doesn’t mean that it isn’t your responsibility to try to help them do it right.

  • The new GDPR data protection regulation and potential consequences on Piwik

    7 septembre 2017, par Piwik Core Team — About, Privacy

    GDPR is a new data protection related regulation in Europe. GDPR stands for General Data Protection Regulation.

    The purpose of this European regulation is to strengthen and unify data protection for all individuals within the European Union. This also includes entities outside Europe willing to do business with European citizens. GDPR is a set of processes you need to follow within your organization to protect the privacy of European citizens.

    GDPR will start to apply in May 2018. It is recognized to be dissuasive because of the potential penalty of up to 4% of the yearly turnover, in case of infringement.

    Many articles have been written about GDPR including our previous article. Few of them are explaining how it will affect web analytics vendors : this is what this article is about.

    Am I really impacted by GDPR if I am a Piwik user ?

    As Piwik can collect personal data, the answer is yes. Piwik analytics data is impacted by the GDPR.

    As GDPR is a general concept, we decided from the official guidelines to assume what will be the potential consequences on the use of Piwik.

    There are 2 potential scenarios we can identify :

    • 1 – You are collecting personal data with Piwik
    • 2 – You are not collecting personal data with Piwik

    1 – Personal data collection with Piwik

    According to GDPR : IP addresses, cookies, UserID are personal data.

    IP addresses are personal data, so you will have to anonymize them unless you receive explicit consent from the visitor. Please view the following article in order to learn : how can I anonymize IP addresses in Piwik ?

    According to GDPR, cookies are personal data too. But as all cookies are not created equal it may be possible that some need to require user consent whereas other not. Whatever will be the final decision, you can learn about the first-party cookies created by Piwik and how to disable all tracking cookies in Piwik ?

    User ID, you are impacted if the User ID you assign is specific to an individual or if you can cross the User ID data further and find back the individual personal data.

    Any extra personal data you may collect with Piwik, it could be for example : first names, family names, e-mail address… You are able to collect such data using custom dimensions, custom variables…

    What are the rules I have to comply with ?

    By collecting personal data, you will have to respect EU citizens rights, which include :

    • The possibility for them to view the data you collected on them
    • The possibility to rectify some data concerning them
    • The possibility to delete their data when they request about it

    As you can imagine, for the first obligation, you will have to export all the data. So if a user is requesting it, you will have to export the data linked to his IP address(es). It can be easily exported as a .csv file for example.
    In order to do that, just create a segment according to the IP address of the user who requested it and then export the “Visitor log” report.
    If the personal data is not linked with the IP address but other attributes such as User ID or a custom dimension, you can provide the same data export by using the segment function and filtering on the personal data field.

    The data edit and deletion process on Piwik is a bit trickier as it currently requires administration system skills. We are planning to develop a new plugin for GDPR compliance (which will be available for free on the Marketplace). This plugin will let you edit and easily delete data of a particular user. Currently you can delete a specific user’s data by accessing the Piwik database and directly delete the different records for this specific user.

    2 – You are not collecting personal data with Piwik

    Unfortunately it is not because you do not collect personal data that you will not be affected by GDPR.
    The details of GDPR are not confirmed yet and GDPR could involve enabling the DoNotTrack setting by default on all browsers.
    Yes, you read it well, by default, unless the internet user uncheck this option, Piwik respecting DoNoTrack would not be able to track any user. If one needed to collect data anyway, Piwik Log Analytics and server-side tracking can be considered.

    If you need help regarding how to set up your Piwik installation in order to be GDPR compliant :

    Do you have a Piwik experience you would like to share with the community ? Please share it with us by contacting Piwik core team.