Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (60)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (10585)

  • How to fix the problem I'm having with FFmpeg ?

    23 février 2023, par John

    I'm working with the ffmpeg library to convert mp4 video files to mp3 audio files.
Here is my code :

    


    package com.exer;


import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Environment;
import android.widget.Toast;
import com.github.hiteshsondhi88.libffmpeg.ExecuteBinaryResponseHandler;
import com.github.hiteshsondhi88.libffmpeg.FFmpeg;
import com.github.hiteshsondhi88.libffmpeg.FFmpegLoadBinaryResponseHandler;

public class MainActivity extends Activity {
    
    FFmpeg ffmpeg;
    private ProgressDialog progressDialog;
    
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    
        
        
        try {
            setUp();
            String[] command = {
                "-i", getPaths()+"/dir/input.mp4", "-vn", getPaths()+"/dir/output.mp3"
            };
            //convert("ffmpeg -i input.mp4 -vn output.mp3");
            convert(command);
            
        } catch (Exception e) {
            Toast.makeText(getApplicationContext(), e.getCause().toString(), Toast.LENGTH_SHORT).show();
        }
    }
    
    
    public void setUp() throws Exception {
        
        if(ffmpeg == null) {
            
            ffmpeg = FFmpeg.getInstance(this);
            ffmpeg.loadBinary(new FFmpegLoadBinaryResponseHandler(){
                    
            @Override
            public void onFailure() {
                Toast.makeText(getApplicationContext(), "failed to load library", Toast.LENGTH_SHORT).show();   
            }
                    
            @Override
            public void onSuccess() {
                Toast.makeText(getApplicationContext(), "loaded!", Toast.LENGTH_SHORT).show();
            }
                    
            @Override
            public void onStart() {
                        
            }
                    
            @Override
            public void onFinish() {
                        
            }
                    
                    
            });
            
        }
        
    }
    
    
    private void convert(String[] cmd) throws Exception {
        
        ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler(){
            
            @Override
            public void onFailure(String message){
                super.onFailure(message);
            }
            
            @Override
            public void onFinish(){
                super.onFinish();
                Toast.makeText(getApplicationContext(), "finished!", Toast.LENGTH_SHORT).show();
            }
            
            @Override
            public void onStart(){
                super.onStart();
                Toast.makeText(getApplicationContext(), "start conversion...", Toast.LENGTH_SHORT).show();
            }
            
            @Override
            public void onProgress(String message){
                super.onProgress(message);
            }
        });
        
    
    }
    
    private String getPaths() {
        return Environment.getExternalStorageDirectory().getPath();
    }
    
}


    


    When I run the app, the Toast messages are shown :

    


    loaded!
start converting...
finished! as I write them in the functions, apart that nothing else happens the file is not converted what's wrong ?

    


    Here my manifest file :

    


    &lt;?xml version="1.0" encoding="utf-8"?>&#xA;<manifest package="com.exer">&#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;        &#xA;            &#xA;                <action></action>&#xA;&#xA;                <category></category>&#xA;            &#xA;        &#xA;    &#xA;&#xA;</manifest>&#xA;

    &#xA;

    I've tried to delete the specified file on the phone to see what erros I might got, but still those three Toasts.

    &#xA;

  • Can't install FFMPEG using pip

    22 juin 2023, par turrnut

    I tried to install ffmpeg using pip like this

    &#xA;

    pip install ffmpeg&#xA;

    &#xA;

    However I got the following error :

    &#xA;

    Collecting ffmpeg&#xA;  Using cached ffmpeg-1.4.tar.gz (5.1 kB)&#xA;  Preparing metadata (setup.py) ... error&#xA;  error: subprocess-exited-with-error&#xA;&#xA;  &#xD7; python setup.py egg_info did not run successfully.&#xA;  │ exit code: 1&#xA;  ╰─> [34 lines of output]&#xA;      Traceback (most recent call last):&#xA;        File "<string>", line 2, in <module>&#xA;        File "", line 34, in <module>&#xA;        File "C:\Users\vwu20\AppData\Local\Temp\pip-install-rdqrdeeq\ffmpeg_3cdda176f3f04ceea4a14d868e94924e\setup.py", line 13, in <module>&#xA;          setup(&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 87, in setup&#xA;          return distutils.core.setup(**attrs)&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 147, in setup&#xA;          _setup_distribution = dist = klass(attrs)&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 476, in __init__&#xA;          _Distribution.__init__(&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 282, in __init__&#xA;          self.finalize_options()&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 899, in finalize_options&#xA;          for ep in sorted(loaded, key=by_order):&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 898, in <lambda>&#xA;          loaded = map(lambda e: e.load(), filtered)&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\metadata\__init__.py", line 171, in load&#xA;          module = import_module(match.group(&#x27;module&#x27;))&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module&#xA;          return _bootstrap._gcd_import(name[level:], package, level)&#xA;        File "<frozen>", line 1050, in _gcd_import&#xA;        File "<frozen>", line 1027, in _find_and_load&#xA;        File "<frozen>", line 1006, in _find_and_load_unlocked&#xA;        File "<frozen>", line 688, in _load_unlocked&#xA;        File "<frozen>", line 883, in exec_module&#xA;        File "<frozen>", line 241, in _call_with_frames_removed&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\build_app.py", line 37, in <module>&#xA;          from py2app.create_appbundle import create_appbundle&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\create_appbundle.py", line 9, in <module>&#xA;          from py2app.util import make_exec, makedirs, mergecopy, mergetree, skipscm&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\util.py", line 5, in <module>&#xA;          import fcntl&#xA;      ModuleNotFoundError: No module named &#x27;fcntl&#x27;&#xA;      [end of output]&#xA;&#xA;  note: This error originates from a subprocess, and is likely not a problem with pip.&#xA;error: metadata-generation-failed&#xA;&#xA;&#xD7; Encountered error while generating package metadata.&#xA;╰─> See above for output.&#xA;&#xA;note: This is an issue with the package mentioned above, not pip.&#xA;hint: See above for details.&#xA;</module></module></module></frozen></frozen></frozen></frozen></frozen></frozen></lambda></module></module></module></string>

    &#xA;

    The error message says that it's missing a package called fcntl, so i tried to install it using

    &#xA;

    pip install fcntl&#xA;

    &#xA;

    The attempt to install fcntl produce the following error :

    &#xA;

    ERROR: Could not find a version that satisfies the requirement fcntl (from versions: none)&#xA;ERROR: No matching distribution found for fcntl&#xA;

    &#xA;

    Can anyone tell me what I did wrong ? I am using windows 11, python 3.10, pip 23.1.2&#xA;Help would be appreciated.

    &#xA;

  • Encoding video using FFmpeg and FreeImage

    14 mai 2014, par mike

    I have to make a video encoder to encode video using mjpeg codec from many jpgs saved on the disk. I use FreeImage to load images and ffmpeg to encode. Unfortunately, the output video isn’t that what I expect. I can’t play it in MPC. VLC can play it but there is only a single quick flash of the last picture I loaded. I want to have 1 fps video and for example I loaded 4 frames so my video should last 4 seconds.

    Input pictures are in BGR24 pixel format.

    What is more, when I run my code I got swscaler warning that picture format YUVJ420P is deprecated but I cant find another pixel format which is suitable for MJPEG codec.

    Here is my source code :

    AVPixelFormat in_pix_fmt = AV_PIX_FMT_BGR24;
    AVPixelFormat out_pix_fmt = AV_PIX_FMT_YUVJ420P;

    AVCodec *pCodec;
    AVCodecContext *pCodecCtx = NULL;
    int out_size = 0;
    int size, outbuf_size, i, outpic_size, w, h;
    FILE *file;
    const char *videofile_name = "test_video_cpp.avi";
    AVFrame *picture, *outpic;
    uint8_t *outbuf, *picture_buf, *outpic_buf;

    av_register_all();

    pCodec = avcodec_find_encoder(CODEC_ID_MJPEG);
    if (!pCodec)
    {
       cout &lt;&lt; "Codec not found\n\n";
       return 1;
    }

    pCodecCtx = avcodec_alloc_context3(pCodec);
    picture = avcodec_alloc_frame();
    outpic = avcodec_alloc_frame();

    pCodecCtx->codec_id = CODEC_ID_MJPEG;
    pCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO;
    pCodecCtx->pix_fmt = out_pix_fmt;
    pCodecCtx->bit_rate = 400000;
    pCodecCtx->width = 1688;            
    pCodecCtx->height = 728;
    pCodecCtx->time_base.num = 1;          
    pCodecCtx->time_base.den = 1;       //fps
    pCodecCtx->max_b_frames = 0;

    outbuf_size = 500000;
    outbuf = new uint8_t[outbuf_size];

    if (avcodec_open2(pCodecCtx, pCodec, NULL) &lt; 0)     //open codec
    {
       cout &lt;&lt; "Could not open codec\n";
       exit(1);
    }

    file = fopen(videofile_name, "wb");                 //open file
    if (!file)
    {
       cout &lt;&lt; "Could not open " &lt;&lt; videofile_name &lt;&lt; endl;
       exit(1);
    }

    outpic_size = avpicture_get_size(out_pix_fmt, pCodecCtx->width, pCodecCtx->height);
    outpic_buf = new uint8_t[outpic_size];
    cout &lt;&lt; "Outpic size was setted to: " &lt;&lt; outpic_size &lt;&lt; endl;

    size = pCodecCtx->width * pCodecCtx->height;
    picture_buf = new uint8_t[size * 3];


    for (i = 1; i &lt; 5; i++)
    {  
       fflush(stdout);

       stringstream ss;
       ss &lt;&lt; i;
       filename = name + ss.str() + ext;
       path = dir + filename;

       dib = FreeImage_Load(FIF_JPEG, path.c_str(), 0);

       picture_buf = FreeImage_GetBits(dib);

               h = FreeImage_GetHeight(dib);
       w = FreeImage_GetWidth(dib);

       avpicture_fill((AVPicture*)picture, picture_buf, in_pix_fmt, w, h);
       avpicture_fill((AVPicture*)outpic, outpic_buf, out_pix_fmt, pCodecCtx->width, pCodecCtx->height);

       struct SwsContext* fooContext = sws_getContext(w, h, in_pix_fmt, pCodecCtx->width, pCodecCtx->height, out_pix_fmt, SWS_BICUBIC, NULL, NULL, NULL);

       sws_scale(fooContext, picture->data, picture->linesize, 0, pCodecCtx->height, outpic->data, outpic->linesize);

       //encode single frame
       out_size = avcodec_encode_video(pCodecCtx, outpic_buf, outpic_size, outpic);
       cout &lt;&lt; "encoding frame " &lt;&lt; i &lt;&lt; "(size=" &lt;&lt; out_size &lt;&lt; ")\n";
       fwrite(outbuf, 1, out_size, file);

    }

    //encode delayed frames
    for ( ; out_size; i++)
    {
       fflush(stdout);
       out_size = avcodec_encode_video(pCodecCtx, outbuf, outbuf_size, NULL);
       cout &lt;&lt; "write frame " &lt;&lt; i &lt;&lt; "(size=" &lt;&lt; out_size &lt;&lt; ")\n";
       fwrite(outbuf, 1, out_size, file);
    }

    outbuf[0] = 0x00;
    outbuf[1] = 0x00;
    outbuf[2] = 0x01;
    outbuf[3] = 0xb7;
    fwrite(outbuf, 1, 4, file);

    fclose(file);
    delete outbuf;
    avcodec_close(pCodecCtx);
    av_free(pCodecCtx);
    avpicture_free((AVPicture*)picture);
    avpicture_free((AVPicture*)outpic);
    delete picture_buf;
    delete outpic_buf;