Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (96)

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

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

Sur d’autres sites (13569)

  • How do I download the image with metadata in Python ? [closed]

    19 octobre 2024, par Temp Account

    I am downloading some images in Python from the Airtable API and am trying to make a slideshow with them using ffmpeg. I download the images :

    


    urllib2.urlretrieve(img['url'], "output/images/image_"+str(i)+".jpeg")


    


    However, when I run the following ffmpeg command

    


    ffmpeg -framerate 4/60 -i output/images/image_%d.jpeg output/out.mp4


    


    I get the following error :

    


    ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.2.0-23ubuntu3)
  configuration: --prefix=/usr --extra-version=3ubuntu5 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-l
inux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable
-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribi
di --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enab
le-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheo
ra --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libx
vid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394 --ena
ble-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enab
le-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
[mjpeg @ 0x593283e5e3c0] bits 150 is invalid
[mjpeg @ 0x593283e5e3c0] bits 28 is invalid
[image2 @ 0x593283e5d380] Could not find codec parameters for stream 0 (Video: mjpeg (Lossless), none(bt470bg/unknown/unknown), lossless): uns
pecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, image2, from 'output/images/image_%d.jpeg':
  Duration: 00:01:00.00, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: mjpeg (Lossless), none(bt470bg/unknown/unknown), lossless, 0.07 fps, 0.07 tbr, 0.07 tbn
File 'output/out.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[mjpeg @ 0x593283e5f180] mjpeg: unsupported coding type (cf)
[mjpeg @ 0x593283e5f180] mjpeg: unsupported coding type (c8)
[mjpeg @ 0x593283e5f180] bits 150 is invalid
[vist#0:0/mjpeg @ 0x593283e5f000] Error submitting packet to decoder: Invalid data found when processing input
[mjpeg @ 0x593283e5f180] bits 28 is invalid
[vist#0:0/mjpeg @ 0x593283e5f000] Error submitting packet to decoder: Invalid data found when processing input
[mjpeg @ 0x593283e5f180] mjpeg: unsupported coding type (ce)
[mjpeg @ 0x593283e5f180] mjpeg: unsupported coding type (c6)
[mjpeg @ 0x593283e5f180] unable to decode APP fields: Invalid data found when processing input
    Last message repeated 1 times
[vist#0:0/mjpeg @ 0x593283e5f000] Error submitting packet to decoder: Invalid data found when processing input
[mjpeg @ 0x593283e5f180] unable to decode APP fields: Invalid data found when processing input
[mjpeg @ 0x593283e5f180] invalid id 255
[vist#0:0/mjpeg @ 0x593283e5f000] Error submitting packet to decoder: Invalid data found when processing input
Cannot determine format of input stream 0:0 after EOF
Error marking filters as finished
Error while filtering: Invalid data found when processing input
[vist#0:0/mjpeg @ 0x593283e5f000] Decode error rate 1 exceeds maximum 0.666667
[out#0/mp4 @ 0x593283e603c0] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=N/A bitrate=N/A speed=N/A    
Conversion failed!



    


    However, downloading the images in Chrome then creating the slideshow is successful. The images from Chrome have metadata of the filetype (JPEG), width and height. The images downloaded with Python have no metadata. How do I download that information so that my ffmpeg command will succeed ?

    


    Thanks !

    


  • Xuggle - Concatenate two videos - Error - java.lang.RuntimeException : error -1094995529 decoding audio

    1er avril 2013, par user2232357

    I am using the Xuggle API to concatenate two MPEG videos (with Audio inbuilt in the MPEGs).
    I am referring to the https://code.google.com/p/xuggle/source/browse/trunk/java/xuggle-xuggler/src/com/xuggle/mediatool/demos/ConcatenateAudioAndVideo.java?r=929. (my both inputs and output are MPEGs).

    Getting the bellow error.

    14:06:50.139 [main] ERROR org.ffmpeg - [mp2 @ 0x7fd54693d000] incomplete frame
    java.lang.RuntimeException: error -1094995529 decoding audio
       at com.xuggle.mediatool.MediaReader.decodeAudio(MediaReader.java:549)
       at com.xuggle.mediatool.MediaReader.readPacket(MediaReader.java:469)
       at com.tav.factory.video.XuggleMediaCreator.concatenateAllVideos(XuggleMediaCreator.java:271)
       at com.tav.factory.video.XuggleMediaCreator.main(XuggleMediaCreator.java:446)

    Can anyone help mw with this ??? Thanks in Advance..

    Here is the complete code.

    public String concatenateAllVideos(ArrayList<tavtexttoavrequest> list){
           String finalPath="";


           String sourceUrl1 = "/Users/SSID/WS/SampleTTS/page2/AV_TAVImage2.mpeg";
           String sourceUrl2 = "/Users/SSID/WS/SampleTTS/page2/AV_TAVImage3.mpeg";
           String destinationUrl = "/Users/SSID/WS/SampleTTS/page2/z_AV_TAVImage_Final23.mpeg";

           out.printf("transcode %s + %s -> %s\n", sourceUrl1, sourceUrl2,
             destinationUrl);

           //////////////////////////////////////////////////////////////////////
           //                                                                  //
           // NOTE: be sure that the audio and video parameters match those of //
           // your input media                                                 //
           //                                                                  //
           //////////////////////////////////////////////////////////////////////

           // video parameters

           final int videoStreamIndex = 0;
           final int videoStreamId = 0;
           final int width = 400;
           final int height = 400;

           // audio parameters

           final int audioStreamIndex = 1;
           final int audioStreamId = 0;
           final int channelCount = 1;
           final int sampleRate = 16000 ; // Hz 16000 44100;

           // create the first media reader

           IMediaReader reader1 = ToolFactory.makeReader(sourceUrl1);

           // create the second media reader

           IMediaReader reader2 = ToolFactory.makeReader(sourceUrl2);

           // create the media concatenator

           MediaConcatenator concatenator = new MediaConcatenator(audioStreamIndex,
             videoStreamIndex);

           // concatenator listens to both readers

           reader1.addListener(concatenator);
           reader2.addListener(concatenator);

           // create the media writer which listens to the concatenator

           IMediaWriter writer = ToolFactory.makeWriter(destinationUrl);
           concatenator.addListener(writer);

           // add the video stream

           writer.addVideoStream(videoStreamIndex, videoStreamId, width, height);

           // add the audio stream

           writer.addAudioStream(audioStreamIndex, audioStreamId, channelCount,sampleRate);

           // read packets from the first source file until done

           try {
               while (reader1.readPacket() == null)
                 ;
           } catch (Exception e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
           }

           // read packets from the second source file until done

           try {
               while (reader2.readPacket() == null)
                 ;
           } catch (Exception e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
           }

           // close the writer

           writer.close();


           return finalPath;
       }

       static class MediaConcatenator extends MediaToolAdapter
         {
           // the current offset

           private long mOffset = 0;

           // the next video timestamp

           private long mNextVideo = 0;

           // the next audio timestamp

           private long mNextAudio = 0;

           // the index of the audio stream

           private final int mAudoStreamIndex;

           // the index of the video stream

           private final int mVideoStreamIndex;

           /**
            * Create a concatenator.
            *
            * @param audioStreamIndex index of audio stream
            * @param videoStreamIndex index of video stream
            */

           public MediaConcatenator(int audioStreamIndex, int videoStreamIndex)
           {
             mAudoStreamIndex = audioStreamIndex;
             mVideoStreamIndex = videoStreamIndex;
           }

           public void onAudioSamples(IAudioSamplesEvent event)
           {
             IAudioSamples samples = event.getAudioSamples();

             // set the new time stamp to the original plus the offset established
             // for this media file

             long newTimeStamp = samples.getTimeStamp() + mOffset;

             // keep track of predicted time of the next audio samples, if the end
             // of the media file is encountered, then the offset will be adjusted
             // to this time.

             mNextAudio = samples.getNextPts();

             // set the new timestamp on audio samples

             samples.setTimeStamp(newTimeStamp);

             // create a new audio samples event with the one true audio stream
             // index

             super.onAudioSamples(new AudioSamplesEvent(this, samples,
               mAudoStreamIndex));
           }

           public void onVideoPicture(IVideoPictureEvent event)
           {
             IVideoPicture picture = event.getMediaData();
             long originalTimeStamp = picture.getTimeStamp();

             // set the new time stamp to the original plus the offset established
             // for this media file

             long newTimeStamp = originalTimeStamp + mOffset;

             // keep track of predicted time of the next video picture, if the end
             // of the media file is encountered, then the offset will be adjusted
             // to this this time.
             //
             // You&#39;ll note in the audio samples listener above we used
             // a method called getNextPts().  Video pictures don&#39;t have
             // a similar method because frame-rates can be variable, so
             // we don&#39;t now.  The minimum thing we do know though (since
             // all media containers require media to have monotonically
             // increasing time stamps), is that the next video timestamp
             // should be at least one tick ahead.  So, we fake it.

             mNextVideo = originalTimeStamp + 1;

             // set the new timestamp on video samples

             picture.setTimeStamp(newTimeStamp);

             // create a new video picture event with the one true video stream
             // index

             super.onVideoPicture(new VideoPictureEvent(this, picture,
               mVideoStreamIndex));
           }

           public void onClose(ICloseEvent event)
           {
             // update the offset by the larger of the next expected audio or video
             // frame time

             mOffset = Math.max(mNextVideo, mNextAudio);

             if (mNextAudio &lt; mNextVideo)
             {
               // In this case we know that there is more video in the
               // last file that we read than audio. Technically you
               // should pad the audio in the output file with enough
               // samples to fill that gap, as many media players (e.g.
               // Quicktime, Microsoft Media Player, MPlayer) actually
               // ignore audio time stamps and just play audio sequentially.
               // If you don&#39;t pad, in those players it may look like
               // audio and video is getting out of sync.

               // However kiddies, this is demo code, so that code
               // is left as an exercise for the readers. As a hint,
               // see the IAudioSamples.defaultPtsToSamples(...) methods.
             }
           }

           public void onAddStream(IAddStreamEvent event)
           {
             // overridden to ensure that add stream events are not passed down
             // the tool chain to the writer, which could cause problems
           }

           public void onOpen(IOpenEvent event)
           {
             // overridden to ensure that open events are not passed down the tool
             // chain to the writer, which could cause problems
           }

           public void onOpenCoder(IOpenCoderEvent event)
           {
             // overridden to ensure that open coder events are not passed down the
             // tool chain to the writer, which could cause problems
           }

           public void onCloseCoder(ICloseCoderEvent event)
           {
             // overridden to ensure that close coder events are not passed down the
             // tool chain to the writer, which could cause problems
           }
         }
    </tavtexttoavrequest>
  • MoviePy error : failed to read the first frame of video file ****. That might mean that the file is corrupted

    14 juillet 2022, par Udit Hari Vashisht

    I am trying to reverse a video using MoviePy. My code is as under : -

    &#xA;

    from moviepy.editor import VideoFileClip&#xA;from moviepy.video.fx.all import time_mirror&#xA;&#xA;clip = VideoFileClip("udit.mp4")&#xA;&#xA;clip = clip.fx(time_mirror)&#xA;&#xA;clip.write_videofile("reversed.mp4")&#xA;

    &#xA;

    But, when I run it I get the following error :-

    &#xA;

    Traceback (most recent call last):&#xA;  File "/Users/uditvashisht/projects/experiments/script.py", line 6, in <module>&#xA;    clip = clip.fx(time_mirror)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 212, in fx&#xA;    return func(self, *args, **kwargs)&#xA;  File "", line 2, in time_mirror&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 54, in requires_duration&#xA;    return f(clip, *a, **k)&#xA;  File "", line 2, in time_mirror&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 29, in apply_to_mask&#xA;    newclip = f(clip, *a, **k)&#xA;  File "", line 2, in time_mirror&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 41, in apply_to_audio&#xA;    newclip = f(clip, *a, **k)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/video/fx/time_mirror.py", line 13, in time_mirror&#xA;    return self.fl_time(lambda t: self.duration - t, keep_duration=True)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 187, in fl_time&#xA;    return self.fl(lambda gf, t: gf(t_func(t)), apply_to,&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 136, in fl&#xA;    newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))&#xA;  File "", line 2, in set_make_frame&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 14, in outplace&#xA;    f(newclip, *a, **k)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/video/VideoClip.py", line 644, in set_make_frame&#xA;    self.size = self.get_frame(0).shape[:2][::-1]&#xA;  File "", line 2, in get_frame&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 89, in wrapper&#xA;    return f(*new_a, **new_kw)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 93, in get_frame&#xA;    return self.make_frame(t)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 136, in <lambda>&#xA;    newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 187, in <lambda>&#xA;    return self.fl(lambda gf, t: gf(t_func(t)), apply_to,&#xA;  File "", line 2, in get_frame&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 89, in wrapper&#xA;    return f(*new_a, **new_kw)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 93, in get_frame&#xA;    return self.make_frame(t)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/video/io/VideoFileClip.py", line 113, in <lambda>&#xA;    self.make_frame = lambda t: self.reader.get_frame(t)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/video/io/ffmpeg_reader.py", line 184, in get_frame&#xA;    result = self.read_frame()&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/video/io/ffmpeg_reader.py", line 133, in read_frame&#xA;    raise IOError(("MoviePy error: failed to read the first frame of "&#xA;OSError: MoviePy error: failed to read the first frame of video file udit.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Please update to a recent version from the website&#xA;</lambda></lambda></lambda></module>

    &#xA;

    I have tried the code on both Mac and Windows PC. The other functionality of MoviePy works fine, but I am not able to reverse the video. Both of my systems have ImageMagick and FFMPEG installed.

    &#xA;