Recherche avancée

Médias (1)

Mot : - Tags -/ogv

Autres articles (32)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (6966)

  • IllegalStateException while compressing video at "dequeueOutputBuffer()" [on hold]

    11 juillet 2017, par Mr Narendra

    I’ve also checked a few or more similar posted questions, but none of them was having any satisfying response.

    My requirement is to compress videos in approx. 1-2 minutes.
    The video size restriction in my app is 500 MB and the duration limit is 4 minutes.

    The commands, I have tried -

    -i /storage/sdcard0/Videos/Lat_test.mp4 -r 20 -vcodec mpeg4 -preset ultrafast -c:a copy -tune fastdecode -strict -2 -b:v 150k
    /storage/sdcard0/Videos/output.mp4

    -y -i /storage/sdcard0/Videos/test3.mp4 -crf 24 -vcodec mpeg4 -preset ultrafast -c:a copy -me_method zero -tune fastdecode -tune zerolatency
    -strict -2 -b:v 1000k -pix_fmt yuv420p /storage/sdcard0/Videos/output.mp4

    and a few more mentioned here

    1) https://github.com/Tourenathan-G5organisation/SiliCompressor (the one using MediaCodec, instead of FFMPEG).

    2) https://github.com/lalongooo/VideoCompressor

    When tried with Samsung Galaxy Grand GT-i9082, version 5.0.1 (rooted), it failed with the below error -

    > java.lang.IllegalStateException
    > at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
    > at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:1033)
    > at com.iceteck.silicompressorr.videocompression.MediaController.convertVideo(MediaController.java:491)
    > at com.iceteck.silicompressorr.SiliCompressor.compressVideo(SiliCompressor.java:300)
    > at com.iceteck.silicompressor.SelectPictureActivity$VideoCompressAsyncTask.doInBackground(SelectPictureActivity.java:379)
    > at com.iceteck.silicompressor.SelectPictureActivity$VideoCompressAsyncTask.doInBackground(SelectPictureActivity.java:358)
    > at android.os.AsyncTask$2.call(AsyncTask.java:288)
    > at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    > at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
    > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    > at java.lang.Thread.run(Thread.java:818)

    Please suggest how to resolve this issue.

    Or please suggest any other better video compressing approach / sample / reference, if possible

    I have tried various samples of video compression using FFMPEG, as well as MediaCodec, but none of them are working well. A few are very very slow. and rest gets failed in a few devices.

  • Best approach to real time http streaming to HTML5 video client

    28 juin 2017, par deandob

    I’m really stuck trying to understand the best way to stream real time output of ffmpeg to a HTML5 client using node.js, as there are a number of variables at play and I don’t have a lot of experience in this space, having spent many hours trying different combinations.

    My use case is :

    1) IP video camera RTSP H.264 stream is picked up by FFMPEG and remuxed into a mp4 container using the following FFMPEG settings in node, output to STDOUT. This is only run on the initial client connection, so that partial content requests don’t try to spawn FFMPEG again.

    liveFFMPEG = child_process.spawn("ffmpeg", [
                   "-i", "rtsp://admin:12345@192.168.1.234:554" , "-vcodec", "copy", "-f",
                   "mp4", "-reset_timestamps", "1", "-movflags", "frag_keyframe+empty_moov",
                   "-"   // output to stdout
                   ],  {detached: false});

    2) I use the node http server to capture the STDOUT and stream that back to the client upon a client request. When the client first connects I spawn the above FFMPEG command line then pipe the STDOUT stream to the HTTP response.

    liveFFMPEG.stdout.pipe(resp);

    I have also used the stream event to write the FFMPEG data to the HTTP response but makes no difference

    xliveFFMPEG.stdout.on("data",function(data) {
           resp.write(data);
    }

    I use the following HTTP header (which is also used and working when streaming pre-recorded files)

    var total = 999999999         // fake a large file
    var partialstart = 0
    var partialend = total - 1

    if (range !== undefined) {
       var parts = range.replace(/bytes=/, "").split("-");
       var partialstart = parts[0];
       var partialend = parts[1];
    }

    var start = parseInt(partialstart, 10);
    var end = partialend ? parseInt(partialend, 10) : total;   // fake a large file if no range reques

    var chunksize = (end-start)+1;

    resp.writeHead(206, {
                     'Transfer-Encoding': 'chunked'
                    , 'Content-Type': 'video/mp4'
                    , 'Content-Length': chunksize // large size to fake a file
                    , 'Accept-Ranges': 'bytes ' + start + "-" + end + "/" + total
    });

    3) The client has to use HTML5 video tags.

    I have no problems with streaming playback (using fs.createReadStream with 206 HTTP partial content) to the HTML5 client a video file previously recorded with the above FFMPEG command line (but saved to a file instead of STDOUT), so I know the FFMPEG stream is correct, and I can even correctly see the video live streaming in VLC when connecting to the HTTP node server.

    However trying to stream live from FFMPEG via node HTTP seems to be a lot harder as the client will display one frame then stop. I suspect the problem is that I am not setting up the HTTP connection to be compatible with the HTML5 video client. I have tried a variety of things like using HTTP 206 (partial content) and 200 responses, putting the data into a buffer then streaming with no luck, so I need to go back to first principles to ensure I’m setting this up the right way.

    Here is my understanding of how this should work, please correct me if I’m wrong :

    1) FFMPEG should be setup to fragment the output and use an empty moov (FFMPEG frag_keyframe and empty_moov mov flags). This means the client does not use the moov atom which is typically at the end of the file which isn’t relevant when streaming (no end of file), but means no seeking possible which is fine for my use case.

    2) Even though I use MP4 fragments and empty MOOV, I still have to use HTTP partial content, as the HTML5 player will wait until the entire stream is downloaded before playing, which with a live stream never ends so is unworkable.

    3) I don’t understand why piping the STDOUT stream to the HTTP response doesn’t work when streaming live yet if I save to a file I can stream this file easily to HTML5 clients using similar code. Maybe it’s a timing issue as it takes a second for the FFMPEG spawn to start, connect to the IP camera and send chunks to node, and the node data events are irregular as well. However the bytestream should be exactly the same as saving to a file, and HTTP should be able to cater for delays.

    4) When checking the network log from the HTTP client when streaming a MP4 file created by FFMPEG from the camera, I see there are 3 client requests : A general GET request for the video, which the HTTP server returns about 40Kb, then a partial content request with a byte range for the last 10K of the file, then a final request for the bits in the middle not loaded. Maybe the HTML5 client once it receives the first response is asking for the last part of the file to load the MP4 MOOV atom ? If this is the case it won’t work for streaming as there is no MOOV file and no end of the file.

    5) When checking the network log when trying to stream live, I get an aborted initial request with only about 200 bytes received, then a re-request again aborted with 200 bytes and a third request which is only 2K long. I don’t understand why the HTML5 client would abort the request as the bytestream is exactly the same as I can successfully use when streaming from a recorded file. It also seems node isn’t sending the rest of the FFMPEG stream to the client, yet I can see the FFMPEG data in the .on event routine so it is getting to the FFMPEG node HTTP server.

    6) Although I think piping the STDOUT stream to the HTTP response buffer should work, do I have to build an intermediate buffer and stream that will allow the HTTP partial content client requests to properly work like it does when it (successfully) reads a file ? I think this is the main reason for my problems however I’m not exactly sure in Node how to best set that up. And I don’t know how to handle a client request for the data at the end of the file as there is no end of file.

    7) Am I on the wrong track with trying to handle 206 partial content requests, and should this work with normal 200 HTTP responses ? HTTP 200 responses works fine for VLC so I suspect the HTML5 video client will only work with partial content requests ?

    As I’m still learning this stuff its difficult to work through the various layers of this problem (FFMPEG, node, streaming, HTTP, HTML5 video) so any pointers will be greatly appreciated. I have spent hours researching on this site and the net, and I have not come across anyone who has been able to do real time streaming in node but I can’t be the first, and I think this should be able to work (somehow !).

  • save matplotlib animation error

    27 juillet 2017, par Matt

    I created a program (see below) that takes position, force, and time from a pandas dataframe. The goal is to plot position vs force and animate it based on the time data associated with it.

    The animation is working well so far but I cannot save the animation, either as a gif or mp4. I have read countless solutions online for this sort of problem but none seem to work.

    I am using OS X El Capitan version 10.11.6 and python3.6. I used brew install ffmpeg and brew install mencoder. For both I get the error

    File "animation.py", line 73, in <module>
       ani.save('test.mp4', writer=writer)
     File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/animation.py", line 1009, in save
       for a in all_anim]):
     File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/animation.py", line 1009, in <listcomp>
       for a in all_anim]):
     File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/animation.py", line 1482, in new_saved_frame_seq
       return itertools.islice(self.new_frame_seq(), self.save_count)
    ValueError: Stop argument for islice() must be None or an integer: 0 &lt;= x &lt;= sys.maxsize.
    </listcomp></module>

    I used pip to install the rest of my packages so maybe that is the root of the problem ?

    import matplotlib.pyplot as plt
    import matplotlib.animation as animation
    import pandas
    import sys

    TABLE = pandas.read_csv("Data.csv")


    fig = plt.figure()
    ax1 = fig.add_subplot(1,1,1)

    xs=[]
    ys=[]

    def animate(interval):

       time = interval

       #convert to TIME series to int for handling purposes
       TABLE.TIME = TABLE.TIME.astype(int)

       if time in TABLE.TIME.unique():

           POSIT_series = TABLE[TABLE.TIME == time].POSIT
           POSIT_list = POSIT_series.tolist()
           x = POSIT_list[0]

           FORCE_series = TABLE[TABLE.TIME == time].FORCE
           FORCE_list = FORCE_series.tolist()
           y = FORCE_list[0]

           xs.append(x)
           ys.append(y)

           ax1.clear()
           ax1.plot(xs,ys)
       elif time > TABLE.TIME.max():
           sys.exit("Animation Done")
       return

    FRAMES= TABLE.TIME.astype(int).max()    
    plt.rcParams['animation.ffmpeg_path']='/usr/local/bin/ffmpeg'
    writer = animation.FFMpegWriter()
    ani = animation.FuncAnimation(fig, animate, interval=1, frames=FRAMES, repeat=False)
    plt.show()

    #same error for writer = 'mencoder' and writer ='ffpmeg
    ani.save('test.mp4', writer=writer)