
Recherche avancée
Autres articles (53)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
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 ;
-
Ecrire une actualité
21 juin 2013, parPré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 ) (...)
Sur d’autres sites (10651)
-
Surfaceview/TextureView for subtitles alpha does not work
27 mai 2018, par user654628Goal : trying to build video player with subtitles for android. Video can be low resolution but the subtitles should be resolution of phone (such that if video is 720p, the subtitles should render to screen size say 1080p).
Issue : Render on Textureview or Surfaceview is not see through where you could get it to blend with the background views. I am using FFMPEG to render a frame at say 720p but phone device is 1080p. I need to display subtitles that are different resolution than the subtitles resolution so pixel blending is difficult.
I first tried to scale the frame (AVFrame) with sws_convert but each frame took 80ms so that is not an option (since it is running software).
Then I tried two surface views, one for the video and one for subtitles where video would be 720p and subtitles SurfaceView is 1080p, then the video scales up to the phone size. The issue here is that the subtitles are not translucent. Black opacity 0 would be transparent but white with alpha 0 is still white. Why is this ?
//Code from Java, the view that extends FrameLayout
public VideoView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mVideoSurface = new SurfaceView(context);
mSubtitlesSurface = new SurfaceView(context);
addView(mVideoSurface);
addView(mSubtitlesSurface);
mVideoSurface.getHolder().addCallback(mSurfaceCallback);
mSubtitlesSurface.getHolder().addCallback(mSurfaceCallback);
mSubtitlesSurface.setZOrderMediaOverlay(true);
mSubtitlesSurface.getHolder().setFormat(PixelFormat.TRANSLUCENT);
//etc
}Eventually I tried as a test to render a square to the subtitle surface view (C++)
// Render the video frame, now render the subtitle frame
ANativeWindow_Buffer buffer;
ANativeWindow_setBuffersGeometry(subWindow, width, height, WINDOW_FORMAT_RGBA_8888);
if ((ret = ANativeWindow_lock(subWindow, &buffer, NULL)) < 0) {
return ret;
}
for (int j = height/2; j < height/2 + 100; j++) {
for (int i = width/2; i < width/2 + 100; i++) {
uint8_t * d = (uint8_t*)buffer.bits + j * (buffer.stride * 4) + i * 4;
d[0] = 0xff;
d[1] = 0xff;
d[2] = 0xFF;
d[3] = 0; /* alpha */
}
}
ANativeWindow_unlockAndPost(subWindow);So above code should render a white square in the image with 0 alpha (so should be invisible), but it is shown. If I change it to yellow with alpha 0 it will be visible but not the correct color. If I change to white with 1 alpha, it is white and opaque. If I use black with alpha 0xCC, it is invisible, only if alpha is 0xFF then it is visible as black. Seems to have no translucency even though I added it to the SurfaceHolder. Why is it like this ? I can add more code if needed.
Is my only option to do what I want to render frame as a texture in OpenGL and (GLSurfaceView), resize the image to phone resolution and blend the alpha subtitles onto the frame as a texture ?
Thanks in advance.
-
Paperclip Video Skewed (does not maintain aspect ratio)
3 septembre 2015, par zreitanoThe video uploaded does not maintain aspect ratio. In the readme (paperclip av-transcoder) it says, " ’ !’ - Keep the same aspect of the image/video, but with the passed dimension." I have also tried the other options(<># !) and none of them effect the size of the video.
My goal is to be able to be able to have the video returned in a square (while maintaining the aspect ratio). Cropping from the center would be ideal, as well.
Any help would be greatly appreciated. I included my code below.
class Video < Post
Paperclip.interpolates :id do |attachment, style|
attachment.instance.id
end
#basename/extension is paperclip interpolation from attachment, can write own interpolations as needed
# have to link /usr/local/bin to the linuxbrew version of ffmpeg
has_attached_file :video, path: "/posts/videos/:id/:style.:extension",
:styles => {
:square => {:geometry => "500x500!", :format => 'mp4', :streaming => true }
},
:processors => [:transcoder]
validates_attachment :video, :presence => true,
:content_type => { content_type: ["video/mp4", "video/mov", "video/mpeg","video/mpeg4", "video/quicktime"] }
def video_url
video = self.video
if video.present?
return video.url(:square)
end
end
end -
How to create a video thumbnail without ffmpeg or HTML5 video canvas ? [duplicate]
14 mai 2014, par user3631926This question already has an answer here :
I need to create a thumbnail from a video, I have tried the below options but they didn’t work for my case. I am using S3 and CloudFront.
-
ffmpeg is not supported via my hosting because I am using a shared hosting and I need to upgrade to VPS or dedicated server if I want to use ffmpeg.
-
I tried taking a screenshot from the video using HTML5 drawImage and toDataURL functions, but it is throwing SecurityError because my video file is located on Amazon CloudFront and my code is hosted somewhere else.
Is there any other option or a workaround to the second option ? I don’t want to upgrade my server for just the thumbnail issue.
-