Recherche avancée

Médias (91)

Autres articles (47)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • 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

Sur d’autres sites (9318)

  • Revision 64742f825d : Merge "Elevate NEWMV mode checking threshold in real time"

    2 juillet 2014, par Yunqing Wang

    Merge "Elevate NEWMV mode checking threshold in real time"

  • Capturing and saving an entire RTP video stream using FFmpeg

    27 juin 2021, par Alexander

    Question

    


    How to capture an entire RTP video stream and save it to a file - without defining the duration, shorter than the original video sequence ?

    


    Background

    


    I am streaming a video sequence over the network with FFmpeg and RTP (football (b) at Xiph) using the following command :

    


    ffmpeg -re -i football.y4m -preset slow -c:v libx264 -bf 0 -g 10 -x264opts scenecut=0  -f rtp -sdp_file video.sdp "rtp://<ip>:<port>"</port></ip>

    &#xA;

    Assuming the destination machine has got access to its own copy of video.sdp, I then capture and save the stream using :

    &#xA;

    ffmpeg -protocol_whitelist file,rtp,udp -i video.sdp -t 00:00:08 <out>.mp4</out>

    &#xA;

    My concern is that the time -t 00:00:08 must always be defined in order to terminate capturing. Moreover, if it is not shorter than the original video sequence (8.67 s), capturing is not automatically terminated.

    &#xA;

    I do not encounter the issue when visualising the received stream with (the entire video is played) :

    &#xA;

    ffplay -protocol_whitelist file,rtp,udp -i video.sdp

    &#xA;

  • Broken Pipe Error [Errno 32] after saving more than ten PNG images using PIL

    6 septembre 2019, par Blinko

    I am using the ffmpeg pipeline to compress a series of png frames and output an mp4 video, while also saving each frame as a separate png image. The problem is that every time I run the script, I get a Broken Pipe error on the 11th image :

    Traceback (most recent call last):
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/ImageFile.py", line 487, in _save
       fh = fp.fileno()
    AttributeError: '_idat' object has no attribute 'fileno'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
     File "gen_clip.py", line 173, in <module>
       main()
     File "gen_clip.py", line 167, in main
       ts_pos = (0,frame.samplesperbeam-50)
     File "/Users/Amanda/Desktop/data/pyARIS.py", line 1028, in make_video
       im.save(pipe.stdin, 'PNG')
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/Image.py", line 1994, in save
       save_handler(self, fp, filename)
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/PngImagePlugin.py", line 868, in _save
       [("zip", (0, 0)+im.size, 0, rawmode)])
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/ImageFile.py", line 502, in _save
       fp.write(d)
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/PngImagePlugin.py", line 730, in write
       self.chunk(self.fp, b"IDAT", data)
     File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/PngImagePlugin.py", line 717, in putchunk
       fp.write(data)
    BrokenPipeError: [Errno 32] Broken pipe
    </module>

    I am not too familiar with PIL or ffmpeg, so I am not sure whether it’s a problem with the pipe parameters that I am passing in or something to do with the code itself. No matter what the starting frame number is, the error always appears after 10 images are saved.

    Here is the array of pipe parameters I’m sending to the command prompt :

    command = ['ffmpeg',
          '-y',
          '-f', 'image2pipe',
          '-vcodec', 'png',
          '-r', '1',
          '-r', str(fps), # frames per second
          '-i', '-', # The input comes from a pipe
          '-an', # Tells FFMPEG not to expect any audio
          '-vcodec', 'mpeg4',
          '-b:v', '5000k',
          '../'+filename+"/"+filename+".mp4",
          '-hide_banner',
          '-loglevel', 'panic']

    This is the loop that generates and saves each image :

       for i in tqdm.tqdm(range(start_frame, end_frame)):
           frame = FrameRead(data, i)
           frame_image = np.zeros([ydim, xdim], dtype=np.uint8)
           frame_image[image_write_rows, image_write_cols] = frame.frame_data[sample_read_rows, sample_read_cols]

           all_frame_data.append(frame.frame_data)
           im = Image.fromarray(cm(frame_image, bytes=True))

           if timestamp == True:
               ts = str(datetime.datetime.fromtimestamp(frame.sonartimestamp/1000000, pytz.timezone('UTC')).strftime('%Y-%m-%d %H:%M:%S'))
               text = "%s\n%d" % (ts, i)
               draw = ImageDraw.Draw(im)
               draw.text(ts_pos,text,font=font, fill = 'white')

           im.save(directory+filename+'/frames/'+str(i)+'_'+str(frame.sonartimestamp)+'_'+filename+'.png'  , "PNG")
           im.save(pipe.stdin, 'PNG')
           j += 1

    I am running this on MacOS, Python 3.6. Help on the cause of the error and/or possible solutions will be greatly appreciated !