
Recherche avancée
Médias (91)
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Echoplex (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Discipline (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Letting you (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
999 999 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (98)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
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
Sur d’autres sites (9390)
-
Return multiple parameters in Python
7 mars 2018, par Georgе StoyanovI am trying to re-write one of my scripts using functions. It is analyzing couple of transport stream files in a directory and then returns the GoP size of all TS files using ffprobe and writes the json file to the log directory. So this is originally my script and it works just fine :
#!/usr/bin/env python
import subprocess
import json
import os.path
recdir = "/home/user/recordings/"
logdir = "/home/user/logs/"
for input_file in os.listdir(recdir):
gop_list = []
p = 0
fname = os.path.splitext(input_file)[0]
if input_file.endswith(".ts"):
abs_file = recdir + "/" + input_file
# Execute the ffprobe command for analysing the GoP Structure
gop_data = subprocess.check_output(['ffprobe', '-v', 'quiet', '-read_intervals', "%+10", '-print_format', 'json', '-select_streams', 'v', '-show_frames', '-show_entries', 'frame=coded_picture_number,key_frame,pict_type', abs_file])
# print gop_data
# Write output to a file
out = open("{}_gop_data.json".format(fname), "w+")
out.write(gop_data)
out.close
#End of writing
# Loading the json file
gop = json.loads(gop_data.decode('utf-8'))
print "-------------------------- GoP information for {} ------------------------------".format(input_file)
print
# Calculating the GoP length of the video(difference between two IDR frames)
for i in range(len(gop["frames"])):
if (gop["frames"][i]["pict_type"]) == "I" and (gop["frames"][i]["key_frame"] == 1):
gop_list.append(i)
p += 1
# Printing the first 5 results if present
for r in range(1, p):
print "GoP frame length Nr: {0} is: {1}".format(r, (gop_list[r] - gop_list[r-1] + 1))
print
for i in range(len(gop["frames"])):
if (gop["frames"][i]["pict_type"]) == "I" and (gop["frames"][i]["key_frame"] == 1):
gop_list.append(i)
p += 1I want to create 3 functions out of it. One is to execute the ffprobe command and to save the output to a variable "gop". Another one is to write the json output to different files and the third is to present the data to the command line. The problem currently is that the first function is returning the gop parameter but it returns only the last one. Please keep in mind that these files are quite big. So I think I need to return the name of the file and the corresponding GoP file at the same time and use this data for the other two functions (write_gop_data and iframe_calculator) but I am not sure how I can do that.
#!/usr/bin/env python
import subprocess
import json
import os.path
recdir = "/home/user/recordings/"
logdir = "/home/user/logs/"
def reading_gop_data(input_directory):
for input_file in os.listdir(input_directory):
fname = os.path.splitext(input_file)[0]
if input_file.endswith(".ts"):
abs_file = recdir + input_file
# Execute the ffprobe command for analysing the GoP Structure
gop = subprocess.check_output(['ffprobe', '-v', 'quiet', '-read_intervals', "%+10", '-print_format', 'json', '-select_streams', 'v', '-show_frames', '-show_entries', 'frame=coded_picture_number,key_frame,pict_type', abs_file])
return gop
def write_gop_data(gop_data, input_directory, save_directory):
for input_file in os.listdir(input_directory):
fname = os.path.splitext(input_file)[0]
out = open("{}{}_gop.json".format(save_directory, fname), "w+")
out.write(gop_data)
out.close
def iframe_calculator(gop_data, input_directory):
for input_file in os.listdir(input_directory):
gop_list = []
p = 0
if input_file.endswith(".ts"):
gop_json = json.loads(gop_data.decode('utf-8'))
print "-------------------------- GoP information for {} ------------------------------".format(input_file)
print
# Calculating the GoP length of the video(difference between two IDR frames)
for i in range(len(gop_json["frames"])):
if (gop_json["frames"][i]["pict_type"]) == "I" and (gop_json["frames"][i]["key_frame"] == 1):
gop_list.append(i)
p += 1
# Printing the first 5 results if present
for r in range(1, p):
print "GoP frame length Nr: {0} is: {1}".format(r, (gop_list[r] - gop_list[r-1] + 1))
print
# reading_gop_data(recdir)
write_gop_data(reading_gop_data(recdir), recdir, logdir)
iframe_calculator(reading_gop_data(recdir), recdir) -
lavc/vaapi_encode : Don't return error if the underlying driver doesn't support B...
6 février 2018, par Haihao Xianglavc/vaapi_encode : Don't return error if the underlying driver doesn't support B frames
The underlying driver need not support B frames - since they are enabled
by default for some codecs, it is better to disable them rather than
returning an error in this case. This makes the default settings usable
for low-power encoding on Intel platforms.Signed-off-by : Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by : Mark Thompson <sw@jkqxz.net> -
How to return width and height of a video/image using ffprobe & batch
7 octobre 2023, par user780756I need to get the width and height of an image file using ffprobe and need to store it in variables using batch (Windows) so I can later use those values.



I tried to do this,



@echo off
for /f "tokens=1-2" %%i in ('ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=width,height %1') do set W=%%i & set H=%%j
echo %W%
echo %H%




But fails to execute with



Argument '_' provided as input filename, but 's' was already specified.




p.s. I also tried imagemagick identify in a similar way, but it seems that identify has a bug when returning height for GIF files