
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (81)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
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 (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (9533)
-
FFmpeg : How to add shadow overlay at the bottom of the video ?
18 décembre 2019, par ArmKh -
avcodec/mp3 : fix skipping zeros
30 septembre 2015, par wm4avcodec/mp3 : fix skipping zeros
Commits 43bc5cf9 and c5371f77 add code for skipping initial zeros in mp3
packets. This code forgot to report to the user that data was skipped at
all.Since audio codecs allow partial packet decoding, the user application
has to rely on the return value. It will remove the data reported as
consumed by the decoder, and feed it to the decoder again. This resulted
in the mp3 frame after the zero region to be decoded over and over
again, until the zero region was finally skipped by the application.Fix this by including the amount of skipped bytes to the number of
consumed bytes returned by the decode call.Fixes trac ticket #4890.
-
FFmpeg with S3 and AWS lambda
19 mai 2023, par Hemant Rawatimport boto3
import subprocess
import os
import re

s3_client = boto3.client('s3')

def lambda_handler(event, context):
 try:
 input_bucket_name = event['input_bucket_name']
 output_bucket_name = event['output_bucket_name']
 input_file_name = event['input_file_name']
 output_file_name = event['output_file_name']
 start_time = event['start_time']
 end_time = event['end_time']
 padding_image_file = event['padding_image_file']
 video_scale = event['video_scale']
 video_overlay_x = event['video_overlay_x']
 video_overlay_y = event['video_overlay_y']
 subtitles_file = event['subtitles_file']

 input_file = '/tmp/' + input_file_name
 trimmed_file = '/tmp/trimmed_' + input_file_name
 output_file = '/tmp/' + output_file_name

 s3_client.download_file(input_bucket_name, input_file_name, input_file)

 except Exception as e:
 print(f'Error during initial setup: {e}')
 return

 try:
 trim_video(input_file, trimmed_file, start_time, end_time)
 except Exception as e:
 print(f'Error during trimming video: {e}')
 return

 try:
 add_subtitles_with_padding(trimmed_file, padding_image_file, video_scale, video_overlay_x, video_overlay_y, subtitles_file, output_file)
 except Exception as e:
 print(f'Error during adding subtitles and padding: {e}')
 return

 if os.path.isfile(trimmed_file):
 os.remove(trimmed_file)

 if not os.path.isfile(output_file):
 print(f'Output file not found: {output_file}')
 return

 try:
 s3_client.upload_file(output_file, output_bucket_name, output_file_name)
 except Exception as e:
 print(f'Error during upload: {e}')
 return

def execute_command(cmd):
 process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
 stdout, stderr = process.communicate()
 
 if process.returncode != 0:
 raise Exception(f'Error executing {cmd}: {stderr.decode()}')
 
 return stdout.decode()


def trim_video(input_file, output_file, start_time, end_time):
 cmd = [
 '/opt/ffmpeglib/ffmpeg', '-i', input_file, '-ss', start_time, '-to', end_time, '-c', 'copy', output_file
 ]

 try:
 result = subprocess.run(cmd, capture_output=True, text=True)
 result.check_returncode()
 print(f'Successfully trimmed {input_file} and saved the result to {output_file}')
 except subprocess.CalledProcessError as e:
 print(f'Error during trimming video: {e.stderr}')
 raise


def add_subtitles_with_padding(input_file, padding_image_file, video_scale, video_overlay_x, video_overlay_y, subtitles_file, output_file):
 cmd = [
 '/opt/ffmpeglib/ffmpeg', '-i', input_file, '-i', padding_image_file, '-filter_complex', 
 f"[0:v]scale=iw/{video_scale}:ih/{video_scale},setsar=1[main];\
 [1:v]scale=720:1280[pad];\
 [pad][main]overlay={video_overlay_x}:{video_overlay_y},\
 subtitles={subtitles_file}:force_style='Alignment=2,OutlineColour=&H100000000,BorderStyle=3,Outline=1,Shadow=0,Fontsize=10,MarginL=2,MarginV=20'",
 '-c:v', 'libx264', '-crf', '1', '-preset', 'medium', '-b:v', '1M', '-c:a', 'aac', '-b:a', '256k', '-movflags', '+faststart', '-y', output_file
 ]

 try:
 result = subprocess.run(cmd, capture_output=True, text=True)
 result.check_returncode()
 print(f'Successfully processed {input_file} and saved the result to {output_file}')
 except subprocess.CalledProcessError as e:
 print(f'Error during adding subtitles and padding: {e.stderr}')
 raise




I'm getting this error can anybody help I'have been stuck in this for a week now and still not getting the solution right now i'm stuck at this error :-




Error during initial setup : An error occurred (403) when calling the
HeadObject operation : Forbidden END RequestId :
29caa5b4-fbe0-4e45-af4f-7bde42393235




Even though i have provided all the necessary permission from the IAM role.