
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (109)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
L’agrémenter visuellement
10 avril 2011MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.
Sur d’autres sites (10501)
-
ffmpeg livestream only shows one frame at a time
28 octobre 2016, par user3308335So, I’ve tried to turn one of my pis into a silly "baby cam" for my pet and I followed the tutorial made by Ustream.tv on how to do this.
This is the script I run to start the stream :
#!/bin/bash
RTMP_URL=<rtmpurl>
STREAM_KEY=<streamkey>
while :
do
raspivid -n -hf -t 0 -w 640 -h 480 -fps 15 -b 400000 -o - | ffmpeg -i - -vcodec copy -an -f flv $RTMP_URL/$STREAM_KEY
sleep 2
done
</streamkey></rtmpurl>However, whenever I go to view the stream, the stream shows only one frame. The same frame until I refresh the browser, watch the ad again, and then it’s a new same frame that it’ll show.
Does anyone have an idea why this might be happening or any troubleshooting tricks for me to try ?
-
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.