Recherche avancée
Autres articles (18)
-
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...) -
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 ;
-
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (523)
-
ImgFlip Gif Generator
30 juillet 2013, par user1960364Reference : http://imgflip.com/gifgenerator
So, I don't need the web UI and all the cusomizations. But I've been trying to figure out how to slice and convert a mp4 or mov to an animated gif automagically. I've looked at several ways of doing it with imagemagick/ffmpeg but none of them rendered results as good as imgflip. I always end up with some 24bit color-looking gif instead or some impractically large file.
Any suggestions/ideas on how to do it as efficiently as imgflip ?
Thanks :)
— Edit —
I found this on reddit :#!/bin/bash
# Extracts each frame of the video as a single gif
ffmpeg -i $1 out%04d.gif
# Combines all the frames into one very nicely animated gif.
convert -delay 4 out*.gif anim.gif
# Optimizes the gif using imagemagick
convert -layers Optimize anim.gif optimized_output.gif
# Cleans up the leftovers
rm out*
rm anim.gifUsing that, I created (and yes, I'm on windows) :
ffmpeg -i v.mp4 -r 10 -q:v 1 tmp/out%04d.jpg
convert -delay 10 tmp/out*.jpg jpg-d10.gif
echo y | del tmpAnd got decent quality, even this creates an 8MB file for a small 6sec 480x480 clip at 10fps. And because it's a video and not vector or series of images with very few colors, extracting jpg images does better compression than
-layers Optimize
. However, for some reason, -qscale/-q:v on the frame extraction does not effect the final file size, just the quality. -
AWS lambda mp4 thumbnail generator using ffmpeg - incorrect format generated
10 avril 2021, par sam bhanduI am trying to create a thumbnail generator for every mp4 file uploaded to the s3 bucket. I have been following this post published by AWS. The code works fine for the transcoding video file. I changed the code to generate a thumbnail. The code does generate a file but it is an invalid image type.


import json
import os
import subprocess
import shlex
import boto3
import uuid

S3_DESTINATION_BUCKET = "example-bucket"
SIGNED_URL_TIMEOUT = 60

def lambda_handler(event, context):

 # s3_source_bucket = event['Records'][0]['s3']['bucket']['name']
 # s3_source_key = event['Records'][0]['s3']['object']['key']
 # s3_source_basename = os.path.splitext(os.path.basename(s3_source_key))[0]
 # s3_destination_filename = s3_source_basename + "_cfr.ts"
 
 hex_c = uuid.uuid4()
 s3_destination_filename = '/{}/{}.{}'.format('tmp',hex_c, 'jpg')
 s3_client = boto3.client('s3')
 s3_media_url = 'https://s3-us-west-2.amazonaws.com/example-bucket/videos/presentations/testing.mp4'
 ffmpeg_cmd = "/opt/bin/ffmpeg -i \"" + s3_media_url + "\" -ss 00:00:02 -vframes 1 \"" + s3_destination_filename + "\""
 # ffmpeg_cmd = "/opt/bin/ffmpeg -i \"" + s3_source_signed_url + "\" -f mpegts -c:v copy -af aresample=async=1:first_pts=0 -"
 
 command1 = shlex.split(ffmpeg_cmd)
 p1 = subprocess.run(command1, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 
 resp = s3_client.put_object(Body=s3_destination_filename, Bucket=S3_DESTINATION_BUCKET, Key='{}{}'.format(hex_c, '.jpg'))
 return {
 'statusCode': 200,
 'body': json.dumps('Processing complete successfully')
 }



Output is as :


{
 "statusCode": 200,
 "body": "\"Processing complete successfully\""
}

Function Logs
START RequestId: b73aaacc-5da5-417a-9f98-5def438dee96 Version: $LATEST
ffmpeg version 4.1.3-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzvbi --enable-libzimg
 libavutil 56. 22.100 / 56. 22.100
 libavcodec 58. 35.100 / 58. 35.100
 libavformat 58. 20.100 / 58. 20.100
 libavdevice 58. 5.100 / 58. 5.100
 libavfilter 7. 40.101 / 7. 40.101
 libswscale 5. 3.100 / 5. 3.100
 libswresample 3. 3.100 / 3. 3.100
 libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://s3-us-west-2.amazonaws.com/example-bucket/videos/presentations/testing.mp4':
 Metadata:
 major_brand : isom
 minor_version : 1
 compatible_brands: isomavc1mp42
 creation_time : 2020-04-17T18:31:33.000000Z
 Duration: 00:00:33.07, start: 0.000000, bitrate: 90 kb/s
 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 854x480 [SAR 1:1 DAR 427:240], 23 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc (default)
 Metadata:
 creation_time : 2020-04-17T18:31:29.000000Z
 Stream #0:1(eng): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s (default)
 Metadata:
 creation_time : 2020-04-17T18:31:29.000000Z
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x67ddc40] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/tmp/4633bb13-4a15-49b7-a445-d910bebaddf6.jpg':
 Metadata:
 major_brand : isom
 minor_version : 1
 compatible_brands: isomavc1mp42
 encoder : Lavf58.20.100
 Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 854x480 [SAR 1:1 DAR 427:240], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
 Metadata:
 creation_time : 2020-04-17T18:31:29.000000Z
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=0.4 q=6.3 Lsize=N/A time=00:00:00.03 bitrate=N/A speed=0.0149x 
video:14kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
END RequestId: b73aaacc-5da5-417a-9f98-5def438dee96
REPORT RequestId: b73aaacc-5da5-417a-9f98-5def438dee96 Duration: 6349.25 ms Billed Duration: 6350 ms Memory Size: 155 MB Max Memory Used: 123 MB Init Duration: 368.12 ms

Request ID
b73aaacc-5da5-417a-9f98-5def438dee96



An image file is uploaded to the S3 folder, but when I try to open it flags an invalid file format. The file size is only 40.0 Bytes.
S3 bucket image folder
invalid file format


-
ffmpeg - how to add multiple overlay gifs on top of video + command generator runs forever
7 juin 2021, par عبدالله لبيبthe user will choose multiple gifs, scale them, put them in the desired position on screen, then they will be overlayed on top of a video ..


in simple case where user choose only one gif to overlay .. this line was working very well for me, but now it runs forever !! :


'-i video.mp4 -ignore_loop 0 -i gif1.gif -b:v 1M '
'-filter_complex [1:v]scale=${width - 30}:${height - 30}[ovrl],'
'[0:v][ovrl]overlay=${x -30}:${y - 30}:shortest=1 output.mp4';



I used
shortest=1
to prevent it from running forever, but now even withshortest=1
it runs forever .. when I remove it and ignore_loop 0 the running forever problem stops, but gif works only once then stop !!

how to make it work for 3 or more gifs and how to stop it from running forever when I want to make gif looping ?