
Recherche avancée
Autres articles (81)
-
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras. -
Problèmes fréquents
10 mars 2010, parPHP et safe_mode activé
Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site -
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 (...)
Sur d’autres sites (11949)
-
OpenGLES glReadPixels exc_bad_access
29 novembre 2011, par YannyI'm trying to create video from images using OpenGLES and ffmpeg, but on iPad(4.3) I have a crash on glReadPixels
-(NSData *) glToUIImage {
int numberOfComponents = NUMBER_OF_COMPONENTS; //4
int width = PICTURE_WIDTH;
int height = PICTURE_HEIGHT;
NSInteger myDataLength = width * height * numberOfComponents;
NSMutableData * buffer= [NSMutableData dataWithLength :myDataLength];
[self checkForGLError];
GLenum type = NUMBER_OF_COMPONENTS == 3 ? GL_RGB : GL_RGBA; //RGBA
glReadPixels(0, 0, width, height, type, GL_UNSIGNED_BYTE, [buffer mutableBytes]); //EXC_BAD_ACCESS here
return buffer;
}It is working on iPhone 4 (4.3) and iPod Touch, but have problems on iPhone 3G(3.0) and iPad(4.3). Can you help me with this issue ?
Also on iPhone 3G(3.0) and iPad(4.3) I have problems with Video - first 5-20 video frames have trash. Maybe issue with optimization ? Or architecture ?
-
Perl and ffmpeg script
21 novembre 2016, par armight29The first part of my script that asks whether to check for cinavia doesn’t work. That is, if I type in ’y’ or ’Y’ it doesn’t proceed to the
CNVIACHk
function but goes instead to theMVIEPARAMs
function.# GET FILE INPUT..
print "Enter Filename..";
my $MOVIe = <stdin>;
print "Check For Cinavia? Enter y or n\n";
my $CNVIAQUESt = <stdin>;
if ( $CNVIAQUESt eq "y" || $CNVIAQUESt eq "Y" ) {
CNVIACHk( $MOVIe );
}
else {
MVIEPARAMs( $MOVIe );
}
sub MVIEPARAMs {
system(
"ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $MOVIe"
);
print "Duration In Seconds..";
$DURATIOn = <stdin>;
system(
'ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width "$MOVIe"'
);
print "Movie Width? ";
$MOVIEWIDTh = <stdin>;
print "Movie Height? ";
$MOVIEHEIGHt = <stdin>;
print "Enter Target Width.. ";
$TARGETWIDTh = <stdin>;
print "Enter Target Height.. ";
$TARGETHEIGHt = <stdin>;
system(
'ffprobe -show_entries stream=index,codec_type:stream_tags=language -of compact "$MOVIe" -v 0 | grep eng'
);
print "Enter number of English Audio Track.. ";
$ENGAUDTRk = <stdin>;
print "English Audio Track Number Is ", $ENGAUDTRk, ".";
$BTRTe = 31875072 / $DURATIOn;
DETRMNEPAd;
}
sub DETRMNEPAd {
if ( $MOVIEWIDTh < $TARGETWIDTh ) {
$X = $TARGETWIDTh - $MOVIEWIDTh / 2;
}
elsif ( $MOVIEHEIGHt < $TARGETHEIGHt ) {
$Y = $TARGETHEIGHt - $MOVIEHEIGHt / 2;
$X = 0;
print $Y;
}
else {
print "Padding Not Needed Moving On...";
CNVRTWOPAd();
}
CNVRTWPAd();
}
sub CNVIACHk {
print "Checking Movie For Cinavia.. ";
system( "cinde -i $MOVIe -q high -l" );
print "Enter Track To Check.. ";
$TRKTOCHEk = <stdin>;
system( "cinde -i $MOVIe -q high -t $TRKTOCHEk" );
print "Was Cinavia Detected?";
$CNVIACHKANSr = <stdin>;
if ( $CNVIACHKANSr eq "y" ) {
exit;
}
else {
print "Would You Like To Check Another Track?";
$CHKANTHRTRk = <stdin>;
if ( $CHKANTHRTRk eq "y" ) {
CNVIACHk();
}
else {
MVIEPARAMs();
}
}
}
sub CNVRTWOPAd {
print "BEGINNING CONVERSION...\n";
print "What Preset Would You Like To Use?";
$PRESEt = <stdin>;
system(
"ffmpeg -i $MOVIe -map 0:0 -map 0:$ENGAUDTRk -c:v libx264 -b:v $BTRTe -preset $PRESEt -strict -2 -c:a ac3 -b:a 192k -threads 12 -pass 1 -f matroska dummy && ",
"ffmpeg -i $MOVIe -map 0:0 -map 0:$ENGAUDTRk -c:v libx264 -b:v $BTRTe -preset $PRESEt -strict -2 -c:a ac3 -b:a 192k -threads 12 -pass 2 -f matroska ENCODE1.mkv"
);
}
sub CNVRTWPAd {
print "BEGINNING CONVERSION...\n";
print "What Preset Would You Like To Use?";
my $PRESEt = <stdin>;
system(
"ffmpeg -i $MOVIe -map 0:0 -map 0:$ENGAUDTRk -c:v libx264 -b:v $BTRTe -preset $PRESEt -vf \"pad=$TARGETWIDTh:$TARGETHEIGHt:$X:$Y:black\" -strict -2 -c:a ac3 -b:a 192k ",
" -threads 12 -pass 1 -f matroska dummy && ffmpeg -i $MOVIe -map 0:0 -map 0:$ENDAUDTRk -c:v libx264 -b:v $BTRTe -preset $PRESEt -vf \"pad=$TARGETWIDTh:$TARGETHEIGHt:$X:$Y:black\"",
" -strict -2 -c:a ac3 -b:a 192k -threads 12 -pass 2 -f matroska ENCODE1.mkv"
);
}
</stdin></stdin></stdin></stdin></stdin></stdin></stdin></stdin></stdin></stdin></stdin></stdin></stdin> -
RUN FFMPEG IN PYTHON
7 janvier 2023, par SMARTI have 1 video & 1 audio.


video's duration : 4s


audio's duration : 7.48 s


i wrote python function to combine these files


MY CODE :


import subprocess as sp

 def runffmpeg(cmd):
 try:
 pipe = sp.Popen(cmd, stdout=sp.PIPE, stderr=sp.STDOUT,
 universal_newlines=True)
 
 ffmpeg_output, _ = pipe.communicate()
 
 print(ffmpeg_output)
 return (ffmpeg_output)
 
 except sp.CalledProcessError as err:
 print("FFmpeg stdout output on error:\n" + err.output)
 
 def get_duration(fn):
 cmd = (
 f"ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 {fn}")
 
 cmd1 = (
 f"ffprobe -v error -of flat=s_ -select_streams 1 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 {fn}")
 try:
 pipe = sp.Popen(cmd, stdout=sp.PIPE, stderr=sp.STDOUT,
 universal_newlines=True)
 
 viddur, _ = pipe.communicate()
 
 print(viddur)
 
 pipe = sp.Popen(cmd1, stdout=sp.PIPE, stderr=sp.STDOUT,
 universal_newlines=True)
 
 auddur, _ = pipe.communicate()
 
 try:
 auddur = float(auddur.strip())
 except:
 auddur = 0
 
 print(auddur)
 
 # if (len(auddur) == 0):
 # auddur = 0
 
 return float(viddur.strip()), (auddur)
 
 except sp.CalledProcessError as err:
 print("FFmpeg stdout output on error:\n" + err.output)
 

def set_audio_to_video(vn, an, output):

 vdur, adur = get_duration(fn=vn)
 print(f" video duration is {vdur}")

 auddur, adur = get_duration(fn=an)
 print(f" audio duration is {auddur}")

 #cmd = (f" ffmpeg -i {vn} -i {an} -filter_complex \"[0:v]setpts=PTS*{auddur}/{vdur} [v];atempo={auddur}/{vdur} [a]\" -map \"[v]\" -map 1:a -shortest -y {output}")

cmd = (
 f" ffmpeg -i {vn} -i {an} -filter_complex \"[0:v]setpts=PTS*{auddur}/{vdur} [v]\" -map \"[v]\" -map 1:a -shortest -pix_fmt yuv420p -y {output}")
print(cmd)

x = runffmpeg(cmd=cmd)



to call the function :
set_audio_to_video(vn="cremovie.mp4", an="a1.wav", output="output.mp4")


i'm getting error :


Traceback (most recent call last):
 File "e:\MOVIEPY\FFMPEG-PYTHON.py", line 439, in <module>
 set_audio_to_video(vn="cremovie.mp4", an="a1.wav", output="output.mp4")
 File "e:\MOVIEPY\FFMPEG-PYTHON.py", line 424, in set_audio_to_video
 x = runffmpeg(cmd=cmd)
 File "e:\MOVIEPY\FFMPEG-PYTHON.py", line 399, in runffmpeg
 pipe = sp.Popen(cmd, stdout=sp.PIPE, stderr=sp.STDOUT,
 File "C:\Python39\lib\subprocess.py", line 947, in __init__
 self._execute_child(args, executable, preexec_fn, close_fds,
 File "C:\Python39\lib\subprocess.py", line 1416, in _execute_child
 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
 OSError: [WinError 87] The parameter is incorrect
</module>


final command generated by function will look like :


ffmpeg -i cremovie.mp4 -i a1.wav -filter_complex "[0:v]setpts=PTS*7.489116/4.0 [v]" -map "[v]" -map 1:a -shortest -pix_fmt yuv420p -y output.mp4



i want to extend the video's duration to audio's duration ( video's duration increased to from 4s to 7.48 s)


while running this ffmpeg command in command prompt (CMD) , its working , got no errors but in python , i'm getting errors.


SYSTEM DETAILS :
WINDOWS 10 64 BITS
PYTHON 3.9 64 BITS


WHAT TO DO ?