
Recherche avancée
Autres articles (78)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Sélection de projets utilisant MediaSPIP
29 avril 2011, parLes exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
Ferme MediaSPIP @ Infini
L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)
Sur d’autres sites (5607)
-
Matplotlib : animation saved with trace
25 mai 2020, par Thiziri yoorIn the following Python code, I am trying to make an animation of a 2 rotating vectors around the origin. I am using matplotlib 3.2.1 and Python 3.8.2 on Ubuntu 20.04.




import numpy as np
import matplotlib.pyplot as plt

from matplotlib.animation import FuncAnimation


r = 2.0

def circle(phi):
 return np.array([r*np.cos(phi), r*np.sin(phi)])

fig, ax = plt.subplots(figsize=(10,6))
ax.axis([-3.5*r,3.5*r,-2.5*r,2.5*r])
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)

# set equal aspect
ax.set_aspect("equal")

point, = ax.plot(0, r, marker="o")


traj = plt.Circle((0,0), r, fill=False, color='black')
ax.add_artist(traj) # draw the circular trajectory

def update(phi):

 x, y = circle(phi)
 point.set_data([x], [y])
 er_vec = np.array([0.5*x, 0.5*y])
 eθ_vec = np.array([-0.5*y, 0.5*x])


 er_arr = plt.arrow(x, y, dx=er_vec[0], dy=er_vec[1], head_width=0.1, head_length=0.2, color='gray')
 eθ_arr = plt.arrow(x, y, dx=eθ_vec[0], dy=eθ_vec[1], head_width=0.1, head_length=0.2, color='grey')

 annot_er = plt.text(1.7*x, 1.7*y, r'$\mathbf{e}_r$', fontsize=11)
 annot_eθ = plt.text(1.1*(x-0.5*y), 1.1*(y+0.5*x), r'$\mathbf{e}_\theta$', fontsize=11) 

 ax.add_artist(er_arr) 
 ax.add_artist(eθ_arr)
 ax.add_artist(annot_er)
 ax.add_artist(annot_eθ)
 return point, er_arr, eθ_arr, annot_er, annot_eθ

anim = FuncAnimation(fig, update, interval=10, blit=True, repeat=False, frames=np.linspace(0, 2.0*np.pi, 360, endpoint=False))
plt.show()




The code above runs smoothly and without any issues.
This is a screenshot of the animation :






However, when I try to save the animation to an mp4 video :



anim.save('anim-issue.mp4', writer='ffmpeg')




the animation in the video appears with traces which, something like this screenshot :






Could someone help me fix that issue with the video animation ?



I appreciate your help.



Edit 1 : According to this answer this is due to
blit=True
. But that doesn't solve the issue here, since the arrows have noset_position
method.


Edit 2 : I found another related question with the same issue I described above but I don't know how to adapt my code to make it work as expected in both cases (
plt.show
,anim.save
).

-
Android Studio - Append two videos but showing black screen
6 septembre 2020, par DarkhmarFirst of all hello,


When I add another mp4 file at the end of an mp4 file, the video looks completely black screen but I can get the video sounds.


If I add a copy of a video to the end of it, I saw that there was no problem, but this is not a scenario I want.


I am getting the "text relocations" error when merging with the FFmpeg library. (This problem is fixed when I change this library version, but I have other problems. Therefore, mp4parser is an alternative I see.)


The piece of code that allows the videos to be merged is as follows. Thank you from now.


private void appendTwoVideos(String firstVideoPath, String secondVideoPath) {
 try {
 Movie[] inMovies = new Movie[2];

 inMovies[0] = MovieCreator.build(firstVideoPath);
 inMovies[1] = MovieCreator.build(secondVideoPath);

 List<track> videoTracks = new LinkedList<>();
 List<track> audioTracks = new LinkedList<>();

 for (Movie m : inMovies) {
 for (Track t : m.getTracks()) {
 if (t.getHandler().equals("soun")) {
 audioTracks.add(t);
 }
 if (t.getHandler().equals("vide")) {
 videoTracks.add(t);
 }
 }
 }

 Movie result = new Movie();

 if (audioTracks.size() > 0) {
 result.addTrack(new AppendTrack(audioTracks
 .toArray(new Track[audioTracks.size()])));
 }
 if (videoTracks.size() > 0) {
 result.addTrack(new AppendTrack(videoTracks
 .toArray(new Track[videoTracks.size()])));
 }

 BasicContainer out = (BasicContainer) new DefaultMp4Builder().build(result);

 @SuppressWarnings("resource")
 FileChannel fc = new RandomAccessFile(DIRECTORY_PATH + "output.mp4", "rw").getChannel();
 out.writeContainer(fc);
 fc.close();
 } catch (FileNotFoundException e) {
 e.printStackTrace();
 } catch (IOException e) {
 e.printStackTrace();
 }
}
</track></track>


-
Why can't Chrome 83 play this AV1 encoded video ?
25 mai 2020, par SlboxThe file plays great in VLC.



I've tried adding the
codecs="av01.0.05M.08"
to the video source, but no luck - no browser will play it, despite what's stated here : https://caniuse.com/#feat=av1


The video was encoded like so :



ffmpeg -i input.avi -pix_fmt yuva420p -f nut -c:v libaom-av1 -minrate 1k -b:v 350k -maxrate 2000k -strict experimental output.mp4




Browser console :



- 

-
Chrome gives no hint whatsoever as to why it won't play. Firefox gives some minor clues.
-
Firefox shows the below







Media resource https://example.com/example.mp4 could not be decoded. example.mp4




Media resource https://example.com/example.mp4 could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006)
Details: static MP4Metadata::ResultAndByteBuffer __cdecl mozilla::MP4Metadata::Metadata(mozilla::ByteStream *): Cannot parse metadata




Any advice on where I'm going wrong, either in understanding or in encoding arguments, would be greatly appreciated !


-