Recherche avancée

Médias (1)

Mot : - Tags -/livre électronique

Autres articles (44)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 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, par

    Par 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 (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

Sur d’autres sites (11068)

  • Why isnt the dpi argument increasing resolution in matplotlib ?

    18 décembre 2023, par BananaBusters

    Ive been making little videos of the Lorenz attractor recently by plotting various steps in the Lorenz attractor trace in python, saving the plots as images then combining the images into a video. By default, a saved plot in python doesnt really have good resolution so I have been trying to boost the resolution by using the 'dpi=' argument in plt.savefig, but recently the resolution hasnt been increasing and has been staying the default value for some videos, but for others it comes out crisp and clear. Can anyone tell me where im going wrong ? Here is the code im using along with a youtube link showing the low resolution even after using a high dpi argument. And no, its not just youtube compressing the video, it looked like that before uploading as well.

    


    Youtube video showing problem : https://www.youtube.com/watch?v=0TpxeMxYs5A

    


    Code :

    


    # lorenzAttractorTrace() takes in the amount of frames you want to video to be along with the system paramters s, r and b. Default value is just a known value that gives a known result to use as sanity checks
# Will save images to target directory where you will then have to run ffmpeg through the command line to use. Ffmpeg comand is given in the next line
# ffmpeg -start_number 0 -framerate 60 -i graph%01d.png video.webm

def lorenzAttractorTrace(frames, s=10, r=28, b=2.667, clean=False, rotation=False):
    #Empty the target directory
    clearDirectory()

    #Calculate the array of points according to the lorenz system
    #Do this outside the main loop so that we only calculate it once rather than a bazillion times and annihilate memory
    dt = 0.01
    numSteps = frames

    xyzs = np.empty((numSteps+1, 3))  # Need one more for the initial values
    xyzs[0] = (0., 1., 1.05)  # Set initial values
    for i in range(numSteps):
        xyzs[i + 1] = xyzs[i] + lorenz(xyzs[i],s,r,b) * dt

    # Checking if the attractor is clean or not to determine what the first frame should look like     
    if clean == True:
        #plot the first frame outside of the main loop, same idea as initial conditions just with a frame
        ax = plt.figure().add_subplot(projection='3d')
        ax.plot(*xyzs[0].T, lw=0.5)
        ax.set_xlabel("X Axis")
        ax.set_ylabel("Y Axis")
        ax.set_zlabel("Z Axis")
        ax.grid(None)
        ax.axis('off')
        plt.savefig('./Images for simulation/graph'+str(0)+'.png')
        plt.close('all')
    else:
        #plot the first frame outside of the main loop, same idea as initial conditions just with a frame
        ax = plt.figure().add_subplot(projection='3d')
        ax.plot(*xyzs[0].T, lw=0.5)
        ax.set_xlabel("X Axis")
        ax.set_ylabel("Y Axis")
        ax.set_zlabel("Z Axis")
        ax.set_title("Lorenz Attractor")
        plt.savefig('./Images for simulation/graph'+str(0)+'.png')
        plt.close('all')
    
    #Non-rotation video
    if rotation == False:
        #Initialize frame to 1 so that our indexing for xyzs in the main loop prints from 0-frame. If frame was 0 then we would be plotting xysz from xyzs[0] ot xyzs[0] which we cant do. We need atleast xyzs[0] to xyzs[1]
        frame = 1
        while frame < numSteps:
            ax = plt.figure().add_subplot(projection='3d')
            ax.plot(*xyzs[:frame].T, lw=0.5) #Recall this [:frame] notion means we plot the array from xyzs[0] to xyzs[frame]
            ax.set_xlabel("X Axis")
            ax.set_ylabel("Y Axis")
            ax.set_zlabel("Z Axis")
            plt.xlim((-25,25))
            plt.ylim((-30,35))
            ax.set_zlim(0,60)
            if clean == True:
                ax.grid(None)
                ax.axis('off')
            else:
                ax.set_title("Lorenz Attractor")
                pass
            plt.savefig('./Images for simulation/graph'+str(frame)+'.png', dpi=300) # dpi argument increases resolution
            plt.close('all')
            frame = frame + 1
    #Rotation video, add in the ax.view_init() function which takes in spherical coordinate
    else:
        #Initialize frame to 1 so that our indexing for xyzs in the main loop prints from 0-frame. If frame was 0 then we would be plotting xysz from xyzs[0] ot xyzs[0] which we cant do. We need atleast xyzs[0] to xyzs[1]
        frame = 1
        angle = 0
        while frame < numSteps:
            ax = plt.figure().add_subplot(projection='3d')
            ax.plot(*xyzs[:frame].T, lw=0.5) #Recall this [:frame] notion means we plot the array from xyzs[0] to xyzs[frame]
            ax.set_xlabel("X Axis")
            ax.set_ylabel("Y Axis")
            ax.set_zlabel("Z Axis")
            plt.xlim((-25,25))
            plt.ylim((-30,35))
            ax.set_zlim(0,60)
            ax.view_init(30,angle)
            if clean == True:
                ax.grid(None)
                ax.axis('off')
            else:
                ax.set_title("Lorenz Attractor")
                pass
            plt.savefig('./Images for simulation/graph'+str(frame)+'.png', dpi=300) # dpi argument increases resolution
            plt.close('all')
            frame = frame + 1
            angle = angle + 1


    


  • How can we play 2 videos side by side as per the resolution we provide to the output video and adjust the two input videos position

    1er décembre 2023, par Bhavya Nayak

    -> For playing two video side by side as per the output video resolution I provide :-

    


      

    1. I want output video of resolution 1280x720 so for this.
    2. 


    


    a. First I have trimmed the two video using below command :-

    


    ffmpeg -i input_viedo.mp4 -ss 00:00:10 -t 00:00:20 -vf      "scale=1920:1080,pad=1920:1080:0:0:yellow" -c:v libx264 -c:a aac -strict -2 output_video_trimmed.mp4



    


    b. Now to I want to play both the trimmed video into one output video file as per the position I provide , so for this I have tried below command which is not giving the correct output :

    


    ffmpeg -i output_video_trimmed_1.mp4 -i output_trimmed_2.mp4 -filter_complex "[0:v]scale=634:360[pad1];[1:v]scale=640:360[pad2];[pad1]pad=1280:360:0:100[tl];[pad2]pad=1280:360:634.752:130.392[br];[tl][br]vstack,scale=1280:720[output]" -map "[output]" -c:v libx264 -preset ultrafast -crf 18 -c:a aac -b:a 1280x720 output_final_video.mp4


    


      

    • In above command I have provide the specific width,height,top,left of the input video I want ,
    • 


    


    But it is not giving me correct output.

    


    —> Output I am getting by running this command is attached below :-

    


    Output video Image I am getting by running above command

    


    Actual output I want

    


    —> The issue in above command is while adding top it is not working properly , like top is not affecting the video so I want the solution for that.

    


  • How to update this script to generate HLS video with different resolution streams ? [closed]

    1er décembre 2023, par Andy Z

    I have the following FFmpeg script :

    


    ffmpeg -i video.mp4 -i video.vtt \
 -map 0:v -map 0:a:0 -map 1 \
 -s:v:0 1080x1920 -c:v:0 h264 -b:v:0 500K \
 -c:a:0 copy -c:a:1 copy -c:a:2 copy -c:s webvtt \
 -f hls -hls_playlist_type vod -var_stream_map "v:0,a:0,s:0" \
 -master_pl_name video.m3u8 -hls_time 6 -hls_list_size 0 -hls_allow_cache 1 -start_number 1 \
 -hls_segment_filename "output/hls/%v/seg-%d.ts" output/hls/%v/index.m3u8


    


    Currently it only produces one 1080x1920 stream, how do I produce more lower resolution ones so it can adjust based on client bandwidth ?

    


    Also, I've noticed that it doesn't add the reference to the VTT file to the master HLS playlist ; I had to add this manually but is there a way to make FFmpeg do it for me ?

    


    #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="en",CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog",URI="0/index_vtt.m3u8"


    


    I've tried this, but I get an argument error :

    


    ffmpeg -i video.mp4 -i video.vtt \
 -map 0:v -map 0:a:0 -map 1 \
 -s:v:0 1080x1920 -c:v:0 h264 -b:v:0 500K \
 -s:v:1 720x1280 -c:v:1 h264 -b:v:1 300K \
 -s:v:2 480x854 -c:v:2 h264 -b:v:2 150K \
 -c:a:0 copy -c:a:1 copy -c:a:2 copy -c:s webvtt \
 -f hls -hls_playlist_type vod -var_stream_map "v:0,a:0,s:0 v:1,a:1 s:1 v:2,a:2 s:2" \
 -master_pl_name video.m3u8 -hls_time 6 -hls_list_size 0 -hls_allow_cache 1 -start_number 1 \
 -hls_segment_filename "output/hls/%v/seg-%d.ts" output/hls/%v/index.m3u8