
Recherche avancée
Médias (3)
-
Elephants Dream - Cover of the soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (57)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation"
Sur d’autres sites (12595)
-
Ffmpeg ouputting empty file to s3 when editing a remote video clip on AWS Lambda function
8 août 2023, par enjoysturtlesI'm trying to take a clip from a remote url, use ffmpeg to edit it, and save the result to s3.


I have a layer installed with ffmpeg attached to a lambda function. The lambda function runs an ffmpeg script on it and uploads the result to S3, however, the file size is either much smaller than it should be, or 0 bytes.


Locally, the code works perfectly, and it's outputting 500kb files into lambda. I'm running python 3.9 locally as well as on the lambda.


I thought that the file was not downloading fully before ffmpeg begins processing, which would explain the much smaller output file sizes.


I tried downloading the remote file to the lambda's
/tmp
and using that as the input for ffmpeg, but I continued having the same issue with the empty file.

Here's all the code in my lambda function :


import json
import subprocess
import shlex
import boto3
from datetime import datetime

def lambda_handler(event, context):
 download_url = 'https://newslater-resources.s3.us-west-2.amazonaws.com/ca4a9d5b-691a-49cc-90aa-15636c222017.mov'

 s3 = boto3.client(
 's3',
 region_name="us-east-1",
 )

 key = '/edits/%s.mov' % int(datetime.utcnow().timestamp())

 command='''
 /opt/bin/ffmpeg -i %s \
 -vf "crop=w=in_h*9/16:h=in_h,scale=1080x1920" \
 -vcodec libx264 \
 -crf 23 \
 -preset veryfast \
 -c: a copy \
 -s 1080x1920 \
 - -y
 ''' % (download_url)

 split_command = shlex.split(command)

 p1 = subprocess.run(split_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

 response = s3.put_object(Body=p1.stdout, Bucket='edited-clips', Key=key)

 signed_url = s3.generate_presigned_url(
 ClientMethod='get_object',
 Params={
 'Bucket': 'edited-clips',
 'Key': key,
 } 
 )



Any help would be greatly appreciated. Thank you !


-
Issue with creating an empty video and adding images using FFmpeg in C#
14 juillet 2023, par hello worldI'm working on a C# project where I need to create an empty video file and then add images to it using FFmpeg. However, the code I have implemented doesn't seem to be working as expected.


Here's the code snippet I have :


using System;
using System.Diagnostics;
using System.Drawing;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace VideoProcessingApp
{
 public partial class MainForm : Form
 {
 private bool render = false;

 public MainForm()
 {
 InitializeComponent();
 }

 private async void button6_Click(object sender, EventArgs e)
 {
 ProcessStartInfo createVideoInfo = new ProcessStartInfo
 {
 FileName = "ffmpeg.exe",
 Arguments = $"-f lavfi -i nullsrc -t 10 -s {pictureBox2.Width}x{pictureBox2.Height} -r 30 -c:v libx264 output.mp4",
 UseShellExecute = false,
 RedirectStandardOutput = true,
 RedirectStandardError = true,
 CreateNoWindow = true
 };

 using (Process createVideoProcess = new Process())
 {
 createVideoProcess.StartInfo = createVideoInfo;
 createVideoProcess.Start();

 render = true;
 await Task.Run(() =>
 {
 for (int i = 0; i < 10; i++)
 {
 if (!render)
 break;

 Bitmap bmp = new Bitmap(1, 1);
 pictureBox1.Invoke((MethodInvoker)(() =>
 {
 bmp = (Bitmap)pictureBox1.Image.Clone();
 }));

 while (bmp == pictureBox1.Image)
 {
 Thread.Sleep(10);
 }

 bmp.Save("a.jpg");

 ProcessStartInfo addImageInfo = new ProcessStartInfo
 {
 FileName = "ffmpeg.exe",
 Arguments = $"-i output.mp4 -i a.jpg -filter_complex \"overlay=10:10\" -c:v libx264 -c:a copy -f mp4 -",
 UseShellExecute = false,
 RedirectStandardOutput = true,
 RedirectStandardError = true,
 RedirectStandardInput = true,
 CreateNoWindow = true
 };

 using (Process addImageProcess = new Process())
 {
 addImageProcess.StartInfo = addImageInfo;
 addImageProcess.Start();

 addImageProcess.WaitForExit();
 }
 }
 });
 }

 File.Delete("a.jpg");
 }
 }
}



In this code, I'm attempting to create an empty video by executing an FFmpeg command to generate a nullsrc video. Then, I'm using a loop to capture images from a PictureBox control and overlay them onto the video using FFmpeg.


The issue I'm facing is that the video is not being created at all. I have verified that FFmpeg is installed on my system and the paths to the FFmpeg executable are correct.


I would appreciate any insights or suggestions on what could be causing this issue and how to resolve it. Thank you !


-
log file of ffmpeg's subprocess STDOUT always empty
20 juillet 2023, par Mohamed Darweshwhy is the log file always empty ?
I'm just trying to capture the "time=" from ffmpeg, but I need to make sure it captures the output first, which it doesn't.


import ffmpeg
import subprocess

input_video = ffmpeg.input("test.mp4") 
audio_stream = input_video.audio
video_stream = input_video.video

output_stream = ffmpeg.output(video_stream, audio_stream, 'test_COMPRESSED.mp4', crf=28, vcodec='libx264', vsync=2)

cmd = ' '.join(ffmpeg.compile(output_stream, overwrite_output=True))
process = subprocess.Popen(
 cmd,
 shell=True,
 stdin=subprocess.PIPE,
 stdout=subprocess.PIPE,
 text=True
)

while process.poll() is None:
 with open('log.txt', 'a') as log_file:
 for line in process.stdout:
 output_line = line.strip()
 log_file.write(output_line + '\n')