
Recherche avancée
Médias (1)
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (69)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
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 (8645)
-
Error while trying to get output from command [C++]
8 septembre 2021, par JilijouI am trying to get the duration of a video using ffmpeg in C++ and I tried using a pipe to get the output from a command. I can't compile my code, getting this error :


video_concat.cpp: In function 'int main()':
video_concat.cpp:17:41: error: expected ',' or ';' before '{' token
 std::string exec(commande_duration_2) {
 ^
video_concat.cpp:51:1: error: expected '}' at end of input
 }
 ^



And this is my code :


#include <iostream>
#include <memory>
#include <stdexcept>
#include <array>
#include <cstdio>
#include 
#include <string>
#include <sstream>

using namespace std;

int main() {
 float duration_1, duration_2, full_duration;
 duration_1 = system("ffprobe -i goal1_25.mp4 -show_entries format=duration -v quiet -of csv=\"p=0\"");
 //duration_2 = system("ffprobe -i goal2_25.mp4 -show_entries format=duration -v quiet -of csv=\"p=0\"");
 const char* command_duration_2 = "ffprobe -i goal2_25.mp4 -show_entries format=duration -v quiet -of csv=\"p=0\"";
 std::string exec(commande_duration_2) {
 std::shared_ptr<file> pipe(popen(command_duration_2, "r"), pclose);
 if (!pipe) return "ERROR";
 char buffer[128];
 std::string result = "";
 while (!feof(pipe.get())) {
 if (fgets(buffer, 128, pipe.get()) != NULL) {
 duration_2 += buffer;
 }
 }
 return duration_2;
 }


 cout << duration_1 << " | " << duration_2;
 return 0;
}
</file></sstream></string></cstdio></array></stdexcept></memory></iostream>


If I put between /.../ the pipe section, everything works fine but I don't get any result (Output : 0 | 0). Can anyone help me ? Thanks !


-
How to set comma delimited values from stdout ?
28 octobre 2017, par gregmI have a batch file that processes the output of an ffprobe query. It retrieves several bits of data that I use to determine some ffmpeg directives. In particular I’m converting h264 videos into h265 if the video frame height is 720 or greater. I also convert the audio stream to aac if it isn’t already and if that stream is higher than 128 kbps I convert it down to 128.
I can do all of that by calling ffprobe a number of times and use if statements to decide what my ffmpeg command will be.
I’d like my batch file to be more efficient so I was thinking that if I could take the output of one (maybe two) ffprobe queries and then stick that output into a for /f token=.... loop then I could set each ffprobe data point to a variable and then just check the variables to decide what the resulting ffmpeg command will be.
Here’s what I have right now to simply check if the video stream is hevc. If it isn’t then ffmpeg converts the video to hevc and copies the audio to aac.
for %%a in ("*.*") do (
ffprobe -v quiet -show_entries stream=index,codec_name,height -of csv "%%a" 2>&1 | findstr "hevc"
if errorlevel 1 (
ffmpeg.exe -hwaccel cuvid -i "%%a" -pix_fmt p010le -c:v hevc_nvenc -preset slow -rc vbr_hq -b:v 4M -maxrate:v 10M -c:a aac "%%~na.h265-convert.mp4"
))That ffprobe query output looks like this :
stream,0,h264,480
I was thinking if I could tokenize that output with something like :
for /f "tokens=1,2,3,4 delims= " %%a in ("______") do set codec=%%b&set fheight=%%d
I don’t know what to put in the spot where I have the _______. I really don’t want to create a temp file unless that’s the only option though.
1) Is this an efficient way to achieve what I’m trying to do ?
2) What do I use where I have a blank line above ________ to call the output of the ffprobe query to use in my for loop ?
-
How to compile ffmpeg-0.10.3 on windows with cygwin and android ndk r5
19 avril 2014, par Vikram MahalI want to compile ffmpeg on windows with cygwin and android ndk.
I found this link very useful because there is step to step guide to compile ffmpeg.Does anyone find this useful ? - Compiling FFMPEG on Windows with Cywin and NDK r5
But at last point when i am going to create .so file i got this error in cygwin bash.
CONSOLE OUTPUT :
vikram mahal@vikrammahal-PC ~
$ cd /cygdrive/c/ffmpeg-0.10.3
vikram mahal@vikrammahal-PC /cygdrive/c/ffmpeg-0.10.3
$ dos2unix build_android.sh
dos2unix: converting file build_android.sh to Unix format ...
vikram mahal@vikrammahal-PC /cygdrive/c/ffmpeg-0.10.3
$ ./build_android.sh
)/configure: line 10: warning: setlocale: LC_ALL: cannot change locale (C
': not a valid identifierort: `LC_ALL
./configure: line 14: syntax error near unexpected token `$'{\r''
'/configure: line 14: `try_exec(){
./build_android.sh: line 54: make: command not found
./build_android.sh: line 55: make: command not found
C:\android-ndk-r5\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\ar
m-linux-androideabi-ld.exe: cannot open output file ./android/armv7-a/libffmpeg.
so: No such file or directory