
Recherche avancée
Autres articles (59)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
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 (7704)
-
AttributeError : '_io.BytesIO' object has no attribute 'endswith' when attempting to check audio and video codec from base64 video file in Django
12 novembre 2023, par mahmudsajibI'm currently working on a Django project where I need to check the audio and video codec of a base64-encoded video file. To achieve this, I've implemented a function that decodes the base64 string into binary data and then attempts to load the video clip using MoviePy. However, I'm encountering an AttributeError : '_io.BytesIO' object has no attribute 'endswith' when trying to run the code.


Here's the relevant part of the code :


import base64
from io import BytesIO
from moviepy.editor import VideoFileClip

def get_video_codec_info(base64_data):
 # Decode base64 string into binary data
 _format, _file_str = base64_data.split(";base64,")
 binary_data = base64.b64decode(_file_str)

 # Load the video clip using MoviePy
 clip = VideoFileClip(BytesIO(binary_data))

 # Get information about the video codec
 codec_info = {
 'video_codec': clip.video_codec,
 'audio_codec': clip.audio_codec,
 }

 return codec_info



The error occurs at the line
clip = VideoFileClip(BytesIO(binary_data))
and it seems related to the use of BytesIO. I've tried to find a solution, but I'm stuck at the moment.

Any suggestions on how to resolve this issue or alternative approaches to check the audio and video codec of a base64-encoded video file in Django would be greatly appreciated. Thanks !


-
In my django app, celery task converts uploaded video w/ ffmpeg, but converted video won't save to s3 ?
29 janvier 2013, par GetItDoneI use Heroku to host my website, and Amazon s3 to store my static and media files. I have a celery task that converts the video file to flv, but the flv doesn't store anywhere. There isn't any error, just there is no file uploaded to my s3 bucket. How can I force the file to save to my s3 bucket after the conversion ? I'm still pretty new web development in general, and I have been stuck trying to get my video conversion working properly for weeks. To be honest, I'm not even sure that I'm doing the right thing with my task. Here is the code in my celery task :
@task(name='celeryfiles.tasks.convert_flv')
def convert_flv(video_id):
video = VideoUpload.objects.get(pk=video_id)
filename = video.video_upload
sourcefile = "%s%s" % (settings.MEDIA_URL, filename)
vidfilename = "%s.flv" % video.id
targetfile = "%svideos/flv/%s" % (settings.MEDIA_URL, vidfilename)
ffmpeg = "ffmpeg -i %s -ar 22050 -f flv -s 320x240 %s" % (sourcefile, targetfile)
#The next lines are code that I couldn't get to work in place of the line above, and are left commented out.
#I am open to suggestions or alternatives for this also.
#ffmpeg = "ffmpeg -i %s -acodec libmp3lame -ar 22050 -f flv -s 320x240 %s" % (sourcefile, targetfile)
#ffmpeg = "ffmpeg -i %s -acodec mp3 -ar 22050 -f flv -s 320x240 %s" % (sourcefile, targetfile)
try:
ffmpegresult = commands.getoutput(ffmpeg)
print "---------------FFMPEG---------------"
print "FFMPEGRESULT: %s" % ffmpegresult
except Exception as e:
ffmpegresult = None
print("Failed to convert video file %s to %s" % (sourcefile, targetfile))
print(traceback.format_exc())
video.flvfilename = vidfilename
video.save()My view :
def upload_video(request):
if request.method == 'POST':
form = VideoUploadForm(request.POST, request.FILES)
if form.is_valid():
video_upload=form.save()
video_id=video_upload.id
video_conversion = convert_flv.delay(video_id)
return HttpResponseRedirect('/current_classes/')
else:
...Any advice, insight, or ideas in general would be greatly appreciated. Obviously I am missing something, but I can't figure out what. I have been stuck with different aspects of getting my video conversion to work with ffmpeg using a celery task for weeks. Thanks in advance.
-
ffmpeg - output includes combined video stream from inputs but also exact video streams from inputs [closed]
17 juillet 2024, par WillHi I'm using ffmpeg to transcode some video files from prores or dv to h264/mov. Also I want to add a logo on it and make some other changes.
The command line I use is


ffmpeg -i input.mov -i logo.png -c:a aac -c:v libx264 -pix_fmt yuv420p -crf 18 -map 0:a? -map 0:v -filter_complex "yadif,[1]scale=iw*1:-1[wm];[0:v:0][wm]overlay=main_w-overlay_w-5:5" -disposition:v:0 default output_h264.mov


And what I got has three video streams. One for the logo,one for the video with logo which is what I want only, and one for original video.


I tried the temp way to solve is to put the default video stream as the second one as you can see for
-disposition:v:0 default
. And it plays that stream defaultly using VLC or QuickTime. But when I tried to upload it on Vimeo or Youtube, it uses another stream to play.


How can I change the command line to let ffmpeg only output that combined stream ? Thanks !