Recherche avancée

Médias (0)

Mot : - Tags -/diogene

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (54)

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

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (5890)

  • 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 encode 25fps

    20 novembre 2020, par Vadik Jony

    i am not a programmer, but a part of my job is recoding. The person befor me left a script that recodes videos.
THE CURRENT PROBLEM : i need to add to the script the line to recode any video to 25 fps. I tried adding -filter:v fps=fps=25 to the script and it works BUT it ignores all other recoding settings. So i would be very happy if someone could help. Sorry for my trivial language, as i said - i am not a programmer :(
HERE IS THE SCRIPT :

    


    import os, subprocess


DIR = r"\\server-01\E\_NEW CONTENT\_Current Time\Actual Programs" 


EXP = r"\\server-01\D\_RENDERED CONTENT\Current Time" 
print ( "=-===-=-=-="  )

ALLDIR =  os.listdir(DIR)
#ext = ".mp4"
#ext = ".mov"
ext = ".mpg"

FL0 = [x for x in ALLDIR if x.endswith("mpg") or x.endswith("mp4") or x.endswith("mxf") or x.endswith("mov") ]


CL = len(FL0)
print ( "Amount of files: ", CL )



#if pres_scaler
#Deint = True
Deint = False 
crop = False
#crop = True
scale = True
#scale = False
#recode = False
recode = True
interlaced_tff = False
cmdlist = []

for i in range(0, CL):
#for i in range(0, 1):
#for i in range(12, CL):
    vfs = []

cur_name = FL0[i]
print ("Input file path: ", cur_name)

new_name = os.path.splitext(cur_name)[0] + ".mp4"
PATH = DIR + os.sep + cur_name

EXPATH = EXP + os.sep + new_name

if Deint:
    #yadif = " -vf \"yadif=0:0:0\" "
    vfs.append("yadif=0:0:0")
    #vfs.append("drawbox=x=0:y=0:w=720:h=2:color=black:t=max")
    #yadif = " -vf \"yadif=0:0:0,drawbox=x=0:y=0:w=720:h=4:color=black:t=max\" "
else : yadif = ""
if interlaced_tff:
    vfs.append("fieldorder=tff" )
if crop:
    vfs.append("crop=720:432:0:72" )
if scale:
    vfs.append("scale=720x576" )
if len(vfs) > 0:
    vfcmd = "-vf \"" + ",".join(vfs) + "\""
else: vfcmd = ""
print (vfcmd)
cmd = "ffmpeg -hide_banner -i \"" + PATH + "\" " + vfcmd 

if recode:
    
    cmd = cmd + ' -aspect "16:9" -profile:v main -c:v libx264 -pix_fmt yuv420p -filter:v fps=fps=25  '
    if interlaced_tff:
        cmd = cmd + " -flags +ildct+ilme -x264opts tff=1 "
    cmd = cmd + '   -crf 19  -b:a 192k  -ar 48000 -ac 2 '
else: 
    cmd = cmd + " -c:v copy " + " -af \"volume=2\" -ar 48000 " 


cmd = cmd + "\"" + EXPATH + "\""

print ( cmd )
cmdlist.append(cmd)
print ( "=-===-=-=-=" )
subprocess.call(cmd)


    


    and here is the text i am getting from FFMPEG :

    


    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\\server-01\E\_NEW 
CONTENT\_Current Time\Actual Programs\PROG_Detali_80_Robopes_na_zavode_Ford_ 1017.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2020-10-17T05:10:47.000000Z
  Duration: 00:23:22.28, start: 0.000000, bitrate: 15331 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 14999 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
  creation_time   : 2020-10-17T05:10:47.000000Z
  handler_name    : ?Mainconcept Video Media Handler
  encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
    Metadata:
      creation_time   : 2020-10-17T05:10:47.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
Only '-vf fps=fps=25' read, ignoring remaining -vf options: Use ',' to separate filters
Only '-af (null)' read, ignoring remaining -af options: Use ',' to separate filters
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0000016645a43040] using SAR=1/1
[libx264 @ 0000016645a43040] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0000016645a43040] profile Main, level 4.0, 4:2:0, 8-bit
[libx264 @ 0000016645a43040] 264 - core 159 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 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=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=19.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '\\server-01\D\_RENDERED CONTENT\Current     Time\PROG_Detali_80_Robopes_na_zavode_Ford_ 1017.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    encoder         : Lavf58.39.101
    Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2020-10-17T05:10:47.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : Lavc58.73.102 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      creation_time   : 2020-10-17T05:10:47.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
      encoder         : Lavc58.73.102 aac
frame=  217 fps= 23 q=24.0 size=   10496kB time=00:00:08.64 bitrate=9951.8kbits/s speed=0.926x    


    


  • ffmpeg overlay not showing on first frame

    5 mai 2016, par Nic Wilson

    I’m trying to use ffmpeg to overlay a 720x720 video (previd.mp4) onto a background image (bg.jpg). I have it working except that the first frame of the video that is created shows the background only for a frame before the overlay video is shown on top of it.

    This is what I’m using to create the video and overlay :

    ffmpeg -loop 1 -i bg.jpg -i previd.mp4 -filter_complex "[1:v]scale=-1:1080[a]; [0:v][a]overlay=(main_w/2)-(overlay_w/2):0:shortest=1[video]" -map "[video]" -map 1:a -codec:a copy vid.mp4

    ffmpeg version 3.0.2-tessus Copyright (c) 2000-2016 the FFmpeg developers
     built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
     configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --as=yasm --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb
     libavutil      55. 17.103 / 55. 17.103
     libavcodec     57. 24.102 / 57. 24.102
     libavformat    57. 25.100 / 57. 25.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 31.100 /  6. 31.100
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    [mjpeg @ 0x7fa934808600] Changing bps to 8
    Input #0, image2, from 'bg.jpg':
     Duration: 00:00:00.04, start: 0.000000, bitrate: 16835 kb/s
       Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'previd_2_0.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.25.100
     Duration: 00:00:06.57, start: 0.023220, bitrate: 1395 kb/s
       Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x720, 1261 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 131 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    [swscaler @ 0x7fa93400b000] deprecated pixel format used, make sure you did set range correctly
    [libx264 @ 0x7fa934001200] using SAR=1/1
    [libx264 @ 0x7fa934001200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x7fa934001200] profile High, level 4.0
    [libx264 @ 0x7fa934001200] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'vid0.mp4':
     Metadata:
       encoder         : Lavf57.25.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
       Metadata:
         encoder         : Lavc57.24.102 libx264
       Side data:
         unknown side data type 10 (24 bytes)
       Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 131 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 (mjpeg) -> overlay:main
     Stream #1:0 (h264) -> scale
     overlay -> Stream #0:0 (libx264)
     Stream #1:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame=   26 fps=0.0 q=0.0 size=       0kB time=00:00:01.32 bitrate=   0.3kbits/sframe=   49 fps= 48 q=0.0 size=       0kB time=00:00:02.20 bitrate=   0.2kbits/sframe=   69 fps= 45 q=28.0 size=     146kB time=00:00:03.01 bitrate= 396.3kbits/frame=   92 fps= 45 q=28.0 size=     315kB time=00:00:03.94 bitrate= 654.7kbits/frame=  115 fps= 45 q=28.0 size=     514kB time=00:00:04.87 bitrate= 863.3kbits/frame=  137 fps= 45 q=28.0 size=     677kB time=00:00:05.73 bitrate= 966.9kbits/frame=  155 fps= 43 q=28.0 size=     831kB time=00:00:06.50 bitrate=1046.8kbits/frame=  164 fps= 34 q=-1.0 Lsize=    1812kB time=00:00:06.57 bitrate=2259.0kbits/s speed=1.35x    
    video:1700kB audio:106kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.344859%
    [libx264 @ 0x7fa934001200] frame I:1     Avg QP:20.13  size: 36046
    [libx264 @ 0x7fa934001200] frame P:91    Avg QP:24.37  size: 15003
    [libx264 @ 0x7fa934001200] frame B:72    Avg QP:24.43  size:  4709
    [libx264 @ 0x7fa934001200] consecutive B-frames: 38.4%  8.5%  1.8% 51.2%
    [libx264 @ 0x7fa934001200] mb I  I16..4: 30.2% 67.1%  2.7%
    [libx264 @ 0x7fa934001200] mb P  I16..4:  8.6% 17.6%  0.8%  P16..4: 16.6%  3.1%  0.9%  0.0%  0.0%    skip:52.3%
    [libx264 @ 0x7fa934001200] mb B  I16..4:  0.7%  1.3%  0.1%  B16..8: 21.3%  1.2%  0.1%  direct: 0.7%  skip:74.7%  L0:44.5% L1:54.2% BI: 1.4%
    [libx264 @ 0x7fa934001200] 8x8 transform intra:65.0% inter:93.5%
    [libx264 @ 0x7fa934001200] coded y,uvDC,uvAC intra: 32.3% 45.6% 4.6% inter: 4.3% 8.5% 0.0%
    [libx264 @ 0x7fa934001200] i16 v,h,dc,p: 30% 30%  5% 35%
    [libx264 @ 0x7fa934001200] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 25% 14%  4%  5%  5%  5%  5%  4%
    [libx264 @ 0x7fa934001200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 27% 11%  3%  7%  5%  5%  3%  2%
    [libx264 @ 0x7fa934001200] i8c dc,h,v,p: 52% 20% 22%  6%
    [libx264 @ 0x7fa934001200] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x7fa934001200] ref P L0: 74.9%  8.3% 12.6%  4.2%
    [libx264 @ 0x7fa934001200] ref B L0: 92.4%  6.8%  0.9%
    [libx264 @ 0x7fa934001200] ref B L1: 97.5%  2.5%
    [libx264 @ 0x7fa934001200] kb/s:2122.37