Recherche avancée

Médias (91)

Autres articles (73)

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (7527)

  • MOV to ACVHD conversion via Spring Boot and FFmpeg leads to file system error

    31 décembre 2024, par epicUsername

    I am experiencing an issue on a personal project that seeks to convert HEIC to JPG files and MOV files to AVCHD format. The HEIC to JPG conversion works, but the MOV to AVCHD does not, which is where my problems lie.

    


    The intent is to do this with Spring Boot and FFmpeg, using a simple interface done in WindowBuilder.

    


    The relevant bits are the pom file :

    


        <dependencies>&#xA;    &#xA;        &#xA;        <dependency>&#xA;            <groupid>jmagick</groupid>&#xA;            <artifactid>jmagick</artifactid>&#xA;            <version>6.6.9</version>&#xA;        </dependency>&#xA;&#xA;        &#xA;        <dependency>&#xA;            <groupid>net.java.dev.jna</groupid>&#xA;            <artifactid>jna</artifactid>&#xA;            <version>5.7.0</version> &#xA;        </dependency>&#xA;        <dependency>&#xA;            <groupid>net.java.dev.jna</groupid>&#xA;            <artifactid>jna-platform</artifactid>&#xA;            <version>5.7.0</version>&#xA;        </dependency>&#xA;        &#xA;        &#xA;&#xA;&#xA;        <dependency>&#xA;            <groupid>org.bytedeco</groupid>&#xA;            <artifactid>ffmpeg</artifactid>&#xA;            <version>7.1-1.5.11</version>&#xA;        </dependency>&#xA;        <dependency>&#xA;            <groupid>org.bytedeco</groupid>&#xA;            <artifactid>javacv</artifactid>&#xA;            <version>1.5.11</version>&#xA;        </dependency>&#xA;        <dependency>&#xA;            <groupid>org.bytedeco</groupid>&#xA;            <artifactid>ffmpeg-platform</artifactid>&#xA;            <version>7.1-1.5.11</version>&#xA;        </dependency>&#xA;        &#xA;        <dependency>&#xA;            <groupid>org.bytedeco</groupid>&#xA;            <artifactid>javacpp</artifactid>&#xA;            <version>1.5.11</version>&#xA;        </dependency>&#xA;    </dependencies>&#xA;&#xA;

    &#xA;

    and the main file with the event handling for the application, based on the interface :

    &#xA;

    package home.multimeida.mmconverter;&#xA;&#xA;imports...&#xA;&#xA;public class MMConverterInterface extends JFrame {&#xA;&#xA;    public static void main(String[] args) {&#xA;        &#xA;        &#xA;        try {&#xA;            System.setProperty("jna.library.path", "absolute/path/to/gstreamer/bin");&#xA;            // Gst.init("GStreamer Test");&#xA;            System.out.println("GStreamer initialized successfully.");&#xA;        } catch (Exception e) {&#xA;            e.printStackTrace();&#xA;            System.out.println("Failed to initialize GStreamer.");&#xA;        }&#xA;        EventQueue.invokeLater(new Runnable() {&#xA;            public void run() {&#xA;                try {&#xA;                    MMConverterInterface frame = new MMConverterInterface();&#xA;                    frame.setVisible(true);&#xA;                } catch (Exception e) {&#xA;                    e.printStackTrace();&#xA;                }&#xA;            }&#xA;        });&#xA;    }&#xA;&#xA;    /**&#xA;     * Create the frame.&#xA;     */&#xA;    public MMConverterInterface() {&#xA;        &#xA;        // convert button&#xA;        &#xA;        btnConvert.addActionListener(e -> {&#xA;            &#xA;            try {&#xA;                &#xA;                if (sourceFileLabel.getText().equals("No file chosen...") || destinationFolderLabel.getText().equals("No folder selected...")) {&#xA;                    JOptionPane.showMessageDialog(null, "Please select both an input file and a save location.", "Validation Error", JOptionPane.WARNING_MESSAGE);&#xA;                    return;&#xA;                }&#xA;                 &#xA;                File sourceFile = new File(sourceFileLabel.getText());&#xA;                File destinationFile;&#xA;                 &#xA;                if (rdbtnNewRadioButton.isSelected()) {&#xA;                    &#xA;                    System.out.println("Converting HEIC to JPG...");&#xA;                        &#xA;                    String outputFileName = sourceFile.getName().replaceFirst("[.][^.]&#x2B;$", ".jpg");&#xA;                    &#xA;                    // Call your conversion logic here&#xA;                    &#xA;                    destinationFile = new File(destinationFolderLabel.getText(), outputFileName);&#xA;                    &#xA;                    convertHeicToJpg(sourceFile, destinationFile);&#xA;                    &#xA;                } else if (rdbtnNewRadioButton_1.isSelected()) {&#xA;                    &#xA;                    if (sourceFileLabel.getText().equals("No file chosen...") || destinationFolderLabel.getText().equals("No folder selected...")) {&#xA;                        JOptionPane.showMessageDialog(null, "Please select both an input file and a save location.", "Validation Error", JOptionPane.WARNING_MESSAGE);&#xA;                        return;&#xA;                    }&#xA;                    &#xA;                     // Validate source file&#xA;                    if (!sourceFile.exists() || !sourceFile.canRead()) {&#xA;                        JOptionPane.showMessageDialog(null, "Source file does not exist or is not readable.", "File Error", JOptionPane.ERROR_MESSAGE);&#xA;                        return;&#xA;                    }&#xA;                    &#xA;                    // Validate destination folder&#xA;                    String destinationPath = destinationFolderLabel.getText();&#xA;                    if (destinationPath == null || destinationPath.isEmpty() || !(new File(destinationPath).isDirectory())) {&#xA;                        JOptionPane.showMessageDialog(null, "Invalid destination folder.", "File Error", JOptionPane.ERROR_MESSAGE);&#xA;                        return;&#xA;                    }&#xA;                    &#xA;                    System.out.println("Converting MOV to AVCHD...");&#xA;                    &#xA;                    String currentDate = new SimpleDateFormat("yyyyMMdd").format(new Date());&#xA;&#xA;                    // Extract the file name without the extension&#xA;                    String baseName = sourceFile.getName().replaceFirst("[.][^.]&#x2B;$", "");&#xA;&#xA;                    // Sanitize the base name (replace invalid characters with &#x27;_&#x27;)&#xA;                    baseName = baseName.replaceAll("[^a-zA-Z0-9-_]", "_");&#xA;                    &#xA;                    String sanitizedFileName = baseName &#x2B; "_" &#x2B; currentDate;&#xA;                    sanitizedFileName = sanitizedFileName.replaceAll("[^a-zA-Z0-9._-]", "_"); // Allow alphanumeric, &#x27;-&#x27;, &#x27;_&#x27;, and &#x27;.&#x27;&#xA;&#xA;                    destinationFile = new File(destinationPath, sanitizedFileName);&#xA;                    &#xA;                    &#xA;                    /*&#xA;                    // Ensure the destination file is writable&#xA;                    if (!destinationFile.canWrite()) {&#xA;                        JOptionPane.showMessageDialog(null, "Output file is not writable.", "File Error", JOptionPane.ERROR_MESSAGE);&#xA;                        return;&#xA;                    }&#xA;                    */&#xA;                   &#xA;&#xA;                    convertMovToAvchd(sourceFile, destinationFile);&#xA;                    &#xA;                } else {&#xA;                    &#xA;                    JOptionPane.showMessageDialog(null, "Please select a conversion type.");&#xA;                    &#xA;                }&#xA;                &#xA;            } catch (Exception ex) {&#xA;                &#xA;                JOptionPane.showMessageDialog(null, "Error: " &#x2B; ex.getMessage(), "Conversion Error", JOptionPane.ERROR_MESSAGE);&#xA;                ex.printStackTrace();&#xA;            }&#xA;            &#xA;            &#xA;        });&#xA;        &#xA;        // cancel button:&#xA;        &#xA;        btnCancel.addActionListener(e -> {&#xA;            System.out.println("Operation canceled.");&#xA;            System.exit(0); // Close the application&#xA;        });&#xA;&#xA;    }&#xA;    &#xA;    public void convertMovToAvchd(File sourceFile, File destinationFile) {&#xA;        avutil.av_log_set_level(avutil.AV_LOG_DEBUG);&#xA;        &#xA;        &#xA;&#xA;        AVFormatContext inputFormatContext = null;&#xA;        AVFormatContext outputFormatContext = new AVFormatContext(null);&#xA;        AVCodecContext inputCodecContext = null;&#xA;        AVCodecContext outputCodecContext = null;&#xA;&#xA;        try {&#xA;            // Validate input file&#xA;            if (!sourceFile.exists() || !sourceFile.canRead()) {&#xA;                System.out.println("Source file does not exist or is not readable: " &#x2B; sourceFile.getAbsolutePath());&#xA;                return;&#xA;            }&#xA;            &#xA;            // Validate output file path using the validateFileCreation method&#xA;            if (!validateFileCreation(destinationFile)) {&#xA;                return; // Exit if destination file validation fails&#xA;            }&#xA;&#xA;            // Validate output file path&#xA;            if (destinationFile.getParentFile() == null || !destinationFile.getParentFile().exists()) {&#xA;                System.out.println("Output directory does not exist: " &#x2B; destinationFile.getParentFile());&#xA;                return;&#xA;            }&#xA;            if (!destinationFile.getParentFile().canWrite()) {&#xA;                System.out.println("Output directory is not writable: " &#x2B; destinationFile.getParentFile());&#xA;                return;&#xA;            }&#xA;&#xA;            // Open input file&#xA;            inputFormatContext = avformat.avformat_alloc_context();&#xA;            if (avformat.avformat_open_input(inputFormatContext, sourceFile.getAbsolutePath(), null, null) &lt; 0) {&#xA;                System.out.println("Failed to open input file: " &#x2B; sourceFile.getAbsolutePath());&#xA;                return;&#xA;            }&#xA;&#xA;            // Find stream information&#xA;            if (avformat.avformat_find_stream_info(inputFormatContext, (PointerPointer) null) &lt; 0) {&#xA;                System.out.println("Failed to retrieve input stream information.");&#xA;                return;&#xA;            }&#xA;&#xA;            // Find video stream&#xA;            int videoStreamIndex = avformat.av_find_best_stream(inputFormatContext, avutil.AVMEDIA_TYPE_VIDEO, -1, -1, (AVCodec) null, 0);&#xA;            if (videoStreamIndex &lt; 0) {&#xA;                System.out.println("Failed to find video stream in input file.");&#xA;                return;&#xA;            }&#xA;&#xA;            // Initialize input codec context&#xA;            inputCodecContext = avcodec.avcodec_alloc_context3(null);&#xA;            avcodec.avcodec_parameters_to_context(inputCodecContext, inputFormatContext.streams(videoStreamIndex).codecpar());&#xA;&#xA;            AVCodec decoder = avcodec.avcodec_find_decoder(inputCodecContext.codec_id());&#xA;            if (decoder == null || avcodec.avcodec_open2(inputCodecContext, decoder, (PointerPointer) null) &lt; 0) {&#xA;                System.out.println("Failed to open video decoder.");&#xA;                return;&#xA;            }&#xA;&#xA;            // Allocate output format context&#xA;            if (avformat.avformat_alloc_output_context2(outputFormatContext, null, "mpegts", destinationFile.getAbsolutePath()) &lt; 0) {&#xA;                System.out.println("Failed to allocate output format context.");&#xA;                return;&#xA;            }&#xA;&#xA;            // Initialize output codec&#xA;            AVCodec encoder = avcodec.avcodec_find_encoder_by_name("mpeg2video");&#xA;            if (encoder == null) {&#xA;                System.out.println("Failed to find MPEG2 video encoder.");&#xA;                return;&#xA;            }&#xA;&#xA;            outputCodecContext = avcodec.avcodec_alloc_context3(encoder);&#xA;            if (outputCodecContext == null) {&#xA;                System.out.println("Failed to allocate output codec context.");&#xA;                return;&#xA;            }&#xA;            &#xA;            if ((outputFormatContext.oformat().flags() &amp; avformat.AVFMT_GLOBALHEADER) != 0) {&#xA;                outputCodecContext.flags(outputCodecContext.flags() | avcodec.AV_CODEC_FLAG_GLOBAL_HEADER);&#xA;            }&#xA;&#xA;&#xA;            //outputCodecContext.codec_id(avcodec.AV_CODEC_ID_MPEG2VIDEO);&#xA;            outputCodecContext.codec_id(encoder.id());&#xA;            outputCodecContext.codec_type(avutil.AVMEDIA_TYPE_VIDEO);&#xA;            outputCodecContext.width(1920);&#xA;            outputCodecContext.height(1080);&#xA;            outputCodecContext.pix_fmt(avutil.AV_PIX_FMT_YUV420P);&#xA;            outputCodecContext.time_base(avutil.av_make_q(1, 25));&#xA;            outputCodecContext.bit_rate(4000000);&#xA;            outputCodecContext.gop_size(12);&#xA;&#xA;            if ((outputFormatContext.oformat().flags() &amp; avformat.AVFMT_GLOBALHEADER) != 0) {&#xA;                outputCodecContext.flags(outputCodecContext.flags() | avcodec.AV_CODEC_FLAG_GLOBAL_HEADER);&#xA;            }&#xA;&#xA;            &#xA;            &#xA;            if (avcodec.avcodec_open2(outputCodecContext, encoder, (PointerPointer) null) &lt; 0) {&#xA;                System.out.println("Failed to open video encoder.");&#xA;                return;&#xA;            }&#xA;&#xA;            // Create output stream&#xA;            AVStream videoStream = avformat.avformat_new_stream(outputFormatContext, encoder);&#xA;            if (videoStream == null) {&#xA;                System.out.println("Failed to create video stream.");&#xA;                return;&#xA;            }&#xA;&#xA;            avcodec.avcodec_parameters_from_context(videoStream.codecpar(), outputCodecContext);&#xA;            &#xA;            System.out.println("Destination file path before trying to open the file is: " &#x2B; destinationFile);&#xA;&#xA;            if ((outputFormatContext.oformat().flags() &amp; avformat.AVFMT_NOFILE) == 0) {&#xA;                // Ensure the output path has the correct extension&#xA;                String outputPath = destinationFile.getAbsolutePath().replace("\\", "/") &#x2B; ".avchd";&#xA;                System.out.println("Normalized output path: " &#x2B; outputPath);&#xA;&#xA;                // Try opening the output file&#xA;                int ret = avformat.avio_open(outputFormatContext.pb(), outputPath, avformat.AVIO_FLAG_WRITE);&#xA;                if (ret &lt; 0) {&#xA;                    BytePointer errorBuffer = new BytePointer(avutil.AV_ERROR_MAX_STRING_SIZE);&#xA;                    avutil.av_strerror(ret, errorBuffer, errorBuffer.capacity());&#xA;                    System.out.println("Failed to open output file: " &#x2B; errorBuffer.getString());&#xA;                    return;&#xA;                }&#xA;            }&#xA;&#xA;&#xA;            // Write header&#xA;            if (avformat.avformat_write_header(outputFormatContext, (PointerPointer) null) &lt; 0) {&#xA;                System.out.println("Failed to write header to output file.");&#xA;                return;&#xA;            }&#xA;&#xA;&#xA;            // Packet processing loop&#xA;            AVPacket packet = new AVPacket();&#xA;            while (avformat.av_read_frame(inputFormatContext, packet) >= 0) {&#xA;                if (packet.stream_index() == videoStreamIndex) {&#xA;                    if (avcodec.avcodec_send_packet(inputCodecContext, packet) >= 0) {&#xA;                        AVFrame frame = avutil.av_frame_alloc();&#xA;                        while (avcodec.avcodec_receive_frame(inputCodecContext, frame) >= 0) {&#xA;                            if (avcodec.avcodec_send_frame(outputCodecContext, frame) >= 0) {&#xA;                                AVPacket encodedPacket = new AVPacket();&#xA;                                while (avcodec.avcodec_receive_packet(outputCodecContext, encodedPacket) >= 0) {&#xA;                                    encodedPacket.stream_index(videoStream.index());&#xA;                                    avformat.av_interleaved_write_frame(outputFormatContext, encodedPacket);&#xA;                                    avcodec.av_packet_unref(encodedPacket);&#xA;                                }&#xA;                            }&#xA;                            avutil.av_frame_unref(frame);&#xA;                        }&#xA;                        avutil.av_frame_free(frame);&#xA;                    }&#xA;                }&#xA;                avcodec.av_packet_unref(packet);&#xA;            }&#xA;&#xA;            // Write trailer&#xA;            avformat.av_write_trailer(outputFormatContext);&#xA;            System.out.println("Conversion completed successfully.");&#xA;            &#xA;            if (avcodec.avcodec_send_frame(outputCodecContext, null) >= 0) {&#xA;                AVPacket encodedPacket = new AVPacket();&#xA;                while (avcodec.avcodec_receive_packet(outputCodecContext, encodedPacket) >= 0) {&#xA;                    encodedPacket.stream_index(videoStream.index());&#xA;                    avformat.av_interleaved_write_frame(outputFormatContext, encodedPacket);&#xA;                    avcodec.av_packet_unref(encodedPacket);&#xA;                }&#xA;            }&#xA;&#xA;        } catch (Exception e) {&#xA;            e.printStackTrace();&#xA;        } finally {&#xA;            // Cleanup&#xA;            avcodec.avcodec_free_context(inputCodecContext);&#xA;            avcodec.avcodec_free_context(outputCodecContext);&#xA;            avformat.avformat_close_input(inputFormatContext);&#xA;&#xA;            if (outputFormatContext != null &amp;&amp; outputFormatContext.pb() != null) {&#xA;                avformat.avio_closep(outputFormatContext.pb());&#xA;            }&#xA;            avformat.avformat_free_context(outputFormatContext);&#xA;        }&#xA;    }&#xA;    &#xA;    private boolean validateFileCreation(File destinationFile) {&#xA;        // Check if the parent directory exists and is writable&#xA;        File parentDir = destinationFile.getParentFile();&#xA;        if (parentDir == null || !parentDir.exists()) {&#xA;            System.out.println("Parent directory does not exist: " &#x2B; parentDir);&#xA;            return false;&#xA;        }&#xA;        if (!parentDir.canWrite()) {&#xA;            System.out.println("Cannot write to parent directory: " &#x2B; parentDir);&#xA;            return false;&#xA;        }&#xA;&#xA;        // Check if the file exists and is writable&#xA;        if (destinationFile.exists()) {&#xA;            if (!destinationFile.canWrite()) {&#xA;                System.out.println("Destination file is not writable: " &#x2B; destinationFile);&#xA;                return false;&#xA;            }&#xA;        } else {&#xA;            // If the file doesn&#x27;t exist, try to create it to verify writability&#xA;            try {&#xA;                if (!destinationFile.createNewFile()) {&#xA;                    System.out.println("Unable to create destination file: " &#x2B; destinationFile);&#xA;                    return false;&#xA;                }&#xA;                // Delete the file after successful creation to avoid residual files&#xA;                destinationFile.delete();&#xA;            } catch (IOException e) {&#xA;                System.out.println("File creation failed: " &#x2B; e.getMessage());&#xA;                return false;&#xA;            }&#xA;        }&#xA;&#xA;        return true;&#xA;    }&#xA;    &#xA;}&#xA;&#xA;&#xA;

    &#xA;

    A few caveats :

    &#xA;

      &#xA;
    1. I did explore FFmpeg and GStreamer for this project. GStreamer was inconclusive, with available version for it that were too old for use with my current state of STS4.27 and Java 17, even if this version of Java is under long-term support...

      &#xA;

    2. &#xA;

    3. I've used AI to tell me about the options and suggest ways to build this thing, since multimedia handling is very far away from my skillset. I don't have a good conceptual grasp of video formats and how they transfrom from one to another.

      &#xA;

    4. &#xA;

    &#xA;

    The issue, as I have identified it, occurs at these lines :

    &#xA;

     // Ensure the destination file is writable&#xA;                    if (!destinationFile.canWrite()) {&#xA;                        JOptionPane.showMessageDialog(null, "Output file is not writable.", "File Error", JOptionPane.ERROR_MESSAGE);&#xA;                        return;&#xA;                    }&#xA;

    &#xA;

    ^^ And this, while temporarily commented out for testing, it meant to compensate for an issue that occurs here in the conversion function :

    &#xA;

     if ((outputFormatContext.oformat().flags() &amp; avformat.AVFMT_NOFILE) == 0) {&#xA;                // Ensure the output path has the correct extension&#xA;                String outputPath = destinationFile.getAbsolutePath().replace("\\", "/") &#x2B; ".avchd";&#xA;                System.out.println("Normalized output path: " &#x2B; outputPath);&#xA;&#xA;                // Try opening the output file&#xA;                int ret = avformat.avio_open(outputFormatContext.pb(), outputPath, avformat.AVIO_FLAG_WRITE);&#xA;                if (ret &lt; 0) {&#xA;                    BytePointer errorBuffer = new BytePointer(avutil.AV_ERROR_MAX_STRING_SIZE);&#xA;                    avutil.av_strerror(ret, errorBuffer, errorBuffer.capacity());&#xA;                    System.out.println("Failed to open output file: " &#x2B; errorBuffer.getString());&#xA;                    return;&#xA;                }&#xA;            }&#xA;

    &#xA;

    The idea here is that the avio_open() function requires the use of the a valid file path that it can open to be able to write it.

    &#xA;

    Padadoxically, the file conversion seems to work, but the project crashes with a fatal error in the console :

    &#xA;

    Selected file: E:\TestConveresions\sample_960x540.mov&#xA;Save location: E:\TestConveresions&#xA;Converting MOV to AVCHD...&#xA;Destination file path before trying to open the file is: E:\TestConveresions\sample_960x540_20241231&#xA;Normalized output path: E:/TestConveresions/sample_960x540_20241231.avchd&#xA;#&#xA;# A fatal error has been detected by the Java Runtime Environment:&#xA;#&#xA;#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffcffb0868b, pid=11020, tid=14436&#xA;#&#xA;# JRE version: OpenJDK Runtime Environment Temurin-21.0.5&#x2B;11 (21.0.5&#x2B;11) (build 21.0.5&#x2B;11-LTS)&#xA;# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.5&#x2B;11 (21.0.5&#x2B;11-LTS, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)&#xA;# Problematic frame:&#xA;# C  0x00007ffcffb0868b&#xA;#&#xA;# No core dump will be written. Minidumps are not enabled by default on client versions of Windows&#xA;#&#xA;# An error report file with more information is saved as:&#xA;# E:\STS4 Workspace\MMConverter\hs_err_pid11020.log&#xA;[80.882s][warning][os] Loading hsdis library failed&#xA;#&#xA;# If you would like to submit a bug report, please visit:&#xA;#   https://github.com/adoptium/adoptium-support/issues&#xA;# The crash happened outside the Java Virtual Machine in native code.&#xA;# See problematic frame for where to report the bug.&#xA;#&#xA;[AVFormatContext @ 000002528adcea40] Opening &#x27;E:\TestConveresions\sample_960x540.mov&#x27; for reading&#xA;[file @ 000002528ae51c40] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000002528adcea40] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000002528adcea40] ISO: File Type Major Brand: qt  &#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000002528adcea40] Unknown dref type 0x206c7275 size 12&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000002528adcea40] Processing st: 0, edit list 0 - media time: 2002, duration: 400410&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000002528adcea40] Offset DTS by 2002 to make first pts zero.&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000002528adcea40] Setting codecpar->delay to 2 for stream st: 0&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000002528adcea40] Before avformat_find_stream_info() pos: 1320742 bytes read:38225 seeks:1 nb_streams:1&#xA;[h264 @ 000002528ae62780] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 000002528ae62780] Decoding VUI&#xA;[h264 @ 000002528ae62780] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[h264 @ 000002528ae62780] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 000002528ae62780] Decoding VUI&#xA;[h264 @ 000002528ae62780] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[h264 @ 000002528ae62780] nal_unit_type: 6(SEI), nal_ref_idc: 0&#xA;[h264 @ 000002528ae62780] nal_unit_type: 5(IDR), nal_ref_idc: 3&#xA;[h264 @ 000002528ae62780] Format yuv420p chosen by get_format().&#xA;[h264 @ 000002528ae62780] Reinit context to 960x544, pix_fmt: yuv420p&#xA;[h264 @ 000002528ae62780] no picture &#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000002528adcea40] All info found&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000002528adcea40] After avformat_find_stream_info() pos: 51943 bytes read:90132 seeks:2 frames:1&#xA;[h264 @ 000002528ae62780] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 000002528ae62780] Decoding VUI&#xA;[h264 @ 000002528ae62780] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[mpeg2video @ 000002528ae8e700] intra_quant_bias = 96 inter_quant_bias = 0&#xA;&#xA;

    &#xA;

    If I refer to the error log, I get this. It is partial, as I'm not sure SO will take all of it (quite long), but still might have enough to be relevant :

    &#xA;

    Host: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz, 8 cores, 31G,  Windows 11 , 64 bit Build 26100 (10.0.26100.2454)&#xA;&#xA;&#xA;---------------  T H R E A D  ---------------&#xA;&#xA;Current thread (0x00000252d030b340):  JavaThread "AWT-EventQueue-0"        [_thread_in_native, id=14436, stack(0x000000a4e2b00000,0x000000a4e2c00000) (1024K)]&#xA;&#xA;Stack: [0x000000a4e2b00000,0x000000a4e2c00000],  sp=0x000000a4e2bfdf30,  free space=1015k&#xA;Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)&#xA;C  0x00007ffcffb0868b&#xA;&#xA;Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)&#xA;j  org.bytedeco.ffmpeg.global.avformat.avio_open(Lorg/bytedeco/ffmpeg/avformat/AVIOContext;Ljava/lang/String;I)I&#x2B;0&#xA;j  home.multimeida.mmconverter.MMConverterInterface.convertMovToAvchd(Ljava/io/File;Ljava/io/File;)V&#x2B;1120&#xA;j  home.multimeida.mmconverter.MMConverterInterface.lambda$2(Ljavax/swing/JRadioButton;Ljavax/swing/JRadioButton;Ljava/awt/event/ActionEvent;)V&#x2B;347&#xA;j  home.multimeida.mmconverter.MMConverterInterface$$Lambda&#x2B;0x000002528c0c7778.actionPerformed(Ljava/awt/event/ActionEvent;)V&#x2B;13&#xA;j  javax.swing.AbstractButton.fireActionPerformed(Ljava/awt/event/ActionEvent;)V&#x2B;84 java.desktop@21.0.5&#xA;j  javax.swing.AbstractButton$Handler.actionPerformed(Ljava/awt/event/ActionEvent;)V&#x2B;5 java.desktop@21.0.5&#xA;j  javax.swing.DefaultButtonModel.fireActionPerformed(Ljava/awt/event/ActionEvent;)V&#x2B;34 java.desktop@21.0.5&#xA;j  javax.swing.DefaultButtonModel.setPressed(Z)V&#x2B;117 java.desktop@21.0.5&#xA;j  javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Ljava/awt/event/MouseEvent;)V&#x2B;35 java.desktop@21.0.5&#xA;j  java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V&#x2B;64 java.desktop@21.0.5&#xA;j  javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V&#x2B;23 java.desktop@21.0.5&#xA;J 2581 c1 java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V java.desktop@21.0.5 (220 bytes) @ 0x00000252fa62719c [0x00000252fa627020&#x2B;0x000000000000017c]&#xA;J 2580 c1 java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V java.desktop@21.0.5 (22 bytes) @ 0x00000252fa627d9c [0x00000252fa627cc0&#x2B;0x00000000000000dc]&#xA;J 2406 c1 java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V java.desktop@21.0.5 (785 bytes) @ 0x00000252fa670f14 [0x00000252fa670040&#x2B;0x0000000000000ed4]&#xA;J 2325 c1 java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V java.desktop@21.0.5 (129 bytes) @ 0x00000252fa64e93c [0x00000252fa64e8a0&#x2B;0x000000000000009c]&#xA;J 2608 c1 java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/MouseEvent;)V java.desktop@21.0.5 (372 bytes) @ 0x00000252fa61c364 [0x00000252fa61b9e0&#x2B;0x0000000000000984]&#xA;J 2578 c1 java.awt.LightweightDispatcher.processMouseEvent(Ljava/awt/event/MouseEvent;)Z java.desktop@21.0.5 (268 bytes) @ 0x00000252fa628a54 [0x00000252fa6284c0&#x2B;0x0000000000000594]&#xA;J 2474 c1 java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z java.desktop@21.0.5 (73 bytes) @ 0x00000252fa699bbc [0x00000252fa699a60&#x2B;0x000000000000015c]&#xA;J 2325 c1 java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V java.desktop@21.0.5 (129 bytes) @ 0x00000252fa64e914 [0x00000252fa64e8a0&#x2B;0x0000000000000074]&#xA;J 2473 c1 java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V java.desktop@21.0.5 (23 bytes) @ 0x00000252fa699654 [0x00000252fa6994e0&#x2B;0x0000000000000174]&#xA;J 1838 c1 java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V java.desktop@21.0.5 (139 bytes) @ 0x00000252fa3bec64 [0x00000252fa3beb20&#x2B;0x0000000000000144]&#xA;J 1837 c1 java.awt.EventQueue$4.run()Ljava/lang/Void; java.desktop@21.0.5 (60 bytes) @ 0x00000252fa3c0504 [0x00000252fa3c0460&#x2B;0x00000000000000a4]&#xA;J 1836 c1 java.awt.EventQueue$4.run()Ljava/lang/Object; java.desktop@21.0.5 (5 bytes) @ 0x00000252fa3c0a04 [0x00000252fa3c09c0&#x2B;0x0000000000000044]&#xA;J 1778 c1 java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object; java.base@21.0.5 (22 bytes) @ 0x00000252fa4601d4 [0x00000252fa45ffa0&#x2B;0x0000000000000234]&#xA;J 1832 c1 java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V java.desktop@21.0.5 (80 bytes) @ 0x00000252fa44f14c [0x00000252fa44eae0&#x2B;0x000000000000066c]&#xA;J 1846 c1 java.awt.EventDispatchThread.pumpOneEventForFilters(I)V java.desktop@21.0.5 (106 bytes) @ 0x00000252fa3ba544 [0x00000252fa3ba2e0&#x2B;0x0000000000000264]&#xA;j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V&#x2B;35 java.desktop@21.0.5&#xA;j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V&#x2B;11 java.desktop@21.0.5&#xA;j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V&#x2B;4 java.desktop@21.0.5&#xA;j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V&#x2B;3 java.desktop@21.0.5&#xA;j  java.awt.EventDispatchThread.run()V&#x2B;9 java.desktop@21.0.5&#xA;v  ~StubRoutines::call_stub 0x00000252fa08100d&#xA;&#xA;siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), writing address 0x0000000000000000&#xA;&#xA;

    &#xA;

    If anyone has a perspective on this, it'd be appreciated.

    &#xA;

    The catch 22 in this project is that pre-creating the file is not a good idea, since avio_open has a purpose in-built method for that (I tried). Error checking everything about Java's File class in terms of setting pathways and creating and deleting files is not problematic. Likewise, permissions are all fine (Full Control in source and target folders) ; I've tested default C drive folders, which have restritions, to a separate volume and removable media, to no effect. Likewise, FFmpeg requires a forward slash, "/" in file paths, whereas Java does the backslash, generally. That's been handled with the replace method in the above conditioning, also to no effect.

    &#xA;

    The basic contradiction in the project seems to be that the error tries open a file that does not exist, with a valid source and destination file, and if I try to create a placeholder file wiht an acvhd extension at the event handling for the Convert button, it still errors out ; meanwhile, FFmpeg allegedly handles the file creation at its core, but requires a valid path to be passed ; I've tried with and without a filename, with and without an extension. I'm not able to resovle it.

    &#xA;

    The excessive error handling conditions are in an effort to isolate the problem, which I think I've done.

    &#xA;

    There also seems to be a compatibility between mpegts and acvhd, which is why I also had that format specified in the conversion function, without result.

    &#xA;

    I also have the idea to be able to do this without having to install any libraries locally or having to set path variables, which is an aspect that both GStreamer and FFmpeg have.

    &#xA;

    Nearest suggestion I've found is this : integrate ffmpeg with spring boot

    &#xA;

    AI remains hopeless for resolving this issue.

    &#xA;

  • How to Choose a GDPR Compliant Web Analytics Solution

    2 mars 2022, par Matthieu Aubry — Privacy

    Since the launch of GDPR, one big question has lingered around with uncertainty – is Google Analytics GDPR compliant ? The current GDPR enforcement trend happening across the EU is certainly shedding some light on this question.

    Starting with the Austrian Data Protection Authority’s ruling on Google Analytics and more recently, CNIL (the French Data Protection Authority) has followed suit by also ruling Google Analytics illegal to use. Organisations with EU-based web visitors are now scrambling to find a compliant solution.

    The French Data Protection Authority (CNIL) has already started delivering formal notices to websites using Google Analytics, so now is the time to act. According to CNIL, organisations have two options :

    1. Ceasing use of the Google Analytics functionality (under the current conditions) 
    2. Use a compliant web analytics tool that does not transfer data outside the EU

    Getting started 

    For organisations considering migrating to a compliant web analytics tool, I’ve outlined below the things you need to consider when weighing up compliant web analytics tools. Once you’ve made a choice, I’ve also included a step-by-step guide to migrating away from Google Analytics. This guide is useful regardless of which GDPR compliant analytics provider you choose.

    Before getting started, I recommend that you document your findings against the following considerations while reviewing GDPR compliant Google Analytics alternatives. This document can then be shared with your Data Protection Officer (DPO) to get their final recommendation.

    10 key considerations when selecting a GDPR compliant web analytics tools

    Many tools will claim to be GDPR compliant so it’s important that you do your due diligence and review tools against the following considerations. 

    1. Where does the tool store data ? 

    The rulings in France and Austria were based on the fact that Google Analytics stores data in the US, which does not have an adequate level of data protection. Your safest option is to find a tool that legally stores data in the EU.

    You should be able to find out where the data is stored in the organisation’s privacy policy. Generally, data storage information can be found under sections titled “Subprocessors” and “Third-party services”. Check out the Matomo Privacy Policy as an example. 

    If you’re unable to easily find this information or it’s unclear, reach out to the organisation for more information.

    2. Does the tool offer anonymous tracking ?

    Anonymous tracking comes with many benefits, including :

    • The ability to track visitors without a cookie consent screen. Due to the privacy-respecting aspect of cookieless tracking, you don’t need to worry about the extra steps involved with compliant cookie banners.
    • More accurate data. When visitors deny tracking cookies, you lose out on valuable data. With anonymous tracking there is no data lost as you don’t need consent to track.
    • Simplified GDPR compliance. With this enabled, there are fewer steps you need to take to get GDPR compliant and stay GDPR compliant.

    For those reasons, it may be important for you to select a tool that offers anonymous tracking functionalities. The level of anonymous tracking you require will depend on your situation but you should look out for tools that allow you to :

    • Disable fingerprinting 
    • Disable user profiles 
    • Anonymise data
    • Cookieless tracking

    If you want to read more about data anonymization, check out this guide on data anonymization in web analytics.

    3. Does the tool integrate with my existing tech stack ?

    You’ll want to ensure that a new web analytics tool will play well with other tools in your tech stack including things like your CMS (content management system), eCommerce shop, etc. You should list out all the existing tools that currently integrate with your Google Analytics and check that the same integrations can be re-created with the new tool, via integrations or APIs.

    If not, it could become costly trying to connect your existing tech stack to a new solution.

    4. Does the tool offer the same features and insights you are currently using in Google Analytics ? Or more, if necessary ? 

    Just because you are moving to a new web analytics platform, doesn’t mean you have to give up the insights, reports and features you’ve grown accustomed to with Google Analytics. Ensuring that a new platform provides the same features and reports that you value the most will result in a smoother transition away from Google Analytics.

    It’s unlikely that a new tool will have all of the same features as Google Analytics, so I’d recommend listing out and prioritising your business-critical features and reports. 

    If I had to guess, you probably set up Google Analytics years ago because it was the default option. Now is your chance to make the most of this switch from Google Analytics and find a tool that offers additional reports and features that better aligns with your business. If time permits, I’d highly recommend that you consider other features or reports that you might have been missing out on while using Google Analytics.

    Check out this comparison of Google Analytics vs Matomo to see side-by-side feature comparison.

    5. Does the tool accept Google Analytics data imports ? 

    The historical data in Google Analytics is a critical asset for many businesses. Fortunately, some tools accept Google Analytics data imports so you don’t lose all of the data you’ve generated over time.

    However, it’s important to note that any data you import from Google Analytics to a new tool needs to be compliant data. I’ll cover this more below.

    6. Does the tool provide conversion tracking exports ? 

    Do you invest in paid advertising ? If you do, then tracking the conversions from people clicking on these paid ads is critical in assessing your return on investment. Since sending IP addresses or other personal information to the US is illegal under GDPR, we can only assume that this will also apply to advertising pixel/conversion tracking (e.g., Facebook pixel, Google Ads conversion tracking, etc). 

    As an example, Matomo offers conversion tracking exports so you can get a better understanding of ad performance while meeting privacy laws and without requiring consent from users. See how it works with Matomo’s conversion tracking exports

    7. How will you train up your in-house team ? Or can you hire a contractor ?

    This is a common concern of many, and rightfully so. You’ll want to confirm what resources are readily available so you can hit the ground running with your new web analytics tool. If you’d prefer to train up your in-house team, check the provider’s site for training resources, videos, guides, etc.

    If you’d rather hire an external contractor, we recommend heading to LinkedIn, reaching out to your community or asking the provider if they have any recommendations for contractors.

    In addition, check that the provider offers technical support or a forum, in case you have specific questions and need help.   

    8. Does the tool offer self-hosting ? (optional)

    For organisations that want full control over their data and storage location, an on-premise web analytics tool will be the preferred option. From a GDPR perspective, this is also the easiest option for compliance.

    Keep in mind that this requires resources, regular maintenance, technical knowledge and/or technical consultants. If you’re unsure which option is best for your organisation, check out our on-premise vs cloud web analytics comparison breakdown.

    Find out more about self-hosting Matomo.

    9. Is the tool approved by the CNIL for tracking without consent ?

    This is an important step for websites with French users. This step will help narrow down your selection of tools. The CNIL offers a programme to identify web analytics solutions that can be used without tracking consent. The CNIL’s list of recommended web analytics tools can act as your starting point for solutions to review.

    While this step is specific to sites with French users, it can also be helpful for websites with visitors from any other EU country.

    Benefits of consent-free tracking

    There are many benefits of tracking without consent.

    For one, it simplifies GDPR compliance and reduces the chances of GDPR breaches and fines. Cookie consent screens have recently been the target for EU Data Protection Authorities because many websites are unknowingly serving cookie consent screens that do not meet GDPR requirements. 

    Yet another benefit, and quite possibly the most important is more accurate data. Even if a website displays a user-friendly, lawful consent screen, the majority of users will either ignore or reject cookie consent. Legally website owners can’t track anything unless the visitor gives consent. So not having a cookie consent screen ensures that every visit is tracked and your web analytics data is 100% accurate

    Lastly, many visitors have grown fatigued and frustrated with invasive cookie consent screens. Not having one on your site creates a user-friendly experience, which will likely result in longer user sessions and lower bounce rates.

    10. Does the tool offer a Data Processing Agreement (DPA) ? 

    Technically, any GDPR compliant web analytics tool should offer a DPA but for the sake of completeness, I’ve added this as a consideration. Double check that any tools you are looking at provide this legally binding document. This should be located in the Privacy Policy of the web analytics provider, if not reach out to request it.

    As an example, here’s Matomo’s Data Processing Agreement which can be found in our Privacy Policy under Subprocessors. 

    That wraps up the key considerations. When it comes to compliance, privacy and customer data, Matomo leads the way. We are looking forward to helping you achieve GDPR compliance easily. Start your free 21-day trial of Matomo now – no credit card required.

    A step-by-step guide to migrating from Google Analytics

    Once you’ve identified a tool that suits your needs and your Data Protection Officer (DPO) has approved, you’re ready to get started. Here’s a simple step-by-step guide with all the important steps for you to follow :

    1. Before getting started, you should sign or download the Data Processing Agreement (DPA) offered by your new web analytics provider.

    2. Register for the new tool and configure it for compliance. The provider should offer guides on how to configure for GDPR compliance. This will include things like giving your users an easy way to opt-out of all tracking, turning on cookieless tracking or asking users for consent and anonymizing data and IP addresses, for instance.

    3. Inform your organisation about the change. Whether your colleagues use the tool or not, it’s important that you share information about the new tool with your staff. Let them know what the tool will be used for, who will use the tool and how it complies with GDPR. 

    4. Let your DPO know that you’ve removed Google Analytics and have implemented the new tool.

    5. Update your records of processing activities to include the new tool.

    6. Update your privacy policy. You’ll need to include details about the web analytics provider, where the data is stored, what data is being collected, how long the data will be stored and why the data is being collected. The web analytics tool should readily have this information for you.

    As an example, if you decide to use Matomo as your web analytics tool, we provide a Privacy Policy template for you to use on your site and a guide on how to complete your privacy policy under GDPR with Matomo. Note that these are only applicable if you are using Matomo.

    In addition, if the tool has an opt-out feature, you will also need to put the opt-out into the privacy policy (e.g., when using cookieless tracking).

    7. Now, the exciting part. Add the tracking code to your site by following the steps provided by the web analytics tool. 

    If you’re not comfortable with this step, the provider should offer steps to do this and you can share this with your web developer.

    8. Once added, login to your tool and check to see if traffic is being tracked.

    9. If your tool does not offer Google Analytics data imports or you do not need the historical data in your new tool, go to step 11. 

    To plan for your Google Analytics data migration, you’ll first need to establish what historical data is compliant with GDPR.

    For example, you shouldn’t import any data stored beyond the retention period established in your Privacy Policy or any personally identifiable information (PII) like IP addresses that aren’t anonymised. Discuss this further with your DPO.

    10. Once you’ve established what data you can legally import, then you can begin the import. Follow the steps provided by your new web analytics solution provider.

    11. Remove Google Analytics tracking code from your site. This will stop the collection of your visitors data by Google as well as slightly increase the page load speed.

    If you still haven’t made a choice yet, try Matomo free for 21-days and see why over 1 million websites choose Matomo. 

  • Revision 36037 : s’assurer que la class ffmpeg_movie est disponible sinon cela ne sert pas ...

    9 mars 2010, par kent1@… — Log

    s’assurer que la class ffmpeg_movie est disponible sinon cela ne sert pas à grand chose