Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (111)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Les notifications de la ferme

    1er décembre 2010, par

    Afin d’assurer une gestion correcte de la ferme, il est nécessaire de notifier plusieurs choses lors d’actions spécifiques à la fois à l’utilisateur mais également à l’ensemble des administrateurs de la ferme.
    Les notifications de changement de statut
    Lors d’un changement de statut d’une instance, l’ensemble des administrateurs de la ferme doivent être notifiés de cette modification ainsi que l’utilisateur administrateur de l’instance.
    À la demande d’un canal
    Passage au statut "publie"
    Passage au (...)

  • Initialisation de MediaSPIP (préconfiguration)

    20 février 2010, par

    Lors de l’installation de MediaSPIP, celui-ci est préconfiguré pour les usages les plus fréquents.
    Cette préconfiguration est réalisée par un plugin activé par défaut et non désactivable appelé MediaSPIP Init.
    Ce plugin sert à préconfigurer de manière correcte chaque instance de MediaSPIP. Il doit donc être placé dans le dossier plugins-dist/ du site ou de la ferme pour être installé par défaut avant de pouvoir utiliser le site.
    Dans un premier temps il active ou désactive des options de SPIP qui ne le (...)

Sur d’autres sites (7370)

  • How to fix video in gallery from not playing (probable cause encoding from ffmpeg)

    30 avril 2020, par Nathan Sinclair

    I'm setting up a video stream by which I can download a video into the Android gallery, so that I can play it back later.
I have a problem with playing the video back from gallery. The same problem arises when trying to view the url in a videoview.

    



    video information from ffmpeg displays this.

    



    Input #0, mpjpeg, from '':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 0x1cab5e0] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x1c6f030] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x1c6f030] profile Constrained Baseline, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x1c6f030] 264 - core 157 r2969 d4099dd - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=0 ref=2 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=6 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=30 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf58.33.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 720x406, q=-1--1, 30 fps, 15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.59.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Error opening file out.mp4: IsoMedia File is truncated28.56 bitrate= 734.1kbits/s speed=0.478x
[pid: 5138|app: 0|req: 1/1] 192.168.178.21 () {32 vars in 406 bytes} [Mon Oct  7 01:12:17 2019] GET /stop => generated 39 bytes in 152 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 0)
frame=  899 fps= 15 q=-1.0 Lsize=    2779kB time=00:00:29.93 bitrate= 760.6kbits/s speed=0.49x
video:2775kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.157041%


    



    I have attempted to follow this article. Android MediaPlayer error (1, -2147483648)

    



    I'm using FFMpeg to record from a mjpeg stream into a file, which then is hosted by a uwsgi/flask server into a convenient url : http://ipaddress/video.mp4

    



    Thus far ive been able to open the video fine using chrome in Android.

    



    my FFMPEG command looks like this :

    



    ffmpeg -i $1 -crf 18 -r 30 -vf "scale=720x406, setpts='1/(30*TB) * (N + 0.05 * sin(N*2*PI/25))', fps=fps=30" -profile:v baseline -pix_fmt yuv420p -f mp4 -preset fast out.mp4


    



    I thought it may have something to do with the transmission of the file. I'm using an android library called volley to send the url so it can be downloaded as a file on the Android. Then it is subsequently put in gallery. This is when I began to experience the problems. I wanted to be thorough, so tried to find out if the file contents was the issue. This is because when displaying it on gallery, there is no width or height information, or even duration. I have come to suspect something is at issue with ffmpeg. I'm not cutting out that it could be keeping the file from opening if it can't find it's normal file properties.

    



    The volley code for the downloaded file is as follows :

    



     @Override
    public void onResponse(byte[] response) {
        try {
            if (response!=null) {

                File file = createVideoFile();

                FileOutputStream stream = new FileOutputStream(file);
                try {
                    stream.write(response);
                } finally {
                    stream.close();
                }

                addToGallery(file.getAbsolutePath());
                MediaScannerConnection.scanFile(this, new String[]{file.getAbsolutePath()}, null, (path, uri) -> {
                    Intent intent = new Intent (context, VideoActivity.class);
                    intent.setData(uri);
                    startActivity(intent);

                });


                Toast.makeText(this, "Download complete.", Toast.LENGTH_LONG).show();
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            Log.d("KEY_ERROR", "UNABLE TO DOWNLOAD FILE");
            e.printStackTrace();
        }
    }

private void addToGallery(String path) throws FileNotFoundException {
        MediaScannerConnection.scanFile(context, new String[]{

                        path},

                null, new MediaScannerConnection.OnScanCompletedListener() {

                    public void onScanCompleted(String path, Uri uri)

                    {

                        Log.e(TAG, "file" + path + " was scanned successfully");

                    }

                });

        Uri uri = Uri.parse("file:///" + path);
        Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri);
        context.sendBroadcast(intent);

        }


    



    I did have a VideoView to display it, as pertaining to a code example i found to download videos using volley.

    



    https://github.com/coderminion/AndroidVolleyLib

    


  • How to improve the sharpness of the output video on centOS ?

    11 octobre 2019, par Mads Lee

    I’m using the same ffmpeg cmd on Windows and centOS to add timecode for the input video, the output video on centOS has low sharpness and mosaic.

    ffmpeg version :

    ffmpeg on Windows: 4.1.3 built with gcc 8.3.1 (gcc) 20190414

    ffmpeg on centOS: 4.1.0 built with gcc 5.8.5(gcc) 20150623 (Red Hat 4.8.5-16)

    ffmpeg cmd :

    ffmpeg -i \input.mp4 -vf drawtext="timecode='00\:00\:00\:00':rate=30:x=10:y=10:text=qwer:fontsize=50:fontcolor=yellow:boxcolor=black" \output.mp4

    Video screenshot :

    output video on Windows

    output video on centOS

    full log on centOS :

    [root@3b8e5c174983 installfile]# ls
    ffmpeg-4.1.3  ffmpeg-4.1.3.tar.gz  input.mp4  yasm-1.3.0  yasm-1.3.0.tar.gz
    [root@3b8e5c174983 installfile]# ffmpeg -i /installfile/input.mp4  -vf drawtext="fontfile=/usr/share/fonts/lyx/simhei.ttf:timecode='00\:00\:00\:00':rate=30:x=10:y=10:text=qwer:fontsize=50:fontcolor=black" /installfile/output.mp4
    ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
     built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-16)
     configuration: --enable-libfreetype
     libavutil      56. 22.100 / 56. 22.100
     libavcodec     58. 35.100 / 58. 35.100
     libavformat    58. 20.100 / 58. 20.100
     libavdevice    58.  5.100 / 58.  5.100
     libavfilter     7. 40.101 /  7. 40.101
     libswscale      5.  3.100 /  5.  3.100
     libswresample   3.  3.100 /  3.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/installfile/input.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.25.100
     Duration: 00:00:25.68, start: 0.000000, bitrate: 3620 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt709/bt709), 1920x1080, 3490 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
     Stream #0:1 -> #0:1 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    Output #0, mp4, to '/installfile/output.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf58.20.100
       Stream #0:0(und): Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 1920x1080, q=2-31, 200 kb/s, 30 fps, 15360 tbn, 30 tbc (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Lavc58.35.100 mpeg4
       Side data:
         cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
         encoder         : Lavc58.35.100 aac
    frame=  769 fps=108 q=31.0 Lsize=   10290kB time=00:00:25.70 bitrate=3279.4kbits/s speed=3.62x    
    video:9870kB audio:397kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.222400%
    [aac @ 0x37dbec0] Qavg: 2346.057
    [root@3b8e5c174983 installfile]#

    it’s about the version of ffmpeg ?

  • YouTube_dl doesn't find ffmpeg

    10 octobre 2019, par user702846

    I would like to download a set of youtube file as audio, mp3.

    import youtube_dl

    ydl_opts = {
       'format': 'bestaudio/best',
       'postprocessors': [{
           'key': 'FFmpegExtractAudio',
           'preferredcodec': 'mp3',
           'preferredquality': '192',
       }],
    }
    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
       ydl.download(['https://www.youtube.com/watch?v=cmNEDz7YZSw'])

    It successfully download the file as m4a - however complains about ffmpeg installation.

    ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.

    I do have ffmpeg installed and located at /usr/local/bin/ffmpeg and also have added to my PATH using

    os.environ["PATH"] += '/usr/local/bin/ffmpeg'

    but still the error is there. I am using MacOS Mojave and my ffmpeg specification are as following,

    fmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
     built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
     configuration: --disable-encoder=vorbis --enable-libvorbis --enable-libmp3lame --disable-x86asm