
Recherche avancée
Autres articles (7)
-
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...) -
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)
Sur d’autres sites (3971)
-
Concatenate / Join MP4 files using ffmpeg and windows command line batch NOT LINUX
17 juillet 2014, par julesverneI’ve written a batch script that attempts to take a generic introductory title video (MP4) that runs for 12 seconds and attaches it to the beginning of 4 other MP4 videos (same video but each has a different language audio track)
According to ffmpeg syntax here : http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files the concat demuxer needs to be run from a text file that looks like this :
# this is a comment
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'I believe everything in my script up until the point of joining the files appears to be working correctly. But I get this error :
[concat @ 04177d00] Line 2: unknown keyword ''C:\Users\Joe\1May\session3\readyforfinalconversion\frenchfile.mp4'
filelistFrench.txt: Invalid data found when processing input
[concat @ 03b70a80] Line 2: unknown keyword ''C:\Users\Joe\1May\session3\readyforfinalconversion\spanishfile.mp4'
filelistSpanish.txt: Invalid data found when processing input
[concat @ 0211b960] Line 2: unknown keyword ''C:\Users\Joe\1May\session3\readyforfinalconversion\basquefile.mp4'
filelistBasque.txt: Invalid data found when processing input
[concat @ 03a20a80] Line 2: unknown keyword ''C:\Users\Joe\1May\session3\readyforfinalconversion\Englishfile.mp4'
filelistEnglish.txt: Invalid data found when processing inputI believe the issue lies in the text file I’m creating. Please excuse my n00b ignorance, but sometimes new script makers like myself get confused about developer jargon and may take things literally.
So when I look at that example text file they gave, am I correct in thinking THIS is what my text file should look like ?
# this is a comment
Titlefile.mp4 'C:\Users\Joe\1May\session3\readyforfinalconversion\Titlefile.mp4'
Englishfile.mp4 'C:\Users\Joe\1May\session3\readyforfinalconversion\Englishfile.mp4'Again, am I being too literal ? are the quotations correct ? Are the slashes correct ? In the example they provide the slashes in the path are / instead of normal windows \ . I’ll provide the entire script in case it helps.
@echo off
setlocal EnableDelayedExpansion
rem Create an array of languages
set i=0
for %%a in (French Spanish Basque English) do (
set /A i+=1
set term[!i!]=%%a
)
rem Get the title video file name from user
set /p titlevideofilename=What is the title video file
name?
rem create a path variable for the title video file
set pathtotitlevideo=%~dp0%titlevideofilename%
rem Get the names of the different language video files to append to the title video
rem create a path variable for each different language video files
for /L %%i in (1,1,4) do (
set /p language[%%i]=what is the name of the !term
[%%i]! file you want to append after the title video?
set pathtofile[%%i]=%~dp0!language[%%i]!
)
rem create data file for ffmpeg based on variable data
for /L %%i in (1,1,4) do (
echo # this is a comment>>filelist!term[%
%i]!.txt
echo file '%pathtotitlevideo%'>>filelist!term[%
%i]!.txt
echo file '!pathtofile[%%i]!'>>filelist!term[%
%i]!.txt
)
cls
rem join files using ffmpeg concat option
for /L %%i in (1,1,4) do (
c:\ffmpeg\ffmpeg\bin\ffmpeg.exe -loglevel error -f
concat -i filelist!term[%%i]!.txt -c copy !language[%
%i]!.!term[%%i]!.withtitle.mp4
)
endlocal
:eof
exitEDIT
Thanks to @foxidrive making me look at the simplicity of it... it occurred to me that Apparently I wasn’t being literal enough. I made these 3 changes and script works perfectly now
1 : "file" in there example literally meant the word "file"
2 : needed the use of single quotes not double quotes as it shows in there example.
3 : Used "\" instead of "/" as they have in there example.So NOW my code to create the text files looks like this :
rem create data file for ffmpeg based on variable data
for /L %%i in (1,1,4) do (
echo # this is a comment>>filelist!term[%
%i]!.txt
echo file '%pathtotitlevideo%'>>filelist!term[%
%i]!.txt
echo file '!pathtofile[%%i]!'>>filelist!term[%
%i]!.txt
)So NOW my text file looks like this :
# this is a comment
file 'C:\Users\Joe\1May\session3\readyforfinalconversion\Titlefile.mp4'
file 'C:\Users\Joe\1May\session3\readyforfinalconversion\Englishfile.mp4' -
Output black when I decode h264 720p with ffmpeg
6 décembre 2017, par José Marqueses SaxoFirst, sorry for my english. When I decode h264 720p in ardrone2.0 my output is black and I cant see anything.
I have try to change the value of
pCodecCtx->pix_fmt = AV_PIX_FMT_BGR24;
topCodecCtx->pix_fmt = AV_PIX_FMT_YUV420P;
and the value ofpCodecCtxH264->pix_fmt = AV_PIX_FMT_BGR24;
topCodecCtxH264->pix_fmt = AV_PIX_FMT_YUV420P;
but my program crash. What am I doing wrong ?. Thank you, see part of my code :av_register_all();
avcodec_register_all();
avformat_network_init();
// 1.2. Open video file
if(avformat_open_input(&pFormatCtx, drone_addr, NULL, NULL) != 0) {
mexPrintf("No conecct with Drone");
EndVideo();
return;
}
pCodec = avcodec_find_decoder(AV_CODEC_ID_H264);
pCodecCtx = avcodec_alloc_context3(pCodec);
pCodecCtx->pix_fmt = AV_PIX_FMT_BGR24;
pCodecCtx->skip_frame = AVDISCARD_DEFAULT;
pCodecCtx->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
pCodecCtx->err_recognition = AV_EF_CAREFUL;
pCodecCtx->skip_loop_filter = AVDISCARD_DEFAULT;
pCodecCtx->workaround_bugs = FF_BUG_AUTODETECT;
pCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO;
pCodecCtx->codec_id = AV_CODEC_ID_H264;
pCodecCtx->skip_idct = AVDISCARD_DEFAULT;
pCodecCtx->width = 1280;
pCodecCtx->height = 720;
pCodecH264 = avcodec_find_decoder(AV_CODEC_ID_H264);
pCodecCtxH264 = avcodec_alloc_context3(pCodecH264);
pCodecCtxH264->pix_fmt = AV_PIX_FMT_BGR24;
pCodecCtxH264->skip_frame = AVDISCARD_DEFAULT;
pCodecCtxH264->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
pCodecCtxH264->err_recognition = AV_EF_CAREFUL;
pCodecCtxH264->skip_loop_filter = AVDISCARD_DEFAULT;
pCodecCtxH264->workaround_bugs = FF_BUG_AUTODETECT;
pCodecCtxH264->codec_type = AVMEDIA_TYPE_VIDEO;
pCodecCtxH264->codec_id = AV_CODEC_ID_H264;
pCodecCtxH264->skip_idct = AVDISCARD_DEFAULT;
if(avcodec_open2(pCodecCtxH264, pCodecH264, &optionsDict) < 0)
{
mexPrintf("Error opening H264 codec");
return ;
}
pFrame_BGR24 = av_frame_alloc();
if(pFrame_BGR24 == NULL) {
mexPrintf("Could not allocate pFrame_BGR24\n");
return ;
}
// Determine required buffer size and allocate buffer
buffer_BGR24 =
(uint8_t *)av_mallocz(av_image_get_buffer_size(AV_PIX_FMT_BGR24,
pCodecCtx->width, ((pCodecCtx->height == 720) ? 720 : pCodecCtx->height) *
sizeof(uint8_t)*3,1));
// Assign buffer to image planes
av_image_fill_arrays(pFrame_BGR24->data, pFrame_BGR24->linesize,
buffer_BGR24,AV_PIX_FMT_BGR24, pCodecCtx->width, pCodecCtx->height,1);
// format conversion context
pConvertCtx_BGR24 = sws_getContext(pCodecCtx->width, pCodecCtx->height,
pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height, AV_PIX_FMT_BGR24,
SWS_BILINEAR | SWS_ACCURATE_RND, 0, 0, 0);
// 1.6. get video frames
pFrame = av_frame_alloc();
av_init_packet(&packet);
packet.data = NULL;
packet.size = 0;
}
//Captura un frame
void video::capture(mxArray *plhs[]) {
if(av_read_frame(pFormatCtx, &packet) < 0){
mexPrintf("Error al leer frame");
return;
}
do {
do {
rest = avcodec_send_packet(pCodecCtxH264, &packet);
} while(rest == AVERROR(EAGAIN));
if(rest == AVERROR_EOF || rest == AVERROR(EINVAL)) {
printf("AVERROR(EAGAIN): %d, AVERROR_EOF: %d,
AVERROR(EINVAL): %d\n", AVERROR(EAGAIN), AVERROR_EOF,
AVERROR(EINVAL));
printf("fe_read_frame: Frame getting error (%d)!\n", rest);
return;
}
rest = avcodec_receive_frame(pCodecCtxH264, pFrame);
} while(rest == AVERROR(EAGAIN));
if(rest == AVERROR_EOF || rest == AVERROR(EINVAL)) {
// An error or EOF occured,index break out and return what
// we have so far.
printf("AVERROR(EAGAIN): %d, AVERROR_EOF: %d, AVERROR(EINVAL): %d\n",
AVERROR(EAGAIN), AVERROR_EOF, AVERROR(EINVAL));
printf("fe_read_frame: EOF or some othere decoding error (%d)!\n",
rest);
return;
}
// 2.1.1. convert frame to GRAYSCALE [or BGR] for OpenCV
sws_scale(pConvertCtx_BGR24, (const uint8_t* const*)pFrame->data,
pFrame->linesize, 0,pCodecCtx->height, pFrame_BGR24->data,
pFrame_BGR24->linesize);
//}
av_packet_unref(&packet);
av_init_packet(&packet);
mwSize dims[] = {(pCodecCtx->width)*((pCodecCtx->height == 720) ? 720 :
pCodecCtx->height)*sizeof(uint8_t)*3};
plhs[0] = mxCreateNumericArray(1,dims,mxUINT8_CLASS, mxREAL);
//plhs[0]=mxCreateDoubleMatrix(pCodecCtx->height,pCodecCtx-
>width,mxREAL);
point=mxGetPr(plhs[0]);
memcpy(point, pFrame_BGR24->data[0],(pCodecCtx->width)*(pCodecCtx-
>height)*sizeof(uint8_t)*3);
} -
FFMPEG is really slow at extracting subtitles
3 mars 2021, par Gustav P SvenssonI'm trying to extract the subtitles from a 1080P video, around 40min long. I'm currently using this command (using fluent-ffmpeg in node, but the translated command is this) :


ffmpeg -threads 3 -map 0: -c copy 



This command takes about 20-30 min to complete. I've searched quite a lot on how to speed up this process, if I look at my task manager I can see that ffmpeg is using 0.1% of the CPU which makes me think that it's possible to speed up this process.


I'm not sure if the -
threads
option is actually doing anything when extracting subtitles but I don't think it should make it slower atleast ?

So my question is, is it possible to speed up this process ? I appriciate any help.


Full FFMPEG log:
fmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
 configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
 libavutil 55. 78.100 / 55. 78.100
 libavcodec 57.107.100 / 57.107.100
 libavformat 57. 83.100 / 57. 83.100
 libavdevice 57. 10.100 / 57. 10.100
 libavfilter 6.107.100 / 6.107.100
 libavresample 3. 7. 0 / 3. 7. 0
 libswscale 4. 8.100 / 4. 8.100
 libswresample 2. 9.100 / 2. 9.100
 libpostproc 54. 7.100 / 54. 7.100
Input #0, matroska,webm, from '/home/test.mkv:
 Metadata:
 encoder : libebml v1.3.6 + libmatroska v1.4.9
 creation_time : 2019-03-14T16:46:55.000000Z
 Duration: 00:41:20.29, start: 0.000000, bitrate: 6430 kb/s
 Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
 Metadata:
 BPS-eng : 5788926
 DURATION-eng : 00:41:20.020000000
 NUMBER_OF_FRAMES-eng: 59461
 NUMBER_OF_BYTES-eng: 1794581562
 _STATISTICS_WRITING_APP-eng: mkvmerge v31.0.0 ('Dolores In A Shoestand') 64-bit
 _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-14 16:46:55
 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
 Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
 Metadata:
 title : English
 BPS-eng : 640000
 DURATION-eng : 00:41:20.288000000
 NUMBER_OF_FRAMES-eng: 77509
 NUMBER_OF_BYTES-eng: 198423040
 _STATISTICS_WRITING_APP-eng: mkvmerge v31.0.0 ('Dolores In A Shoestand') 64-bit
 _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-14 16:46:55
 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
 Stream #0:2(eng): Subtitle: subrip
 Metadata:
 BPS-eng : 80
 DURATION-eng : 00:40:22.295000000
 NUMBER_OF_FRAMES-eng: 645
 NUMBER_OF_BYTES-eng: 24473
 _STATISTICS_WRITING_APP-eng: mkvmerge v31.0.0 ('Dolores In A Shoestand') 64-bit
 _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-14 16:46:55
 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
 Stream #0:3(eng): Subtitle: subrip
 Metadata:
 title : SDH
 BPS-eng : 86
 DURATION-eng : 00:40:31.012000000
 NUMBER_OF_FRAMES-eng: 709
 NUMBER_OF_BYTES-eng: 26142
 _STATISTICS_WRITING_APP-eng: mkvmerge v31.0.0 ('Dolores In A Shoestand') 64-bit
 _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-14 16:46:55
 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Output #0, srt, to 'test6.srt':
 Metadata:
 encoder : Lavf57.83.100
 Stream #0:0(eng): Subtitle: subrip
 Metadata:
 BPS-eng : 80
 DURATION-eng : 00:40:22.295000000
 NUMBER_OF_FRAMES-eng: 645
 NUMBER_OF_BYTES-eng: 24473
 _STATISTICS_WRITING_APP-eng: mkvmerge v31.0.0 ('Dolores In A Shoestand') 64-bit
 _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-14 16:46:55
 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
 Stream #0:2 -> #0:0 (copy)
Press [q] to stop, [?] for help
size= 46kB time=00:40:36.68 bitrate= 0.2kbits/s speed=11.6x 
video:0kB audio:0kB subtitle:24kB other streams:0kB global headers:0kB muxing overhead: 94.438766%