
Recherche avancée
Autres articles (103)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
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 (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (12291)
-
node-fluent-ffmpeg doesn't resize videos correctly when given specific size
8 décembre 2019, par YagizVersion information
- fluent-ffmpeg version : 2.1.2
- ffmpeg version : ffmpeg version 4.1.3
- OS : mac os x mojave 10.14.3
Code to reproduce
First cut the videos using this command :
const cutVideo = async (currentWord) => {
return new Promise((resolve, reject) => {
console.log('cutting video', currentWord.file)
ffmpeg(currentWord.file)
.videoCodec('libx264')
// .addOptions('-vf "setdar=ratio=16/9:max=1000"')
.on('start', command => console.log('command', command))
.on('error', reject)
.on('end', resolve)
.withSize('640x360')
.withAspect('16:9')
.applyAutopadding(true, 'black')
.saveToFile(currentWord.file.replace('-unfinished', ''), './')
})
}Later merge them together using
.mergeToFile()
command :const mergeFilesAsync = async function(files, folder, filename)
{
return new Promise((resolve, reject) => {
console.log('merging files', files)
var cmd = ffmpeg({ logger: console })
.videoCodec('libx264')
.on('start', command => console.log('command', command))
.on('error', reject)
.on('end', resolve)
for (var i = 0; i < files.length; i++)
{
const currentWord = files[i]
cmd.input(currentWord.file.replace('-unfinished', ''))
}
cmd.mergeToFile(folder + "/" + filename, folder);
});
}Expected results
The videos resized in cutVideo function should have 640x360 size with 16:9 aspect ratio.
Observed results
The first video processed had a dimension of : 850 × 480, the output after processing it is : 642 × 360 (It should be 640x360)
The second video processed had a dimension of : 1152 × 480, the output after processing it is : 638 × 360
The third video processed had a dimension of 853 × 480, the output after processing it is : 642 × 360
FFmpeg command produced by fluent-ffmpeg :
ffmpeg -i /Users/yagiz/Desktop/video-creator/what's-unfinished.mp4 -y -vcodec libx264 -filter:v scale=w='if(gt(a,1.7777777777777777),640,trunc(360*a/2)*2)':h='if(lt(a,1.7777777777777777),360,trunc(640/a/2)*2)',pad=w=640:h=360:x='if(gt(a,1.7777777777777777),0,(640-iw)/2)':y='if(lt(a,1.7777777777777777),0,(360-ih)/2)':color=black /Users/yagiz/Desktop/video-creator/what's.mp4
cutting video /Users/yagiz/Desktop/video-creator/up?-unfinished.mp4and
ffmpeg -i /Users/yagiz/Desktop/video-creator/up?-unfinished.mp4 -y -vcodec libx264 -filter:v scale=w='if(gt(a,1.7777777777777777),640,trunc(360*a/2)*2)':h='if(lt(a,1.7777777777777777),360,trunc(640/a/2)*2)',pad=w=640:h=360:x='if(gt(a,1.7777777777777777),0,(640-iw)/2)':y='if(lt(a,1.7777777777777777),0,(360-ih)/2)':color=black /Users/yagiz/Desktop/video-creator/up?.mp4
I think that 1.77777 value in this command produces a lower bound or an upper bound of the actual item.
Any idea where the issue lies ?
Thanks !
-
OpenCV - Generate adaptive background for video
17 avril 2019, par bozzmobI want to achieve something like this-
Say I have a video which is a vertical video(Dimension- 720x1280). I want to create a horizontal video with adaptive background like the video I’ve shown.
I have written some code for reading and writing to a file.video_index = 0
cap = cv2.VideoCapture(videofiles[0])
# video resolution: 1920x1080 px
out = cv2.VideoWriter("video.mp4v",
cv2.VideoWriter_fourcc(*'MP4V'),
30, (1920, 1080), 1)What is the effect of having background to the video which smudges on the sides called in opencv/ffmpeg or otherwise ?
How do I achieve this effect using code or tools(I am open to using OSS desktop tools) ? -
PHP/FFmpeg can not save video
19 mai 2019, par tour travelThe error is :
[Sun May 19 11:41:03.158185 2019] [php7:error] [pid 32405] [client
85.133.232.4:35172] PHP Fatal error : Uncaught Alchemy\BinaryDriver\Exception\ExecutionFailureException : ffmpeg
failed to execute command ’/usr/bin/ffmpeg’ ’-y’ ’-i’ ’Sample.mp4’
’-async’ ’1’ ’-metadata:s:v:0’ ’start_time=0’ ’-f’ ’webm’ ’-vcodec’
’libvpx’ ’-acodec’ ’libvorbis’ ’-b:v’ ’1000k’ ’-refs’ ’6’ ’-coder’ ’1’
’-sc_threshold’ ’40’ ’-flags’ ’+loop’ ’-me_range’ ’16’ ’-subq’ ’7’
’-i_qfactor’ ’0.71’ ’-qcomp’ ’0.6’ ’-qdiff’ ’4’ ’-trellis’ ’1’ ’-b:a’
’128k’ ’-vf’ ’[in]scale=320:240 [out]’ ’export-webm.webm’ in
/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100\nStack
trace :\n#0
/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72) :
Alchemy\BinaryDriver\ProcessRunner->doExecutionFailure(’’/usr/bin/ffmpe...’)\n#1
/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(209) :
Alchemy\BinaryDriver\ProcessRunner->run(Object(Symfony\Component\Process\Process),
Object(SplObjectStorage), false)\n#2
/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(137) :
Alchemy\BinaryDr in
/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractVideo.php on
line 106aWhat I trying to do is, save video :
require '/vendor/autoload.php';
$ffmpeg = FFMpeg\FFMpeg::create();
$ffprobe = FFMpeg\FFProbe::create();
$video = $ffmpeg->open('Sample.mp4');
$video
->filters()
->resize(new FFMpeg\Coordinate\Dimension(320, 240))
->synchronize();
$video
->save(new FFMpeg\Format\Video\X264('aac'), 'export-x264.mp4')What I have done :
I searched and similar topics tell me to set permission to my files and folders, I set user and also set 755 to files and folders but still I have this error and no success, any idea ?
Errorlog :
Fatal error : Uncaught
Alchemy\BinaryDriver\Exception\ExecutionFailureException : ffmpeg
failed to execute command ’/usr/bin/ffmpeg’ ’-y’ ’-i’ ’Sample.mp4’
’-async’ ’1’ ’-metadata:s:v:0’ ’start_time=0’ ’-vcodec’ ’libx264’
’-acodec’ ’aac’ ’-b:v’ ’1000k’ ’-refs’ ’6’ ’-coder’ ’1’
’-sc_threshold’ ’40’ ’-flags’ ’+loop’ ’-me_range’ ’16’ ’-subq’ ’7’
’-i_qfactor’ ’0.71’ ’-qcomp’ ’0.6’ ’-qdiff’ ’4’ ’-trellis’ ’1’ ’-b:a’
’128k’ ’-vf’ ’[in]scale=320:240 [out]’ ’-pass’ ’1’ ’-passlogfile’
’/tmp/ffmpeg-passes5ce11d01dc0038yfbl/pass-5ce11d01dc0c7’
’export-x264.mp4’ in
/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100
Stack trace : #0
/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72) :
Alchemy\BinaryDriver\ProcessRunner->doExecutionFailure(’’/usr/bin/ffmpe...’)1 /vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(209) :
Alchemy\BinaryDriver\ProcessRunner->run(Object(Symfony\Component\Process\Process),
Object(SplObjectStorage), false) #2 /vendor/alchemy/binary-driver in
/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractVideo.php on
line 106