
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (91)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (11915)
-
Unusual results extracting VP9 pkt_size with ffprobe as compared to H.264
26 novembre 2016, par Jeff S.I’m trying to graph the bitrate over time for H.264 and VP9 videos by extracting the frame size with ffprobe, but many of the VP9 videos are showing significantly lower bitrate and total size than both the file size would indicate and that ffprobe reports.
Can someone point me in the right direction for finding the missing bytes ?
For example :
# The extracted values and the ffprobe values are very close for mp4
Video Codec: h264
Video Bitrate: 0.668869
Frame Bitrate: 0.665552571931
Video Size: 6381536.0
Frame Total Size: 6349891
# The extracted values and the ffprobe values are very different for some vp9 videos
Video Codec: vp9
Video Bitrate: 0.600966
Frame Bitrate: 0.375144984531
Video Size: 5730519.0
Frame Total Size: 3577195Below is what I’m using for validation. Note that the sample videos do not contain audio.
import subprocess
import json
def export_video_info(video_id):
proc = subprocess.Popen(['ffprobe',
'-v', 'quiet', '-print_format',
'json', '-show_format',
'-show_streams', '-show_frames',
video_id
],
stdout=subprocess.PIPE,
)
return proc.communicate()[0]
# Example video: https://www.youtube.com/watch?v=g_OdgCrnzYo
# youtube-dl --id -f 135 https://www.youtube.com/watch?v=g_OdgCrnzYo
# youtube-dl --id -f 244 https://www.youtube.com/watch?v=g_OdgCrnzYo
video_list = ['g_OdgCrnzYo.mp4', 'g_OdgCrnzYo.webm']
'''
Format for every frame:
{
"media_type": "video",
"key_frame": 0,
"pkt_pts": 84484,
"pkt_pts_time": "84.484000",
"pkt_dts": 84484,
"pkt_dts_time": "84.484000",
"best_effort_timestamp": 84484,
"best_effort_timestamp_time": "84.484000",
"pkt_duration": 33,
"pkt_duration_time": "0.033000",
"pkt_pos": "7103361",
"pkt_size": "28",
"width": 854,
"height": 480,
"pix_fmt": "yuv420p",
"sample_aspect_ratio": "1:1",
"pict_type": "P",
"coded_picture_number": 0,
"display_picture_number": 0,
"interlaced_frame": 0,
"top_field_first": 0,
"repeat_pict": 0
},
'''
# NOTE: videos do not include audio
for video in video_list:
output = json.loads(export_video_info(video))
ff_bitrate = float(output['format']['bit_rate']) / 10**6
ff_duration = float(output['format']['duration'])
ff_codec = output['streams'][0]['codec_name']
ff_size = float(output['format']['size'])
frame_size_sum = 0
for val, items in enumerate(output['frames']):
if output['frames'][val]['media_type'] == 'video':
frame_size_sum += int(output['frames'][val]['pkt_size'])
frame_bitrate = frame_size_sum / ff_duration * 8 / 10**6
print('Video Codec: {}\nVideo Bitrate: {}\nFrame Bitrate: {}\nVideo Size: {}\nFrame Total Size: {}\n\n'.format(ff_codec, ff_bitrate, frame_bitrate, ff_size, frame_size_sum)) -
C# FFMPEG Process and Multiple files
3 novembre 2016, par wesmanI am working on a C# Form tool that will help me convert all of my phone and DSLR video to HEVC, currently, i have a program that uploads the photos and videos to different directories in my home server each time i connect to the WiFi. Once a month or so, i manually convert all the videos, but thought I would automate the process.. I have the Form working perfectly for processing 1 file. but get into trouble when processing a Directory (with possible sub-directories) all at once..
Sorry, this is long, just want to be thorough. here is the button calls
private void processFile_Click(object sender, EventArgs e)
{
OpenFileDialog file = new OpenFileDialog();
file.InitialDirectory = baseMediaDirectory;
if (file.ShowDialog() == DialogResult.OK)
{
ProcessSinlgeFile(file.FileName);
}
}(above)for one file and (below) for a directory
private void processDirectory_Click(object sender, EventArgs e)
{
FolderBrowserDialog file = new FolderBrowserDialog();
file.SelectedPath = baseMediaDirectory;
if(file.ShowDialog() == DialogResult.OK)
{
ProcessDirectoryOfFiles(file.SelectedPath);
}
}
private void ProcessDirectoryOfFiles(string selectedPath)
{
List<string> listOfFiles = GetAllFiles(selectedPath);
foreach (string s in listOfFiles)
{
ProcessSinlgeFile(s);
}
}
</string>both ultimately call this method, to do some checks and setup
private void ProcessSinlgeFile(string fileName)
{
if (IsAcceptableMediaFile(fileName))
{
outputWindow.AppendText("File to Process: " + fileName);
processMediaFile =
new MediaFileWrapper(this.outputWindow, new MediaFile(fileName), new NReco.VideoInfo.FFProbe());
if (processMediaFile.OkToProcess)
{
int initialCRFValue = 15;
//ultrafast superfast veryfast faster fast medium slow slower veryslow placebo
string intialSpeed = "veryfast";
try {
ConvertToMPEG(processMediaFile.getFFMPEGCommand(initialCRFValue, intialSpeed), processMediaFile);
}
catch
{
// at somepoint, we'll catch a bad file size (or compression)
// then change the CRF value and/or compression speed
}
}
}
}ultimately I get to this Method and run into trouble.
private async void ConvertToMPEG(string arguments, MediaFileWrapper processMediaFile)
{
startTime = DateTime.Now;
watch = new Stopwatch();
watch.Start();
progressBar1.Minimum = 0;
progressBar1.Maximum = processMediaFile.GetTotalMilliseconds();
// Start the child process.
p = new Process();
//Setup filename and arguments
outputWindow.AppendText("ffmpeg " + arguments);
p.StartInfo.Arguments = arguments;
p.StartInfo.FileName = "ffmpeg.exe";
p.StartInfo.UseShellExecute = false;
// Redirect the output stream of the child process.
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
// capture the date for stdout and std error
// note FFMPEG uses Stderr exclusively
p.ErrorDataReceived += new DataReceivedEventHandler(ErrorDataReceived);
p.OutputDataReceived += new DataReceivedEventHandler(OutputDataReceived);
// Hide Console Window
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.Start();
p.BeginErrorReadLine();
p.BeginOutputReadLine();
await p.WaitForExitAsync();
}and WaitForExitAsync is in another class because in can not be in here with a Form
public static Task WaitForExitAsync(this Process process,
CancellationToken cancellationToken = default(CancellationToken))
{
var tcs = new TaskCompletionSource();
process.EnableRaisingEvents = true;
process.Exited += (sender, args) => tcs.TrySetResult(null);
if (cancellationToken != default(CancellationToken))
cancellationToken.Register(tcs.SetCanceled);
return tcs.Task;
}however, single files work fine, when I call a directory through, it continuously starts processes for each file, trying to run them all at the same time. You can see I tried implementing this
process.WaitForExit() asynchronously
with no luck. -
Debugging in Visual Studio without Pdb files (C++ Access Voilation)
2 décembre 2016, par Prakash MI built OpenCV binaries(.dll) using Cmake & visual studio which generated .pdb file which helped me to find the issue in code (Partially !)
How this Crash is being caused. .
I’m using a software with which we can set internet download speed limit (transfer rate) for any particular program.Now if i connect IP camera to the code below, i noticed that my app needs around 100Kb/s of internet usage (transfer rate) - only then i can watch live stream seamlessly.
Lets say i cut down (set) my application internet usage to 10Kb/s [This is the reason behind crash]
in this case, i should be able to see a new frame once in 4+ seconds.I’m getting access violation error probably because (
cap>>img;
) cap is trying to reach a location in ram & get the frame but there is no frame YET because its still being downloaded due to low internet speed.
Clearly the pointer is reaching some location in ram to grab a frame which is not yet present.Some interesting behaviour . . .
Void OpenCamera()
{
VideoCapture cap("http://192.168.1.3:8080/video?x.xmjpeg");
Mat img;
while(true)
{
try
{
if(cap.isOpened()) //also tried grab + retrieve, crashes at grab
cap>>img; //code crashes here
}
catch(...)
{
cout<<"Camera Disconnected"<code>If i use the entire code in same class (within same header file), there is no problem at all(new frame is displayed after 4+ seconds without crashing the program) but if i put the code into a separate class(different header file), then call the function to open camera from a class object, then it crashes if internet speed is cut down.
weird behavior - if i debug step by step, it never crashes !when i build opencv library with ffmpeg , i get .pdb file only for opencv (opencv_world310.pdb)- so no issue debugging using call stack
but i do not get pdb for ffmpeg (because Opencv_ffmpeg.dll is precompiled and that is where its crashing)hence its getting hard to debug, building ffmpeg doesn’t produce pdb file cause its built using MSYS
so is it possible to debug with what we have ?I’m including snapshot from visual studio debugging,
some of the variables that will help in understanding :typedef int (*CvGrabFrame_Plugin)( void* capture_handle ); [cap_ffmpeg_api.cpp]
protected: void* ffmpegCapture; [cap_ffmpeg.cpp]
static CvGrabFrame_Plugin icvGrabFrame_FFMPEG_p = 0; [cap_ffmpeg.cpp]Exception thrown at 0x0A0AF6F0 (opencv_ffmpeg310.dll) in Sample.exe :
0xC0000005 : Access violation reading location 0x00000020. If there is
a handler for this exception, the program may be safely continued.in source code i included below line & compiled & used it in project - didn’t work, crashed again !
if(ffmpegCapture)
- null pointer checkcan we make some changes at line 214 in [cap_ffmpeg.cpp] to avoid crash ?
other header files are just one folder up.Update : I noticed that program crashes immediately when i limit internet consumption speed. I’m using C++/Cli(winforms, target dot net Framework = 4.6), i have CameraClass (in separate header file) & main function in (separate header file)
Main function has below codeCameraClass ^CC = gcnew CameraClass();
CC->OpenCamera();Some clash between .net memory handling & C++ memory handling ?