
Recherche avancée
Autres articles (92)
-
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 ;
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 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 (...) -
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 (7940)
-
converting one video file to another video file with sound from ffmpeg using vc++2010 [closed]
18 février 2013, par user2047514I am devloping a application that convert one video to another including sound (means in source file has video as well as sound) with the help of FFMPEG Librrary. I have created a video. But sound is not availabe in converted video. so please help me how can i fix this issue. I am sending You link .
FFmpeg not honoring bitrate for different containers ?
i have used this code for doing my work but sound is not availble. so please help my how can we handle this situation.Thanks for your cooperation
Waiting your response. -
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.