Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (36)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

  • L’espace de configuration de MediaSPIP

    29 novembre 2010, par

    L’espace de configuration de MediaSPIP est réservé aux administrateurs. Un lien de menu "administrer" est généralement affiché en haut de la page [1].
    Il permet de configurer finement votre site.
    La navigation de cet espace de configuration est divisé en trois parties : la configuration générale du site qui permet notamment de modifier : les informations principales concernant le site (...)

  • 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 (...)

Sur d’autres sites (5291)

  • why am i getting this error when using FFmpeg in a spring boot app on a mac intel device : SIGSEGV (0xb) at pc=0x000000013d71b0e0, pid=49777, tid=42755

    19 juillet 2024, par Godwill Christopher

    I am working with FFmpeg library in spring boot app to stream live recording from an ip camera via RSTP and save to S3 bucket but i am running into the error below.

    


    A fatal error has been detected by the Java Runtime Environment :

    


    SIGSEGV (0xb) at pc=0x000000013d71b0e0, pid=49777, tid=42755

    


    JRE version : OpenJDK Runtime Environment Corretto-19.0.2.7.1 (19.0.2+7) (build 19.0.2+7-FR)
Java VM : OpenJDK 64-Bit Server VM Corretto-19.0.2.7.1 (19.0.2+7-FR, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
Problematic frame :
C [libavutil.56.dylib+0xa0e0] av_strstart+0x10

    


    No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
An error report file with more information is saved as :
/Users/CODA/Desktop/videoSaleService/hs_err_pid49777.log

    


    If you would like to submit a bug report, please visit :
https://github.com/corretto/corretto-19/issues/
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.

    


    Process finished with exit code 134 (interrupted by signal 6:SIGABRT)

    


    public static void main(String[] args) {
    OkHttpClient client = new OkHttpClient();
    try (S3Client s3Client = S3Client.create()) {
        VideoService videoService = new VideoService(new VideoRepositoryImpl(),
                new S3Service(s3Client), new VideoExtractor(client), new ISApiClient());
        videoService.streamLiveVideoRSTP(System.out);
    } catch (IOException e) {
        log.error("Error occurred while streaming live video: {}", e.getMessage(), e);
    } catch (Exception e) {
        log.error("Unexpected error occurred: {}", e.getMessage(), e);
    }
}

public void streamLiveVideoRSTP(OutputStream outputStream) throws IOException {
    File tempFile = File.createTempFile("live_stream", ".mp4");

    try (InputStream inputStream = client.getLiveStreamingVideoRSTP();
         OutputStream fileOutputStream = new FileOutputStream(tempFile)) {
        byte[] buffer = new byte[4096];
        int bytesRead;
        while ((bytesRead = inputStream.read(buffer)) != -1) {
            outputStream.write(buffer, 0, bytesRead);
            fileOutputStream.write(buffer, 0, bytesRead);
        }
    } catch (Exception e) {
        log.error("Error occurred while streaming live video: {}", e.getMessage(), e);
        throw new IOException("Error occurred while streaming live video", e);
    }

    // Upload the captured video file to S3
    try {
        uploadStreamedVideoToS3(tempFile);
    } finally {
        if (tempFile.exists()) {
            if (!tempFile.delete()) {
                log.warn("Failed to delete temporary file: {}", tempFile.getAbsolutePath());
            }
        }
    }
}

private final BlockingQueue frameQueue = new ArrayBlockingQueue<>(10);

public ISApiClient() {
    new Thread(this::startGrabbingFrames).start();
}

public InputStream getLiveStreamingVideoRSTP() {
    return new InputStream() {
        private ByteArrayInputStream currentStream;

        @Override
        public int read() {
            if (currentStream == null || currentStream.available() == 0) {
                byte[] frame = frameQueue.poll();
                if (frame != null) {
                    currentStream = new ByteArrayInputStream(frame);
                } else {
                    return -1;
                }
            }
            return currentStream.read();
        }
    };
}

private void startGrabbingFrames() {
    try (FFmpegFrameGrabber frameGrabber = new FFmpegFrameGrabber(rtspUrl)) {
        frameGrabber.setOption("rtsp_transport", "tcp");
        frameGrabber.start();

        FFmpegFrameFilter frameFilter = new FFmpegFrameFilter("format=yuv420p",
                frameGrabber.getImageWidth(), frameGrabber.getImageHeight());
        frameFilter.setPixelFormat(frameGrabber.getPixelFormat());
        frameFilter.start();

        log.info("Started grabbing frames from RTSP stream.");

        while (true) {
            Frame frame = frameGrabber.grab();
            if (frame != null && frame.image != null) {
                log.info("Frame grabbed: width={} height={} timestamp={}",
                        frame.imageWidth, frame.imageHeight, frame.timestamp);
                frameFilter.push(frame);
                Frame filteredFrame = frameFilter.pull();

                if (filteredFrame != null && filteredFrame.image != null) {
                    log.info("Frame filtered: width={} height={} timestamp={}",
                            filteredFrame.imageWidth, filteredFrame.imageHeight, filteredFrame.timestamp);
                    byte[] imageBytes = convertFrameToBytes(filteredFrame);
                    if (imageBytes.length > 0) {
                        frameQueue.offer(imageBytes);
                        log.info("Frame added to queue, queue size={}", frameQueue.size());
                    }
                }
            }
        }
    } catch (IOException e) {
        log.error("Error grabbing frames: {}", e.getMessage(), e);
    }
}

private byte[] convertFrameToBytes(Frame frame) {
    if (frame == null || frame.image == null) {
        return new byte[0];
    }

    ByteBuffer byteBuffer = null;
    for (Object img : frame.image) {
        if (img instanceof ByteBuffer) {
            byteBuffer = (ByteBuffer) img;
            break;
        }
    }

    if (byteBuffer == null) {
        return new byte[0];
    }

    byte[] bytes = new byte[byteBuffer.remaining()];
    byteBuffer.get(bytes);
    return bytes;
}


    


  • Generating test data – Introducing the Piwik Platform

    9 octobre 2014, par Thomas Steur — Development

    This is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to create a command). This time you’ll learn how to generate test data.

    Developers are developing on their local Piwik instance which usually does not contain useful data compared to a real Piwik installation in production (only a few test visits and a few tests users and websites). The ‘VisitorGenerator’ plugin lets you generate any number of visits, websites, users, goals and more. The generator makes sure there will be data for each report so you can easily test anything.

    Getting started

    In this series of posts, we assume that you have already installed Piwik. If not, visit the Piwik Developer Zone where you’ll find the Installation guide for developers.

    Installing the VisitorGenerator plugin

    The easiest way to install the plugin is by using the Marketplace in Piwik itself. It is accessible via Settings => Marketplace => Get new functionality. There you’ll find the plugin “VisitorGenerator” which you can install and activate in one click.

    If your Piwik instance is not connected to the internet you can download the plugin from the VisitorGenerator page on the Marketplace. Afterwards you can install the plugin by going to Settings => Marketplace => Uploading a plugin and uploading the previously downloaded ZIP file.

    If you have already installed the plugin make sure it is activated by going to Settings => Plugins.

    Generating websites

    After you have installed the plugin you can add as many websites as you need. This is useful for instance when you want to test something that affects many websites such as the ‘All Websites’ dashboard or the Websites manager. To generate any number of websites use the following command :

    ./console visitorgenerator:generate-website --limit=10

    This will generate 10 websites. If you need more websites simply specify a higher limit. In case you are wondering the names and URLs of the websites are randomly generated by the Faker PHP library.

    Generating goals

    In case you want to test anything related to Goals you should execute the following command :

    ./console visitorgenerator:generate-goals --idsite=1

    This will generate a few goals for the specified site. The generated goals are defined in a way to make sure there will be conversions when generating the visits in the next step.

    Generating visits

    To generate visits there are two possibilities. Either via the Piwik UI by going to Settings => Visitor Generator or by using the command line. The UI is a bit limited in generating visits so we recommend to use the command line. There you can generate visits as follows :

    ./console visitorgenerator:generate-visits --idsite=1

    This will generate many different visits for the current day. Don’t worry if it takes a while, it will insert quite a few visits by default.

    In case you want to generate visits for multiple days in the past as well you can specify the --days option.

    ./console visitorgenerator:generate-visits --idsite=1 --days=5

    Providing your own logs

    Half of the generated visits are randomly generated and half of the visits are based on real logs to make sure there is data for each report. If you want to generate visits based on your own logs for a more realistic testing just place your log files in the plugins/VisitorGenerator/data folder and make sure the file name ends with .log. You can find a few examples in the VisitorGenerator data folder.

    To generate visits based only on real log files then use the --no-fake option.

    ./console visitorgenerator:generate-visits --idsite=1 --no-fake

    All generated visits will come from the logs and no random visits nor random fake data will be used.

    Advanced features

    We are regularly adding new commands, tools and runtime checks to make your life as a developer easier. For instance you can also generate users and annotations. In the future we want to extend the plugin to create visits in the background to make sure there will be constantly new actions in the real time report.

    Are you missing any kind of generator or any other feature to make your life as a developer easier ? Let us know by email, we are listening !

    Would you like to know more about the Piwik platform ? Go to our Piwik Developer Zone where you’ll find guides and references on how to develop plugin and themes.

  • Generating test data – Introducing the Piwik Platform

    9 octobre 2014, par Thomas Steur — Development

    This is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to create a command). This time you’ll learn how to generate test data.

    Developers are developing on their local Piwik instance which usually does not contain useful data compared to a real Piwik installation in production (only a few test visits and a few tests users and websites). The ‘VisitorGenerator’ plugin lets you generate any number of visits, websites, users, goals and more. The generator makes sure there will be data for each report so you can easily test anything.

    Getting started

    In this series of posts, we assume that you have already installed Piwik. If not, visit the Piwik Developer Zone where you’ll find the Installation guide for developers.

    Installing the VisitorGenerator plugin

    The easiest way to install the plugin is by using the Marketplace in Piwik itself. It is accessible via Settings => Marketplace => Get new functionality. There you’ll find the plugin “VisitorGenerator” which you can install and activate in one click.

    If your Piwik instance is not connected to the internet you can download the plugin from the VisitorGenerator page on the Marketplace. Afterwards you can install the plugin by going to Settings => Marketplace => Uploading a plugin and uploading the previously downloaded ZIP file.

    If you have already installed the plugin make sure it is activated by going to Settings => Plugins.

    Generating websites

    After you have installed the plugin you can add as many websites as you need. This is useful for instance when you want to test something that affects many websites such as the ‘All Websites’ dashboard or the Websites manager. To generate any number of websites use the following command :

    ./console visitorgenerator:generate-website --limit=10

    This will generate 10 websites. If you need more websites simply specify a higher limit. In case you are wondering the names and URLs of the websites are randomly generated by the Faker PHP library.

    Generating goals

    In case you want to test anything related to Goals you should execute the following command :

    ./console visitorgenerator:generate-goals --idsite=1

    This will generate a few goals for the specified site. The generated goals are defined in a way to make sure there will be conversions when generating the visits in the next step.

    Generating visits

    To generate visits there are two possibilities. Either via the Piwik UI by going to Settings => Visitor Generator or by using the command line. The UI is a bit limited in generating visits so we recommend to use the command line. There you can generate visits as follows :

    ./console visitorgenerator:generate-visits --idsite=1

    This will generate many different visits for the current day. Don’t worry if it takes a while, it will insert quite a few visits by default.

    In case you want to generate visits for multiple days in the past as well you can specify the --days option.

    ./console visitorgenerator:generate-visits --idsite=1 --days=5

    Providing your own logs

    Half of the generated visits are randomly generated and half of the visits are based on real logs to make sure there is data for each report. If you want to generate visits based on your own logs for a more realistic testing just place your log files in the plugins/VisitorGenerator/data folder and make sure the file name ends with .log. You can find a few examples in the VisitorGenerator data folder.

    To generate visits based only on real log files then use the --no-fake option.

    ./console visitorgenerator:generate-visits --idsite=1 --no-fake

    All generated visits will come from the logs and no random visits nor random fake data will be used.

    Advanced features

    We are regularly adding new commands, tools and runtime checks to make your life as a developer easier. For instance you can also generate users and annotations. In the future we want to extend the plugin to create visits in the background to make sure there will be constantly new actions in the real time report.

    Are you missing any kind of generator or any other feature to make your life as a developer easier ? Let us know by email, we are listening !

    Would you like to know more about the Piwik platform ? Go to our Piwik Developer Zone where you’ll find guides and references on how to develop plugin and themes.