Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Meißner
Scripts
Commits
6fd1e2f2
Commit
6fd1e2f2
authored
May 25, 2024
by
Florian Meißner
Browse files
Options
Downloads
Patches
Plain Diff
fix(video/stats.fish): ignore header while sorting
parent
f0a22d75
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
video/stats.fish
+5
-5
5 additions, 5 deletions
video/stats.fish
with
5 additions
and
5 deletions
video/stats.fish
+
5
−
5
View file @
6fd1e2f2
...
...
@@ -13,22 +13,22 @@ end
set extract __t-nil_helper_extract
filter_by_video |
while read f
while read f
echo -ne $f\t
set blah (ffprobe -v error -select_streams v -show_entries stream=width,height,r_frame_rate:format=duration,bit_rate -of default=noprint_wrappers=1 $f 2>/dev/null | string trim)
set duration ($extract duration $blah)
set width ($extract width $blah)
set height ($extract height $blah)
set fps ($extract r_frame_rate $blah)
set fps
(math
($extract r_frame_rate $blah)
) # we often get FPS as ratio in FFprobe. That converts it to a classical number
set bit_rate ($extract bit_rate $blah)
# if all values are there, calc bits per pixel
for x in
blah
width height fps bit_rate
for x in width height fps bit_rate
$is_numeric $$x || set bits_per_pixel "N/A"
end
set -q bits_per_pixel
&&
[ "$bits_per_pixel" != "N/A" ] && set bit
_rate
(math $bit_rate / \( $width \* $height \* $fps \) )
set -q bits_per_pixel
||
[ "$bits_per_pixel" != "N/A" ] && set bit
s_per_pixel
(math $bit_rate / \( $width \* $height \* $fps \) )
# formatting at the end, so values can be used for calculations until then
...
...
@@ -41,4 +41,4 @@ filter_by_video | while read f
end | pv -l | column --separator=\t --output-separator=\t --table \
--table-columns 'FILE,DURATION,BIT RATE,RESOLUTION,FPS,BITS PER PIXEL' \
--table-right 'DURATION,BIT RATE,RESOLUTION,FPS,BITS PER PIXEL' \
| sort -nt\t -k$_flag_sort_by
|
begin; sed -u 1q;
sort -nt\t -k$_flag_sort_by
; end # sed trick ignores header for sorting
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment