
Recherche avancée
Autres articles (26)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
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 (6688)
-
Error opening filters : Running ffmpeg through Groovy and ProcessBuilder
30 octobre 2016, par smeebThis question involves the popular Linux media processing utility "
ffmpeg
", but I think its really a Java 8ProcessBuilder
question at its core. Or possibly an issue w/ GroovyGStrings
.The
ffmpeg
command to split an MP4 video into frames/images based on a sampling rate is :ffmpeg -i /some/path/to/video.mp4 -vf "select=not(mod(n\,${samplingRate}))" -vsync vfr -q:v 2 img_%d.jpg
Where
${samplingRate}
is a positive integer and represents the number of frames to skip in between creating each frame. So for instance, if you had a video with 430 frames in it, and wanted to sample every 50th frame, your command would be :ffmpeg -i /some/path/to/video.mp4 -vf "select=not(mod(n\,50))" -vsync vfr -q:v 2 img_%d.jpg
Which would then create 8 (or maybe 9, not gonna do the math for a pretend example) JPG files called
img_1.jpg
,img_2.jpg
, ...etc. The first image would be the 50th frame in the video. The second image would be the 100th frame, etc. I have ran the above command directly from a terminal and confirmed that it is correct and succeeds without errors.I have a Groovy app, and am trying to run this
ffmpeg
command via a Java 8ProcessBuilder
, and am having issues with theselect=
argument. Currently I have :int numSamples = 50
Process frameSamplerProc = new ProcessBuilder(
'ffmpeg',
'-i',
"/home/myuser/some/path/to/video.mp4",
'-vf',
"\"select=not(mod(n\\,${numSamples}))\"",
'-vsync',
'vfr',
'-q:v',
'2',
'sample%d.jpg'
).redirectErrorStream(true).start()
frameSamplerProc.inputStream.eachLine { fsamplerLine ->
println(fsamplerLine)
}When I run thise code, I don’t get any errors, but I do see errors in
ffmpeg
’s output :ffmpeg version N-81995-gd790e48 Copyright (c) 2000-2016 the FFmpeg developers
// Omitting the next ~50 lines of output as it all looks normal
Metadata:
creation_time : 2016-10-27T20:20:01.000000Z
handler_name : SoundHandle
[AVFilterGraph @ 0x3eddc80] No such filter: '"select'
Error opening filters!I’m wondering if I’m not escaping the
select
argument properly or if I’m passing in a bad array to theProcessBuilder
. Can anybody spot where I’m going awry ? -
Moviepy write_videofile works the second time but not the first ?
30 novembre 2023, par Andrew BestI'm concatenating a list of video objects together then writing them with write_videofile, weirdly enough the first time I write the file, it plays fine for the first halfish then the first few frames of each clip in the file afterwards plays before freezing. But here's the odd part, If I write the exact same video object right after the first video writes, it writes just fine and plays perfectly.


Here's my code


from moviepy.editor import VideoFileClip, concatenate_videoclips

clipslist = []
clips = ['https://clips-media-assets2.twitch.tv/AT-cm%7C787619651.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787628097.mp4', 'https://clips-media-assets2.twitch.tv/2222789345-offset-20860.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787624765.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787539697.mp4', 'https://clips-media-assets2.twitch.tv/39235981488-offset-3348.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788412970.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787682495.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787962593.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787627256.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787573008.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788543065.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787593688.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788079881.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788707738.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788021727.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787595029.mp4', 'https://clips-media-assets2.twitch.tv/39233367648-offset-9536.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788517651.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788087743.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787497542.mp4', 'https://clips-media-assets2.twitch.tv/39233367648-offset-9154.mp4', 'https://clips-media-assets2.twitch.tv/7109626012888880881-offset-4818.mp4', 'https://clips-media-assets2.twitch.tv/72389234-offset-760.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787774924.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787565708.mp4']

for clip in clips:
 dlclip = VideoFileClip(clip, target_resolution=(1080, 1920)) # Download clip
 clipslist.append(dlclip)

videofile = concatenate_videoclips(clipslist)
videofile.write_videofile("final1.mp4") # Broken after the first halfish
videofile.write_videofile("final2.mp4") # Works entirely fine.
videofile.close



Any ideas ? Any suggestions appreciated.


- 

- Sometimes when the video is small enough it seems to write the first time just fine too.
- It seems there is no set point where it breaks, each time I write it for the first time it typically breaks at a different spot.
- I've tried waiting for the thread to exit and sleeping after the concatenation and that doesn't seem to fix the issue.








-
FFMPEG — Error when trying to concat multiple files with and without audio
7 août 2020, par PhilbanOk so thanks to a fellow user I have the following FFMPEG command that concats 4 videos together. Now if I use this command with 4 video files that all have audio everything works ! However, if 1 or more of the videos do not have sound I get a "matches no streams" error.


Can someone spot whats wrong here please ?


Video Input 1 - No Audio so adding the anullsrc
Video 2 - Has Audio
Video 3 - No Audio
Video 4 - Has Audio


ffmpeg -i noSound1.mp4 -i story1.mp4 -i noSound2.mp4 -i story2.mp4 -t 0.1 -f lavfi -i anullsrc=channel_layout=stereo -filter_complex 
"[0:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30,format=yuv420p[v0]; 
 [1:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30,format=yuv420p[v1]; 
 [2:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30,format=yuv420p[v2]; 
 [3:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30,format=yuv420p[v3]; 
 [0:a]aformat=sample_rates=48000:channel_layouts=stereo[a0]; 
 [1:a]aformat=sample_rates=48000:channel_layouts=stereo[a1]; 
 [2:a]aformat=sample_rates=48000:channel_layouts=stereo[a2]; 
 [3:a]aformat=sample_rates=48000:channel_layouts=stereo[a3]; 
 [v0][a0][v1][a1][v2][a2][v3][a3]concat=n=4:v=1:a=1[v][a]" 
-map "[v]" -map "[a]" -c:v libx264 -c:a aac -movflags +faststart testOutput.mp4



Here is the error :


Stream specifier ':a' in filtergraph description [0:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30,format=yuv420p[v0]; [1:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30,format=yuv420p[v1]; [2:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30,format=yuv420p[v2]; [3:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30,format=yuv420p[v3]; [0:a]aformat=sample_rates=48000:channel_layouts=stereo[a0]; [1:a]aformat=sample_rates=48000:channel_layouts=stereo[a1]; [2:a]aformat=sample_rates=48000:channel_layouts=stereo[a2]; [3:a]aformat=sample_rates=48000:channel_layouts=stereo[a3]; [v0][a0][v1][a1][v2][a2][v3][a3]concat=n=4:v=1:a=1[v][a] matches no streams.



Now a slightly separate question. If I have N input videos where i do not know if they have sound or not, is there a way I can have a loop that does the above without having massive amounts of command lines ?
Many thanks !