
Recherche avancée
Autres articles (86)
-
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 -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (6187)
-
Return of FFMPEG in Background
7 septembre 2018, par Bruno AndradeI am making a code that downloads a list of
m3u8
links byFFMPEG
I had this code :
function FFMPEG($videocode, $dirvideo) {
$ffmpeg = '"D:\FFMPEG\bin\ffmpeg.exe"' . " -hide_banner -loglevel verbose -n -i https://linkplaylist/{$videocode}.m3u8 -map 0:1 -map 0:2 -acodec copy -bsf:a aac_adtstoasc -vcodec copy {$dirvideo} 1> log.txt 2>&1";
exec($ffmpeg, $output, $var);
return $var;
}
$code = FFMPEG('football', 'football.mp4');
if($code){
{ERROR CODE};
}else{
{SUCCESS CODE}
}Initial problem
And that worked well. I could download the video and know if it was downloaded completely or had some error.
The problem is that this code "hangs" the script in exec () the page is loading until finalize exec () and that of timeout error (shared server) besides being visually strange to the visitor the page loading.
Resolution of the initial problem
After research I think the solution is to put the code execution in the background so I found this code :
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read from
1 => array("pipe", "w"), // stdout is a pipe that the child will write to
2 => array("file", "error-output.txt", "a") // stderr is a file to write to
);
function FFMPEG($videocode, $dirvideo) {
$cmd = 'start /B D:\FFMPEG\bin\ffmpeg.exe -y -i "https://linkplaylist/{$videocode}.m3u8" -map p:0 -acodec copy -bsf:a aac_adtstoasc -vcodec copy {$dirvideo}';
proc_close(proc_open ($cmd
,$descriptorspec, $foo));
}And finally my current problem
And this works fine for the loading and timeout issue, but I can not get a return from when the download was successfully completed.
1 ° proc_open Is this the best solution for my initial problem ?
2 ° How can I get a return from when ffmpeg finishes running successfully and the script continues to flow.
Extra Info
I’m trying to build a solution that works on windows (xampp) but my final server is linux.
-
Why is this ffmpeg conversion turning up trash ?
12 octobre 2015, par DigitalJedi805So, the company I work for still archives some of our data in Windows Media format.
I’ve written a C# application that loops through all of our WMVs, and in the event that a corresponding MP4 doesn’t exist, it fires off ffmpeg to convert the file.
What I’m running into, is a combination of problems.
When I run the following into ffmpeg ( rough C# ) :
"-i " + File.FullName + " -vf scale=720:480 -b:v 512k -bufsize 512k -vcodec libx264 -acodec aac -strict experimental " + OutputPath
I end up with a file that cannot play in our browser based player ( JWPlayer ), and cannot play on my local system in Windows Media Player.
Additionally, the file is larger than my WMV, and is larger than the file I output with [roughly] the same parameters in AVS Video Converter.
Furthermore, the file details don’t show any values for the video properties - as in, when I right click and go to properties->details, under ’video’, there is a list of length, height, width, frame rate, and bitrate - they are all empty - when I would very much expect some data normally.
Does anyone have any idea how I can make the conversion more straightforward, or what might be creating the problem in the first place ?
I’ve tried running this without scaling or bitrate parameters, and added them as an attempt to resolve the more core problem - obviously to no avail.
For everyone’s appeasement...
FFMPEG Output :
video:537604kB audio:158748kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 1.159483%
[libx264 @ 0453d000] frame I:1234 Avg QP:19.98 size: 33645
[libx264 @ 0453d000] frame P:94430 Avg QP:22.92 size: 3984
[libx264 @ 0453d000] frame B:208152 Avg QP:30.67 size: 638
[libx264 @ 0453d000] consecutive B-frames: 7.6% 1.8% 4.0% 86.6%
[libx264 @ 0453d000] mb I I16..4: 10.5% 61.2% 28.2%
[libx264 @ 0453d000] mb P I16..4: 0.4% 1.4% 0.3% P16..4: 26.8% 9.3% 4.8%
0.0% 0.0% skip:57.0%
[libx264 @ 0453d000] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 21.6% 1.1% 0.2%
direct: 0.4% skip:76.6% L0:42.6% L1:55.1% BI: 2.3%
[libx264 @ 0453d000] 8x8 transform intra:65.1% inter:71.9%
[libx264 @ 0453d000] coded y,uvDC,uvAC intra: 61.6% 59.3% 30.9% inter: 6.0% 6.7%
1.7%
[libx264 @ 0453d000] i16 v,h,dc,p: 34% 52% 7% 7%
[libx264 @ 0453d000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 27% 24% 3% 4% 4% 5%
4% 7%
[libx264 @ 0453d000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 38% 10% 3% 5% 4% 6%
3% 5%
[libx264 @ 0453d000] i8c dc,h,v,p: 47% 35% 14% 4%
[libx264 @ 0453d000] Weighted P-Frames: Y:0.2% UV:0.1%
[libx264 @ 0453d000] ref P L0: 67.8% 12.3% 14.3% 5.6% 0.0%
[libx264 @ 0453d000] ref B L0: 88.7% 9.7% 1.6%
[libx264 @ 0453d000] ref B L1: 92.6% 7.4%
[libx264 @ 0453d000] kb/s:434.44I’ll make the video files available shortly.
-
YUV8_420P - AVFrame conversion hazard (only Y plan)
4 mai 2017, par FlowI’m working on a FFMPEG application. The goal is to convert a picture (YUV input format) to an AVFrame to be able to process it (by applying a specific filter) and then realize the invert conversion to redirect it to the output.
Although some filters as drawgrid or noise are perfectly working, filters which apply some "space transformation" (as a "crop" or a "hflip") seem to affect only over the Y component. The colors of the output pictures aren’t filtered which leads to an unsatisfying result.
I’m asking myself why I have such a result but I didn’t reach to find the problem origin.
Here is the part of cod which convert the YUV picture to an AVFrame :
unsigned int i = 0;
int number_common_channels = MIN(IMAGEFORMAT_COMPONENTS, AV_NUM_DATA_POINTERS);
// Transfer the image informations (width, height, pitch and data)
if ((av_im->width = yuv_im->width[0]) <= 0)
{
cu_printf(ERROR, "Width of destination picture null or negative");
return -1;
}
if((av_im->height = yuv_im->height[0]) <= 0)
{
cu_printf(ERROR, "Height of destination picture null or negative");
return -1;
}
for (i=0; i < number_common_channels; i++)
{
av_im->linesize[i] = yuv_im->pitch[i];
av_im->data[i] = yuv_im->data[i];
}If necessary, I can transmit you other parts of the cod where the problem could be. Thanks for your cooperation.
Flow.
EDIT 1 : After some researches, it would be possible the problem came from my function which initializes the filter graph. Actually, I used the FFMPEG example given on their website to make it and I deleted the options to the pixel format list because I thought it was useless. It’s possible this function and more precisely the av_opt_set_int_list could be the key, but I don’t reach to find a good example using it. Also, another function, av_opt_set_pixel_fmt was created in the last FFMPEG versions and this could be well to try using it, but I don’t know how to do. So please if someone has a good example with that, I’ll took it with hapiness.
EDIT 2 : The problem came from the way I copied my data back after the filter was applied. Closed.