
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (20)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
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 (3136)
-
Solved : ffmpeg : How can a MOV with transparent background be created ?
25 mars 2017, par Mat(Remark : the error sat, as usual, between back-rest and keyboard. Thanks, Mulvya !)
Hi, specialists !
I’m trying - with no success at all - to convert the green pixels of a background into transparent ones and output the result as clip with ffmpeg. N.b. I do not want to lay the clip over anything ; I’m not having a problem with that. What I want is a clip with transparent background for the OpenShot video editor (the chromakey filter of which doesn’t work satisfyingly).
What I have tried (amongst a felt 1 zillion other things over the last 15 hrs.) was
ffmpeg.exe -i in.mov -vf chromakey=0x008001:0.115:0.0 -c:v qtrle out.mov
but the pixels simply would not be transparent. Seemingly, nothing happens. I reckon the filter is ok, because it works fine in a complex chain (overlaying a background image).
The output of ffprompt -show_stream -show_format of out.mov is as follows :
[STREAM]
index=0
codec_name=qtrle
codec_long_name=QuickTime Animation (RLE) video
profile=unknown
codec_type=video
codec_time_base=1/30
codec_tag_string=rle
codec_tag=0x20656c72
width=1920
height=1080
coded_width=1920
coded_height=1080
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=bgra
level=-99
color_range=N/A
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=unspecified
field_order=progressive
timecode=N/A
refs=1
id=N/A
r_frame_rate=30/1
avg_frame_rate=30/1
time_base=1/15360
start_pts=0
start_time=0.000000
duration_ts=54789
duration=3.566992
bit_rate=822383192
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=107
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:handler_name=DataHandler
TAG:encoder=Lavc57.64.101 qtrle
[/STREAM]
[STREAM]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/44100
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=44100
channels=2
channel_layout=stereo
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=926
start_time=0.020998
duration_ts=157481
duration=3.570998
bit_rate=132103
max_bit_rate=132103
bits_per_raw_sample=N/A
nb_frames=153
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:handler_name=DataHandler
[/STREAM]
[FORMAT]
filename=out.mov
nb_streams=2
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=3.567000
size=366708874
bit_rate=822447712
probe_score=100
TAG:major_brand=qt
TAG:minor_version=512
TAG:compatible_brands=qt
TAG:encoder=Lavf57.56.101
[/FORMAT]I have a "sample" clip which shows the behaviour I want, with the following stream and information :
[STREAM]
index=0
codec_name=qtrle
codec_long_name=QuickTime Animation (RLE) video
profile=unknown
codec_type=video
codec_time_base=1/24
codec_tag_string=rle
codec_tag=0x20656c72
width=1920
height=1080
coded_width=1920
coded_height=1080
has_b_frames=0
sample_aspect_ratio=0:1
display_aspect_ratio=0:1
pix_fmt=bgra
level=-99
color_range=N/A
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=unspecified
field_order=progressive
timecode=N/A
refs=1
id=N/A
r_frame_rate=24/1
avg_frame_rate=24/1
time_base=1/12288
start_pts=0
start_time=0.000000
duration_ts=74760
duration=6.083984
bit_rate=49226848
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=146
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:handler_name=DataHandler
TAG:encoder=Lavc57.24.102 qtrle
[/STREAM]
[STREAM]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/48000
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/48000
start_pts=0
start_time=0.000000
duration_ts=293856
duration=6.122000
bit_rate=53537
max_bit_rate=128000
bits_per_raw_sample=N/A
nb_frames=288
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:handler_name=DataHandler
[/STREAM]
[FORMAT]
filename=templateOK.mov
nb_streams=2
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=6.144000
size=37478506
bit_rate=48800138
probe_score=100
TAG:major_brand=qt
TAG:minor_version=512
TAG:compatible_brands=qt
TAG:encoder=Lavf57.25.100
[/FORMAT]and I simply am not able to spot the relevant difference.
Any suggestions would be highly appreciated !
Cheers,
Mat
The input, output and the working template can be found here.
(The security issue you might see when clicking the link comes from the server certificate being self-signed. You can accept a temporal exception. Btw : The ridiculous file size of the output file will be the next nut to crack. Probably s.t. about compression.)
-
C++/OpenCV - VideoCapture doesn't work but it worked before with exactly the same code
5 mars 2015, par Damià ObradorI’m trying to write a shot boundary detection algorithm in C++ using OpenCV. After all, I have to say that I have no experience working with OpenCV.
I have been improving the following code (and I am still in it) during the last two weeks and everything seems the works correctly, not in terms of perfect shot detection, but every line of code did what was expected from it.
#include <cstdlib>
#include <opencv2></opencv2>opencv.hpp>
#include <opencv2></opencv2>core/core.hpp>
#include <opencv2></opencv2>video/background_segm.hpp>
#include <opencv2></opencv2>highgui/highgui.hpp>
#include <iostream>
#include <opencv2></opencv2>imgproc/imgproc.hpp>
#include
#include <istream>
#include <fstream>
using namespace cv;
int main(){
VideoCapture capture("vdevendetta.mp4");
if ( !capture.isOpened() )
{
std::cout << "Cannot open the video file";
return -1;
}
int numFrames=capture.get(CV_CAP_PROP_FRAME_COUNT);
bool SB_counter=false;
Mat currentFrame;
Mat frame;
Mat fore;
Mat back;
vector<mat> frames;
FileStorage file;
FileStorage file2;
Mat prev_Y;
Mat channels[3];
for(int i=0;i>currentFrame;
frame=currentFrame.clone();
cvtColor(frame,frame,CV_BGR2YUV);
split( frame, channels );
prev_Y=channels[0];
SB_counter=false;
}
else
{
capture>>currentFrame;
frame=currentFrame.clone();
Mat channels[3];
cvtColor(frame,frame,CV_BGR2YUV);
split( frame, channels );
Mat curr_Y=channels[0];
channels[0]=prev_Y;
prev_Y=curr_Y;
merge(channels,3,frame);
cvtColor(frame,frame,CV_Luv2BGR);
cvtColor(frame,frame,CV_BGR2GRAY);
frames.push_back(frame);
}
}
vector<double> MAFDs;
vector<double> MAFD;
vector<double> aux;
double min;
double min2;
for(int j=1;j14)
{
std::cout<<"De"<*
std::ofstream fout("MAFD.txt");
if(fout.is_open()==true)
{
//file opened successfully so we are here
std::cout << "File Opened successfully!!!. Writing data from array to file" << std::endl;
for(int i = 0; MAFD[i] != '\0'; i++)
{
fout << MAFD[i]; //writing ith character of array in the file
}
std::cout << "Array data successfully saved into the file test.txt" << std::endl;
}
else //file could not be opened
{
std::cout << "File could not be opened." << std::endl;
}*/
return 0;
}
</double></double></double></mat></fstream></istream></iostream></cstdlib>Three days ago I had an strange problem. The line :
VideoCapture capture("vdevendetta.mp4");
stopped working. I spent many hours looking for the solution but nothing seems to repair it. After reading everything related with OpenCV, VideoCapture and ffmpeg that I found on internet I decided to reinstall everything taking care of each detail, but it still didn’t work. Finally I solved it changing the line with this other one :
VideoCapture capture("/home/damia/Documentos/Universitat/ARA/PAEAV/workspace_cpp/SBD/src/vdevendetta.mp4");
I did not know why this solved it because the video is in the same directory than the program, but I continued working because everything seemed correct.
Today I had the same problem again on the new line.
The terminal doesn’t show any error comment (exceptuating "Cannot open the video file", obviously) but the code doesn’t work again.I’m using Ubuntu 14.04 LTS, OpenCV 2.4.9 and Eclipse.
I think if someone test the code it will run correctly, but I would like to know if there is something I have no taking into account.
Thank you very match.
-
ffmpeg version 2.6.8 : Stream specifier ':a' in filtergraph description matches no streams
16 décembre 2020, par AshitakaI am not getting why this isn't working.. I have tried to get the video streams with [0:v]/[0:1]/[0:v:0] & the audio streams with [0:a]/[0:0]/[0:0:0].
nothing worked.


Explaining the inputs :


1.1st input stream is a video that can be of varying resolution on which the filter adds a padding on to make it 600:480.


2.2nd input is an overlay png which is already at 5:4 ratio.. just making it 600:480 before it gets overlaid in the filter.


3.3rd & 4th ones are also videos which I don't care if they get stretched.. n they are getting stretched to 600:480.


4.so finally there are 3 streams 1 overlaid video 2 stretched videos which needs to be concatenated.


here's the command :


ffmpeg 
-i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4' 
-i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png' 
-i '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4' 
-i '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4' 
-filter_complex
"[0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a]" 
-map "[v]" 
-map "[a]" 
-c:v libx264 
-shortest /home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_final.mp4



this is the complete error I am getting :


Stream specifier ':a' in filtergraph description [0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a] matches no streams.



also there are these warnings :


[Parsed_setsar_9 @ 0x219fba0] num:den syntax is deprecated, please use num/den or named options instead
[Parsed_setsar_11 @ 0x21a4840] num:den syntax is deprecated, please use num/den or named options instead



Complete log as requested :


[root@cloud ~]# ffmpeg -i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4' -i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png' -i '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4' -i '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4' -filter_complex \ "[0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx264 -shortest /home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_final.mp4
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
 built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
 configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libdc1394 --enable-libfaac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
 libavutil 54. 20.100 / 54. 20.100
 libavcodec 56. 26.100 / 56. 26.100
 libavformat 56. 25.101 / 56. 25.101
 libavdevice 56. 4.100 / 56. 4.100
 libavfilter 5. 11.102 / 5. 11.102
 libavresample 2. 1. 0 / 2. 1. 0
 libswscale 3. 1.101 / 3. 1.101
 libswresample 1. 1.100 / 1. 1.100
 libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2017-08-21 02:23:24
 Duration: 00:02:17.23, start: 0.000000, bitrate: 417 kb/s
 Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x360 [SAR 1:1 DAR 16:9], 318 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
 Metadata:
 creation_time : 2017-08-21 02:23:24
 handler_name : IsoMedia File Produced by Google, 5-11-2011
Input #1, png_pipe, from '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png':
 Duration: N/A, bitrate: N/A
 Stream #1:0: Video: png, rgba, 600x479, 25 tbr, 25 tbn, 25 tbc
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 1
 compatible_brands: mp41mp42isom
 creation_time : 2018-01-31 22:40:09
 Duration: 00:00:04.90, start: 0.103811, bitrate: 846 kb/s
 Stream #2:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/bt709), 1920x1080, 827 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
 Metadata:
 creation_time : 2018-01-31 22:40:10
 handler_name : Core Media Video
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 1
 compatible_brands: mp41mp42isom
 creation_time : 2018-01-31 22:40:09
 Duration: 00:00:04.90, start: 0.103811, bitrate: 846 kb/s
 Stream #3:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/bt709), 1920x1080, 827 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
 Metadata:
 creation_time : 2018-01-31 22:40:10
 handler_name : Core Media Video
[Parsed_setsar_9 @ 0x17c8ba0] num:den syntax is deprecated, please use num/den or named options instead
[Parsed_setsar_11 @ 0x17cd840] num:den syntax is deprecated, please use num/den or named options instead
Stream specifier ':a' in filtergraph description [0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a] matches no streams.