
Recherche avancée
Médias (1)
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (39)
-
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 is the first MediaSPIP stable release.
Its official release date is June 21, 2013 and is announced here.
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)
Sur d’autres sites (7546)
-
What permission ffmpeg-static need in AWS Lambda ?
17 février 2023, par JánosI have this code. It download a image, made a video from it and upload it to S3. It runs on Lambda. Added packages, intalled, zipped, uploaded.


npm install --production
zip -r my-lambda-function.zip ./



But get an
error code 126


2023-02-17T09:27:55.236Z 5c845bb6-02c1-41b0-8759-4459591b57b0 INFO Error: ffmpeg exited with code 126
 at ChildProcess.<anonymous> (/var/task/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
 at ChildProcess.emit (node:events:513:28)
 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
2023-02-17T09:27:55.236Z 5c845bb6-02c1-41b0-8759-4459591b57b0 INFO Error: ffmpeg exited with code 126 at ChildProcess.<anonymous> (/var/task/node_modules/fluent-ffmpeg/lib/processor.js:182:22) at ChildProcess.emit (node:events:513:28) at ChildProcess._handle.onexit (node:internal/child_process:291:12)
</anonymous></anonymous>


Do I need to set a specific premission for ffmpeg ?


import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3'
import { fromNodeProviderChain } from '@aws-sdk/credential-providers'
import axios from 'axios'
import pathToFfmpeg from 'ffmpeg-static'
import ffmpeg from 'fluent-ffmpeg'
import fs from 'fs'
ffmpeg.setFfmpegPath(pathToFfmpeg)
const credentials = fromNodeProviderChain({
 clientConfig: {
 region: 'eu-central-1',
 },
})
const client = new S3Client({ credentials })

export const handler = async (event, context) => {
 try {
 let body
 let statusCode = 200
 const query = event?.queryStringParameters
 if (!query?.imgId && !query?.video1Id && !query?.video2Id) {
 return
 }

 const imgId = query?.imgId
 const video1Id = query?.video1Id
 const video2Id = query?.video2Id
 console.log(
 `Parameters received, imgId: ${imgId}, video1Id: ${video1Id}, video2Id: ${video2Id}`
 )
 const imgURL = getFileURL(imgId)
 const video1URL = getFileURL(`${video1Id}.mp4`)
 const video2URL = getFileURL(`${video2Id}.mp4`)
 const imagePath = `/tmp/${imgId}`
 const video1Path = `/tmp/${video1Id}.mp4`
 const video2Path = `/tmp/${video2Id}.mp4`
 const outputPath = `/tmp/${imgId}.mp4`
 await Promise.all([
 downloadFile(imgURL, imagePath),
 downloadFile(video1URL, video1Path),
 downloadFile(video2URL, video2Path),
 ])
 await new Promise((resolve, reject) => {
 console.log('Input files downloaded')
 ffmpeg()
 .input(imagePath)
 .inputFormat('image2')
 .inputFPS(30)
 .loop(1)
 .size('1080x1080')
 .videoCodec('libx264')
 .format('mp4')
 .outputOptions([
 '-tune animation',
 '-pix_fmt yuv420p',
 '-profile:v baseline',
 '-level 3.0',
 '-preset medium',
 '-crf 23',
 '-movflags +faststart',
 '-y',
 ])
 .output(outputPath)
 .on('end', () => {
 console.log('Output file generated')
 resolve()
 })
 .on('error', (e) => {
 console.log(e)
 reject()
 })
 .run()
 
 })
 await uploadFile(outputPath, imgId + '.mp4')
 .then((url) => {
 body = JSON.stringify({
 url,
 })
 })
 .catch((error) => {
 console.error(error)
 statusCode = 400
 body = error?.message ?? error
 })
 console.log(`File uploaded to S3`)
 const headers = {
 'Content-Type': 'application/json',
 'Access-Control-Allow-Headers': 'Content-Type',
 'Access-Control-Allow-Origin': 'https://tikex.com, https://borespiac.hu',
 'Access-Control-Allow-Methods': 'GET',
 }
 return {
 statusCode,
 body,
 headers,
 }
 } catch (error) {
 console.error(error)
 return {
 statusCode: 500,
 body: JSON.stringify('Error fetching data'),
 }
 }
}

const downloadFile = async (url, path) => {
 try {
 console.log(`Download will start: ${url}`)
 const response = await axios(url, {
 responseType: 'stream',
 })
 if (response.status !== 200) {
 throw new Error(
 `Failed to download file, status code: ${response.status}`
 )
 }
 response.data
 .pipe(fs.createWriteStream(path))
 .on('finish', () => console.log(`File downloaded to ${path}`))
 .on('error', (e) => {
 throw new Error(`Failed to save file: ${e}`)
 })
 } catch (e) {
 console.error(`Error downloading file: ${e}`)
 }
}
const uploadFile = async (path, id) => {
 const buffer = fs.readFileSync(path)
 const params = {
 Bucket: 't44-post-cover',
 ACL: 'public-read',
 Key: id,
 ContentType: 'video/mp4',
 Body: buffer,
 }
 await client.send(new PutObjectCommand(params))
 return getFileURL(id)
}
const getFileURL = (id) => {
 const bucket = 't44-post-cover'
 const url = `https://${bucket}.s3.eu-central-1.amazonaws.com/${id}`
 return url
}



Added
AWSLambdaBasicExecutionRole-16e770c8-05fa-4c42-9819-12c468cb5b49
permission, with policy :

{
 "Version": "2012-10-17",
 "Statement": [
 {
 "Effect": "Allow",
 "Action": "logs:CreateLogGroup",
 "Resource": "arn:aws:logs:eu-central-1:634617701827:*"
 },
 {
 "Effect": "Allow",
 "Action": [
 "logs:CreateLogStream",
 "logs:PutLogEvents"
 ],
 "Resource": [
 "arn:aws:logs:eu-central-1:634617701827:log-group:/aws/lambda/promo-video-composer-2:*"
 ]
 },
 {
 "Effect": "Allow",
 "Action": [
 "s3:GetObject",
 "s3:PutObject",
 "s3:ListBucket"
 ],
 "Resource": [
 "arn:aws:s3:::example-bucket",
 "arn:aws:s3:::example-bucket/*"
 ]
 },
 {
 "Effect": "Allow",
 "Action": [
 "logs:CreateLogGroup",
 "logs:CreateLogStream",
 "logs:PutLogEvents"
 ],
 "Resource": [
 "arn:aws:logs:*:*:*"
 ]
 },
 {
 "Effect": "Allow",
 "Action": [
 "ec2:DescribeNetworkInterfaces"
 ],
 "Resource": [
 "*"
 ]
 },
 {
 "Effect": "Allow",
 "Action": [
 "sns:*"
 ],
 "Resource": [
 "*"
 ]
 },
 {
 "Effect": "Allow",
 "Action": [
 "cloudwatch:*"
 ],
 "Resource": [
 "*"
 ]
 },
 {
 "Effect": "Allow",
 "Action": [
 "kms:Decrypt"
 ],
 "Resource": [
 "*"
 ]
 }
 ]
}



What do I miss ?


janoskukoda@Janoss-MacBook-Pro promo-video-composer-2 % ls -l $(which ffmpeg)
lrwxr-xr-x 1 janoskukoda admin 35 Feb 10 12:50 /opt/homebrew/bin/ffmpeg -> ../Cellar/ffmpeg/5.1.2_4/bin/ffmpeg



-
avcodec : export motion vectors in frame side data on demand
16 juillet 2014, par Clément Bœschavcodec : export motion vectors in frame side data on demand
The reasoning behind this addition is that various third party
applications are interested in getting some motion information out of a
video "for free" when it is available.It was considered to export other information as well (such as the intra
information about the block, or the quantization) but the structure
might have ended up into a half full-generic, half full of codec
specific cruft. If more information is necessary, it should either be
added in the "flags" field of the AVMotionVector structure, or in
another side-data.This commit also includes an example exporting them in a CSV stream.
- [DH] .gitignore
- [DH] configure
- [DH] doc/APIchanges
- [DH] doc/Makefile
- [DH] doc/codecs.texi
- [DH] doc/examples/Makefile
- [DH] doc/examples/extract_mvs.c
- [DH] libavcodec/avcodec.h
- [DH] libavcodec/mpegvideo.c
- [DH] libavcodec/options_table.h
- [DH] libavutil/Makefile
- [DH] libavutil/frame.c
- [DH] libavutil/frame.h
- [DH] libavutil/motion_vector.h
- [DH] libavutil/version.h
-
Merge commit ’a6a750c7ef240b72ce01e9653343a0ddf247d196’
22 juin 2016, par Clément BœschMerge commit ’a6a750c7ef240b72ce01e9653343a0ddf247d196’
* commit ’a6a750c7ef240b72ce01e9653343a0ddf247d196’ :
tests : Move all test programs to a subdirectoryMerged-by : Clément Bœsch <clement@stupeflix.com>
- [DH] .gitignore
- [DH] common.mak
- [DH] libavcodec/Makefile
- [DH] libavcodec/tests/.gitignore
- [DH] libavcodec/tests/arm/dct.c
- [DH] libavcodec/tests/avfft.c
- [DH] libavcodec/tests/cabac.c
- [DH] libavcodec/tests/dct.c
- [DH] libavcodec/tests/fft-fixed.c
- [DH] libavcodec/tests/fft-fixed32.c
- [DH] libavcodec/tests/fft.c
- [DH] libavcodec/tests/golomb.c
- [DH] libavcodec/tests/iirfilter.c
- [DH] libavcodec/tests/imgconvert.c
- [DH] libavcodec/tests/jpeg2000dwt.c
- [DH] libavcodec/tests/mathops.c
- [DH] libavcodec/tests/motion.c
- [DH] libavcodec/tests/options.c
- [DH] libavcodec/tests/ppc/dct.c
- [DH] libavcodec/tests/rangecoder.c
- [DH] libavcodec/tests/snowenc.c
- [DH] libavcodec/tests/utils.c
- [DH] libavcodec/tests/x86/dct.c
- [DH] libavdevice/tests/.gitignore
- [DH] libavdevice/tests/timefilter.c
- [DH] libavfilter/tests/.gitignore
- [DH] libavfilter/tests/drawutils.c
- [DH] libavfilter/tests/filtfmts.c
- [DH] libavfilter/tests/formats.c
- [DH] libavformat/matroskaenc.c
- [DH] libavformat/tests/.gitignore
- [DH] libavformat/tests/movenc.c
- [DH] libavformat/tests/noproxy.c
- [DH] libavformat/tests/rtmpdh.c
- [DH] libavformat/tests/seek.c
- [DH] libavformat/tests/srtp.c
- [DH] libavformat/tests/url.c
- [DH] libavresample/tests/.gitignore
- [DH] libavresample/tests/avresample.c
- [DH] libavutil/Makefile
- [DH] libavutil/des.c
- [DH] libavutil/tests/.gitignore
- [DH] libavutil/tests/adler32.c
- [DH] libavutil/tests/aes.c
- [DH] libavutil/tests/atomic.c
- [DH] libavutil/tests/avstring.c
- [DH] libavutil/tests/base64.c
- [DH] libavutil/tests/blowfish.c
- [DH] libavutil/tests/bprint.c
- [DH] libavutil/tests/camellia.c
- [DH] libavutil/tests/cast5.c
- [DH] libavutil/tests/color_utils.c
- [DH] libavutil/tests/cpu.c
- [DH] libavutil/tests/crc.c
- [DH] libavutil/tests/des.c
- [DH] libavutil/tests/dict.c
- [DH] libavutil/tests/display.c
- [DH] libavutil/tests/error.c
- [DH] libavutil/tests/eval.c
- [DH] libavutil/tests/fifo.c
- [DH] libavutil/tests/file.c
- [DH] libavutil/tests/float_dsp.c
- [DH] libavutil/tests/hash.c
- [DH] libavutil/tests/hmac.c
- [DH] libavutil/tests/lfg.c
- [DH] libavutil/tests/lls.c
- [DH] libavutil/tests/log.c
- [DH] libavutil/tests/lzo.c
- [DH] libavutil/tests/md5.c
- [DH] libavutil/tests/murmur3.c
- [DH] libavutil/tests/opt.c
- [DH] libavutil/tests/parseutils.c
- [DH] libavutil/tests/pca.c
- [DH] libavutil/tests/pixdesc.c
- [DH] libavutil/tests/pixelutils.c
- [DH] libavutil/tests/random_seed.c
- [DH] libavutil/tests/rational.c
- [DH] libavutil/tests/ripemd.c
- [DH] libavutil/tests/sha.c
- [DH] libavutil/tests/sha512.c
- [DH] libavutil/tests/softfloat.c
- [DH] libavutil/tests/tea.c
- [DH] libavutil/tests/tree.c
- [DH] libavutil/tests/twofish.c
- [DH] libavutil/tests/utf8.c
- [DH] libavutil/tests/xtea.c
- [DH] library.mak
- [DH] libswresample/tests/.gitignore
- [DH] libswresample/tests/swresample.c
- [DH] libswscale/tests/.gitignore
- [DH] libswscale/tests/colorspace.c
- [DH] libswscale/tests/swscale.c
- [DH] tests/fate-run.sh
- [DH] tests/fate/fft.mak
- [DH] tests/fate/filter-audio.mak
- [DH] tests/fate/filter-video.mak
- [DH] tests/fate/libavcodec.mak
- [DH] tests/fate/libavdevice.mak
- [DH] tests/fate/libavformat.mak
- [DH] tests/fate/libavutil.mak
- [DH] tests/fate/seek.mak