
Recherche avancée
Autres articles (47)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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 ;
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)
Sur d’autres sites (5487)
-
Playing RTP stream on Android 4.1.2 (Jelly Bean) [closed]
27 décembre 2024, par Homie_TomieI'll try to keep it quick. Using FFMPEG I started a stream on my PC. Here is the code :


import subprocess

def start_stream():
 command = [
 'ffmpeg',
 '-f', 'gdigrab', # Desktop capture (Windows)
 '-framerate', '15', # Low framerate for higher performance
 '-i', 'desktop', # Capture desktop
 '-c:v', 'libx264', # Video codec (H.264)
 '-preset', 'ultrafast', # Ultra-fast encoding preset for minimal latency
 '-tune', 'zerolatency', # Zero latency for real-time streaming
 '-x264opts', 'keyint=15:min-keyint=15:no-scenecut', # Frequent keyframes
 '-b:v', '500k', # Low bitrate to minimize data usage and reduce latency
 '-s', '800x480', # Resolution fits phone screen and helps performance
 '-max_delay', '0', # No buffering, instant frame output
 '-flush_packets', '1', # Flush packets immediately after encoding
 '-f', 'rtp', # Use mpegts as the container for RTP stream
 'rtp://192.168.72.26:1234', # Stream over UDP to localhost on port 1234
 '-sdp_file', 'stream.sdp' # Create SDP file
 ]
 
 try:
 print("Starting stream...")
 subprocess.run(command, check=True)
 except subprocess.CalledProcessError as e:
 print(f"Error occurred: {e}")
 except KeyboardInterrupt:
 print("\nStream interrupted")

if __name__ == "__main__":
 print("Starting screen capture...")
 start_stream()



Now, when I start the stream I can connect to it in VLC when I open up the stream.sdp file. Using the same method I can open up the stream on my iPhone, but when I try to open it on my old Android phone the stream connects but the screen is black. However, when I turn the screen I can see the first frame that was sent to the phone. Why does the stream not work ?


I will be thankful for any and all advice :)


-
FFmpeg c api create encoder for AV_CODEC_ID_H264 crash on Windows
30 avril 2023, par Guanyuming HeI'm using ffmpeg (version 5.1.2) to clip a mp4 video per frame so I need to decode and encode it. However, when I'm creating the encoder for its video stream, the program always crashes at the call to
avio_open2()
, after H264 gives this error message :

[h264_mf @ 0000025C1EBC1900] could not set output type (80004005)





The configuration (time_base, pix_fmt, width, height) of the codec context of the encoder is copied from the decoder, and I checked if the pixel format is supported by finding if it's in
codec->pix_fmts
.

I find that the problem does not involve all my other pieces of code, because this minimal program can duplicate the same problem :


extern "C"
{
#include <libavcodec></libavcodec>avcodec.h>
}

int main()
{
 auto codec = avcodec_find_encoder(AV_CODEC_ID_H264);
 auto codec_ctx = avcodec_alloc_context3(codec);

 codec_ctx->pix_fmt = AV_PIX_FMT_YUV420P;
 codec_ctx->width = 2560;
 codec_ctx->height = 1440;
 codec_ctx->time_base.num = 1; codec_ctx->time_base.den = 180000;

 avcodec_open2(codec_ctx, codec, NULL);

 return 0;
}



Then I suspect if it's a bug of ffmpeg. My environment is Windows 11 64-bit, Visual Studio 2022. The ffmpeg library is obtained from vcpkg, as shown in the following image :




-
matplotlib 3D linecollection animation gets slower over time
15 juin 2021, par Vignesh DesmondI'm trying to animate a 3d line plot for attractors, using Line3DCollection. The animation is initally fast but it gets progressively slower over time. A minimal example of my code :


def generate_video(nframes):

 fig = plt.figure(figsize=(16, 9), dpi=120)
 canvas_width, canvas_height = fig.canvas.get_width_height()
 ax = fig.add_axes([0, 0, 1, 1], projection='3d')

 X = np.random.random(nframes)
 Y = np.random.random(nframes)
 Z = np.random.random(nframes)

 cmap = plt.cm.get_cmap("hsv")
 line = Line3DCollection([], cmap=cmap)
 ax.add_collection3d(line)
 line.set_segments([])

 def update(frame):
 i = frame % len(vect.X)
 points = np.array([vect.X[:i], vect.Y[:i], vect.Z[:i]]).transpose().reshape(-1,1,3)
 segs = np.concatenate([points[:-1],points[1:]],axis=1)
 line.set_segments(segs)
 line.set_array(np.array(vect.Y)) # Color gradient
 ax.elev += 0.0001
 ax.azim += 0.1

 outf = 'test.mp4'
 cmdstring = ('ffmpeg', 
 '-y', '-r', '60', # overwrite, 1fps
 '-s', '%dx%d' % (canvas_width, canvas_height),
 '-pix_fmt', 'argb',
 '-f', 'rawvideo', '-i', '-',
 '-b:v', '5000k','-vcodec', 'mpeg4', outf)
 p = subprocess.Popen(cmdstring, stdin=subprocess.PIPE)

 for frame in range(nframes):
 update(frame)
 fig.canvas.draw()
 string = fig.canvas.tostring_argb()
 p.stdin.write(string)

 p.communicate()

generate_video(nframes=10000)



I used the code from this answer to save the animation to mp4 using ffmpeg instead of anim.FuncAnimation as its much faster for me. But both methods get slower over time and I'm not sure how to make the animation not become slower. Any advice is welcome.


Versions :
Matplotlib : 3.4.2
FFMpeg : 4.2.4-1ubuntu0.1