
Recherche avancée
Médias (91)
-
DJ Z-trip - Victory Lap : The Obama Mix Pt. 2
15 septembre 2011
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Matmos - Action at a Distance
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
DJ Dolores - Oslodum 2004 (includes (cc) sample of “Oslodum” by Gilberto Gil)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Danger Mouse & Jemini - What U Sittin’ On ? (starring Cee Lo and Tha Alkaholiks)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Cornelius - Wataridori 2
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Rapture - Sister Saviour (Blackstrobe Remix)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (80)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)
Sur d’autres sites (6612)
-
Pygame : Frame ghosting ?
5 octobre 2022, par Sam TubbI am working on a animation environment in python using pygame. The user draw's each frame, and then using ffmpeg the animation is saved as an .avi movie. I would like to implement a feature, but am not sure how.. frame ghosting. Like display the previous frame while you draw the current.



I tried creating a surface called
ghost
that copies the current frame when the next-frame key is pressed. Then draws it with an alpha level of 10, but this didn't work out correctly.


I am not sure what to do, here is the source code for anyone that thinks they have an idea :



#Anim8

import pygame,subprocess,shutil
from os import makedirs
from pygame.locals import *
from random import randrange
pygame.init()
screen=pygame.display.set_mode((740,580))
draw=pygame.Surface((740,540))
draw.fill((200,200,200))
bcol=(200,200,200)
gui=pygame.Surface((740,40))
gui.fill((50,50,50))
size=2
color=(0,0,0)
screen.fill((200,200,200))
prevcol=0
newcol=0
f=0
msg=''
framerate=60
try:
 makedirs('anim')
except:
 pass
def DrawColors(x,y):
 pygame.draw.rect(gui, (255,0,0), (x+3,y+3,15,15),0)
 pygame.draw.rect(gui, (0,0,0), (x+3,y+21,15,15),0)
 pygame.draw.rect(gui, (0,255,0), (x+21,y+3,15,15),0)
 pygame.draw.rect(gui, (200,200,200), (x+21,y+21,15,15),0)
 pygame.draw.rect(gui, (0,0,255), (x+39,y+3,15,15),0)
while True:
 pygame.display.set_caption('Anim8 - Sam Tubb - '+'Frame: '+str(f)+' '+str(msg))
 mse=pygame.mouse.get_pos()
 screen.blit(gui, (0,0))
 DrawColors(0,0)
 screen.blit(draw,(0,40))
 key=pygame.key.get_pressed()
 if key[K_1]:
 framerate=10
 msg='Frame Rate set to 10'
 if key[K_2]:
 framerate=20
 msg='Frame Rate set to 20'
 if key[K_3]:
 framerate=30
 msg='Frame Rate set to 30'
 if key[K_4]:
 framerate=40
 msg='Frame Rate set to 40'
 if key[K_5]:
 framerate=50
 msg='Frame Rate set to 50'
 if key[K_6]:
 framerate=60
 msg='Frame Rate set to 60'
 if key[K_7]:
 framerate=70
 msg='Frame Rate set to 70'
 if key[K_8]:
 framerate=80
 msg='Frame Rate set to 80'
 if key[K_9]:
 framerate=90
 msg='Frame Rate set to 90'
 if key[K_0]:
 framerate=100
 msg='Frame Rate set to 100'

 if key[K_a]:
 pygame.image.save(draw, 'anim/frame'+str(f)+'.png')
 f+=1
 for e in pygame.event.get():
 if e.type==QUIT:
 shutil.rmtree('anim')
 exit()
 if e.type==KEYDOWN:
 if e.key==K_s:
 msg='Added Frame!'
 pygame.image.save(draw, 'anim/frame'+str(f)+'.png')
 f+=1
 if e.key==K_c:
 draw.fill(bcol)
 if e.key==K_r:
 name='anim'+str(randrange(0,999))+str(randrange(0,999))+'.avi'
 msg='Rendering: '+name
 pygame.display.set_caption('Anim8 - Sam Tubb - '+'Frame: '+str(f)+' '+str(msg))
 subprocess.call('ffmpeg -f image2 -s 640x480 -i anim/frame%01d.png -r '+str(framerate)+' '+name,shell=True)
 msg='Done!'
 if e.key==K_p:
 subprocess.call('ffplay '+name,shell=True)
 if e.type==MOUSEBUTTONDOWN:
 if e.button==1:
 try:
 prevcol=color
 newcol=gui.get_at(mse)
 if newcol==(50,50,50):
 newcol=prevcol
 color=newcol
 except:
 pass
 if e.button==3:
 try:
 prevcol=bcol
 newcol=gui.get_at(mse)
 if newcol==(50,50,50):
 newcol=prevcol
 draw.fill(newcol)
 bcol=newcol
 except:
 pass
 if e.button==4:
 size+=1
 if size>7:
 size=7
 if e.button==5:
 size-=1
 if size==0:
 size=1 
 if e.type == pygame.MOUSEMOTION:
 lineEnd = pygame.mouse.get_pos()
 lineEnd = (lineEnd[0],lineEnd[1]-40)
 if pygame.mouse.get_pressed() == (1, 0, 0):
 pygame.draw.line(draw, color, lineStart, lineEnd, size)
 lineStart = lineEnd

 pygame.display.flip()




Oh, and on another note, just if anyone was curious, here is what the output looks like.. I made a little new year's animation :





-
Issues with using FFmpeg to generate MPEG-DASH files
26 septembre 2022, par Tina JI am using the following
ffmpeg
command to generate MPEG DASH files and manifest. I usesingle_file 1
to have a single file for each representation ; so no chunking. But IDK why when I want to play the manifest using ExoPlayer, the video doesn't play from the beginning (rather it starts from around 50s).

ffmpeg -re -i .\video-h264.mkv -map 0 -map 0 -c:a aac -c:v libx264 -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -single_file 1 -use_template 1 -window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" -f dash out.mpd



What is wrong with this ? Is the manifest correct ? Here is the generated mpd :


<?xml version="1.0" encoding="utf-8"?>
<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediapresentationduration="PT1M20.1S" maxsegmentduration="PT5.0S" minbuffertime="PT16.0S">
 <programinformation>
 </programinformation>
 <servicedescription>
 </servicedescription>
 <period start="PT48.0S">
 <adaptationset contenttype="video" startwithsap="1" segmentalignment="true" bitstreamswitching="true" framerate="30/1" maxwidth="960" maxheight="540" par="517072:290799" lang="eng">
 <representation mimetype="video/mp4" codecs="avc1.4d401f" bandwidth="800000" width="960" height="540" sar="32317:32311">
 <baseurl>out-stream0.mp4</baseurl>
 <segmentlist timescale="1000000" duration="5000000" startnumber="7">
 <initialization range="0-832"></initialization>
 <segmenturl mediarange="4800141-5599188" indexrange="4800141-4800192"></segmenturl>
 <segmenturl mediarange="5599189-6243069" indexrange="5599189-5599240"></segmenturl>
 <segmenturl mediarange="6243070-7224302" indexrange="6243070-6243121"></segmenturl>
 <segmenturl mediarange="7224303-8138118" indexrange="7224303-7224354"></segmenturl>
 <segmenturl mediarange="8138119-8232111" indexrange="8138119-8138170"></segmenturl>
 </segmentlist>
 </representation>
 <representation mimetype="video/mp4" codecs="avc1.42c00d" bandwidth="300000" width="320" height="170" sar="549389:581598">
 <baseurl>out-stream2.mp4</baseurl>
 <segmentlist timescale="1000000" duration="5000000" startnumber="7">
 <initialization range="0-832"></initialization>
 <segmenturl mediarange="1782920-2005667" indexrange="1782920-1782971"></segmenturl>
 <segmenturl mediarange="2005668-2229412" indexrange="2005668-2005719"></segmenturl>
 <segmenturl mediarange="2229413-2615209" indexrange="2229413-2229464"></segmenturl>
 <segmenturl mediarange="2615210-2975346" indexrange="2615210-2615261"></segmenturl>
 <segmenturl mediarange="2975347-2999288" indexrange="2975347-2975398"></segmenturl>
 </segmentlist>
 </representation>
 </adaptationset>
 <adaptationset contenttype="audio" startwithsap="1" segmentalignment="true" bitstreamswitching="true" lang="eng">
 <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="69000" audiosamplingrate="44100">
 <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"></audiochannelconfiguration>
 <baseurl>out-stream1.mp4</baseurl>
 <segmentlist timescale="1000000" duration="5000000" startnumber="12">
 <initialization range="0-764"></initialization>
 <segmenturl mediarange="491493-536039" indexrange="491493-491544"></segmenturl>
 <segmenturl mediarange="536040-580657" indexrange="536040-536091"></segmenturl>
 <segmenturl mediarange="580658-625158" indexrange="580658-580709"></segmenturl>
 <segmenturl mediarange="625159-669825" indexrange="625159-625210"></segmenturl>
 <segmenturl mediarange="669826-713289" indexrange="669826-669877"></segmenturl>
 </segmentlist>
 </representation>
 <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="69000" audiosamplingrate="22050">
 <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"></audiochannelconfiguration>
 <baseurl>out-stream3.mp4</baseurl>
 <segmentlist timescale="1000000" duration="5000000" startnumber="12">
 <initialization range="0-764"></initialization>
 <segmenturl mediarange="486188-530059" indexrange="486188-486239"></segmenturl>
 <segmenturl mediarange="530060-574175" indexrange="530060-530111"></segmenturl>
 <segmenturl mediarange="574176-618922" indexrange="574176-574227"></segmenturl>
 <segmenturl mediarange="618923-663118" indexrange="618923-618974"></segmenturl>
 <segmenturl mediarange="663119-706121" indexrange="663119-663170"></segmenturl>
 </segmentlist>
 </representation>
 </adaptationset>
 </period>
</mpd>



-
Metadata is not showing ffmpeg C++
22 novembre 2022, par KaidulI am muxing h264 encoded video data and PCM g711 encoded audio data into a
.mov
media container. I am trying to write metadata on header but the metadata is not showing when I go to file->right click->properties->details on windows and likewise in Ubuntu. This is my code -


// Instead of creating new AVDictionary object, I also tried following way
// stated here: http://stackoverflow.com/questions/17024192/how-to-set-header-metadata-to-encoded-video 
// but no luck
AVDictionary* pMetaData = m_pFormatCtx->metadata;
av_dict_set(&pMetaData, "title", "Cloud Recording", 0);
av_dict_set(&pMetaData, "artist", "Foobar", 0);
av_dict_set(&pMetaData, "copyright", "Foobar", 0);
av_dict_set(&pMetaData, "filename", m_sFilename.c_str(), 0);
time_t now = time(0);
struct tm tStruct = *localtime(&now);
char date[100];
strftime(date, sizeof(date), "%c", &tStruct); // i.e. Thu Aug 23 14:55:02 2001
av_dict_set(&pMetaData, "date", date, 0);
av_dict_set(&pMetaData, "creation_time", date, 0);
av_dict_set(&pMetaData, "comment", "This video has been created using Eyeball MSDK", 0);

// ....................
// .................

/* write the stream header, if any */
int ret = avformat_write_header(m_pFormatCtx, &pMetaData);




I also tried to see if the file contains any metadata using
mediainfo
andexiftools
in linux. Also I triedffmpeg -i output.mov
but no metadata is shown.


Whats the problem ? Is the
flags
value0
inav_dict_set
okay ? DO I need to set different flags for different platform (windows/linux) ?


I saw this link and it stated that for windows, I have to use
id3v2_version 3
and-write_id3v1 1
to make metadata working. If so, how can I do this in C++ ?