
Recherche avancée
Médias (1)
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (111)
-
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" (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (10463)
-
exr : check if line offset table is complete only once per frame
21 février 2013, par Paul B Maholexr : check if line offset table is complete only once per frame
-
cmdutils : add opencl command line options to ffmpeg
11 avril 2013, par highgod0401cmdutils : add opencl command line options to ffmpeg
-
Get middle line from the output of a command
14 décembre 2022, par Kishore TThe following command list the duration of I-frames present in a video file.


ffprobe -i ./test.mp4 -v quiet -skip_frame nokey -select_streams v:0 -of flat -show_entries frame=pkt_pts_time | awk -F'=' '{gsub(/"/, "", $NF); print $NF}'



I'm trying to get the duration of I-frame that is in middle. The output of the above command will be like


0.066667
2.066667
4.066667
9.066667
14.066667
19.066667
24.066667



How do I get the middle value ? Here, I would like to get
9.066667
as the result. If the number of lines is even (say I've 2 values), I need to get the 1st value.

I tried using
wc
to get the number of lines andsed
to print the middle line. But, this straightforward solution required me to run the command twice. I tried piping the command, but I didn't find any solution for storing the value in a variable (from thewc
command) and using the same in another command (sed
command) while retaining the piped output.