Recherche avancée

Médias (91)

Autres articles (100)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (12821)

  • Output file does not show up after executing ffmpeg command [closed]

    19 février 2024, par davai

    I'm using ffmpeg to combine an MP3 + G file and produce an MP4 file. I've placed the source code / .exe file for 'ffmpeg' in the project folder, and the MP3 + G files are also in the project folder. I also set the MP4 output to show up in the project folder as well. The weird thing is that, initially, I was producing output files, and while trying to tweak the constant rate factor, the MP4 output just stopped showing up entirely. I'm also not receiving any errors while running the code, and it does print out that the file has been successfully created, despite nothing showing up in the project folder.

    


    
        String mp3FilePath = "C:/Users/exampleuser/pfolder/example.mp3";
        String gFilePath = "C:/Users/exampleuser/pfolder/example.cdg";
        String mp4OutputPath = "C:/Users/exampleuser/pfolder/example.mp4";

        try
        {
            String[] command = {
                    "C:/Users/tonih/IdeaProjects/MP3GtoMP4Conversion/ffmpeg/ffmpeg-2024-02-19-git-0c8e64e268-full_build/bin/ffmpeg.exe",
                    "-i", mp3FilePath,       // Input MP3 file
                    "-r", "25",              // Frame rate
                    "-loop", "1",            // Loop input video
                    "-i", gFilePath,         // Input G file
                    "-c:v", "libx264",       // Video codec
                    "-preset", "slow",       // Encoding preset for quality (choose according to your requirement)
                    "-crf", "18",            // Constant Rate Factor (lower is higher quality, typical range 18-28)
                    "-c:a", "aac",           // Audio codec
                    "-b:a", "320k",          // Audio bitrate
                    "-shortest",             // Stop when the shortest stream ends
                    mp4OutputPath            // Output MP4 file
            };

            Process process = Runtime.getRuntime().exec(command);
            process.waitFor();
            System.out.println("MP4 file created successfully: " + mp4OutputPath);
        }
        catch (IOException | InterruptedException e)
        {
            e.printStackTrace();
        }


    


  • Muxing encoder output with custom io in ffmpeg

    3 mai 2021, par MisterSincere

    I am having some basic issues on how to mux my encoder results into a mp4 file. My current approach is to create a custom AVFormatContext, where the DataProvider is the encoder :

    


    AVFormatContext *create_format_context(DataProvider *pDataProvider) {
  AVFormatContext *ctx{avformat_alloc_context()};

  size_t   bufSize{8 * 1024 * 1024};
  uint8_t *avBuffer{(uint8_t*)av_malloc(bufSize)};

  ctx->pb = avio_alloc_context(avBuffer,
                               bufSize,
                               0,
                               pDataProvider,
                               DataProvider::read,
                               nullptr,
                               nullptr);

  ctx->flags |= AVFMT_FLAG_CUSTOM_IO;

  FFMPEG_CALL(avformat_open_input(&ctx, nullptr, nullptr, nullptr));
  return ctx;
}


    


    But I crash on avformat_open_input with the following error message :

    


    


    Invalid data found when processing input

    


    


    It tries to read for the first time from the encoder, but since this is at init-time, the encoder doesn't have any results yet. I figured the problem is that ffmpeg tries to query for some header informations, since it would feel weird to ask for actual data when just opening.
    
How do I provide that header information / where can I learn something about how this header should look like and what else I need to provide for ffmpeg ?
    
Or is there even a completely different approach, because quite honestly I would be happy if I could feed the per frame encoded data directly to ffmpeg instead of through this whole context abstraction.

    


    For context I pasted the muxer class, I guess the progress() function is the most interesting one, here header, source.

    


    Also I call the kinda magic functions

    


    av_register_all();
avcodec_register_all();
avformat_network_init();


    


    before everything else concerning ffmpeg.

    


    The encoder is not written with ffmpeg, but with cuda / the nvidia video sdk for hardware acceleration purposes.

    


  • Array of Bitmaps into Video with ffmpeg

    14 février 2020, par Steve Jobs Kappa

    I’m Facing current porblem.
    I have an Array of 100 Bitmaps. these are Screenshots i took from a view.
    I used JCodec to make it to a video, buts its waay to slow. Im hoping to get better results with FFmpeg

    Now i want to use the FFmpeg Library. Simillar questions were asked but i have no Idea how to use ffmpeg and how i have to use it in my specific case. All i see are weird Complex Commands See :

    File dir = your directory where image stores;
       String filePrefix = "picture"; //imagename prefix
       String fileExtn = ".jpg";//image extention
       filePath = dir.getAbsolutePath();
       File src = new File(dir, filePrefix + "%03d" + fileExtn);// image name should ne picture001, picture002,picture003 soon  ffmpeg takes as input valid

    complexCommand = new String[]"-i", src + "", "-c:v", "libx264", "-c:a", "aac", "-vf", "setpts=2*PTS", "-pix_fmt", "yuv420p", "-crf", "10", "-r", "15", "-shortest", "-y", "/storage/emulated/0/" + app_name + "/Video/" + app_name + "_Video" + number + ".mp4" ;

    The Problem is, that in this case he is using a Path. I need it to be from an Array. And i have no idea what to do with the String (ComplexCommands) :/
    My Bitmaps are like this :

    Bitmap[] bitmaps = new Bitmaps[100] ;

    this is filled later on.

    if anyone is searching on how to do it with JCodec :

    try {
                       out = NIOUtils.writableFileChannel( Environment.getExternalStorageDirectory().getAbsolutePath()+"/***yourpath***/output"+System.currentTimeMillis()+".mp4");
                       // for Android use: AndroidSequenceEncoder

                       AndroidSequenceEncoder encoder = new AndroidSequenceEncoder(out, Rational.R(25, 1));
                       for (int i = 0 ; i < 100 ; i++) {
                           // Generate the image, for Android use Bitmap

                           // Encode the image
                           System.out.println("LOO2P"+i);
                           encoder.encodeImage(bitmaps[i]);
                       }
                       // Finalize the encoding, i.e. clear the buffers, write the header, etc.
                       encoder.finish();

                   } catch (FileNotFoundException e) {
                       System.out.println("fNF");
                       e.printStackTrace();

                   } catch (IOException e) {
                       System.out.println("IOE");
                       e.printStackTrace();
                   } finally {
                       System.out.println("IOSSE");
                       NIOUtils.closeQuietly(out);
                   }