Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
117 views2 pages

Ffprobe On Ffmpeg

This document provides instructions for using ffprobe and related tools to analyze video frames and generate a graph of frame sizes over time. It explains how to use ffprobe to extract frame details from a video file, preprocess the data with tools like grep, sed and paste, and then plot the results in a graph using gnuplot. The goal is to make it easier to visualize frame encoding statistics for video optimization.

Uploaded by

Tatiana Solano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views2 pages

Ffprobe On Ffmpeg

This document provides instructions for using ffprobe and related tools to analyze video frames and generate a graph of frame sizes over time. It explains how to use ffprobe to extract frame details from a video file, preprocess the data with tools like grep, sed and paste, and then plot the results in a graph using gnuplot. The goal is to make it easier to visualize frame encoding statistics for video optimization.

Uploaded by

Tatiana Solano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

http://tldp.org/LDP/Bash-Beginners-Guide/html/index.

html //CURSO DE BASH

ffprobe -show_frames archivo.mp4

arroja el siguiente resultado, en general:

codec_type=video
pict_type=I
width=1024
height=576
quality=0
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
repeat_pict=0
reference=3
stream_index=0
size=822.000 byte
pkt_pts=0:00:00.000000
pkt_dts=0:00:00.960000
pkt_duration=0:00:00.040000
file_pkt_nb=1
stream_pkt_nb=1
pkt_flag_key=K
[/FRAME]

./ffprobe -show_frames -pretty two_pass.mp4 | grep 'size\|pict_type\|


coded_picture_number', mostrar� algo asi:

pict_type=I
coded_picture_number=0
size=822.000 byte
pict_type=P
coded_picture_number=1
size=219.000 byte
pict_type=P
coded_picture_number=2
size=515.000 byte
pict_type=P
coded_picture_number=3
size=942.000 byte
pict_type=B
coded_picture_number=5
size=2.292 Kibyte
pict_type=P
coded_picture_number=4
size=3.896 Kibyte
pict_type=B
coded_picture_number=7
size=5.546 Kibyte
...etc.

# SOFTWARE NEEDED (all open source)


FFmpeg (>SVN-r23145), FFprobe FFprobe (>SVN-r92, currently being merged into FFmpeg
as of time of posting) gnuplot (>4.2), grep, sed.
# COMMAND LINE
./ffprobe -show_frames funnyhq.mp4 | grep 'size\|coded_picture_number\|pict_type' >
raw.dat && paste -s -d '\t\t\n' raw.dat > fixed.dat && sed -e
's/coded_picture_number=//g' -e 's/size=//g' -e 's/pict_type=//g' -e
's/I/167116800/g' -e 's/P/65280/g' -e 's/B/255/g' fixed.dat > column.dat && gnuplot
plot.txt

# GNUPLOT "plot.txt"
set title "1pass"
set xlabel "frame number\n\n./ffmpeg -i funny_bubbles.mov -vcodec libx264 -vpre hq
-b 1500k funnyhq.mp4"
set ylabel "Bytes per frame"
set yrange [0:35000]
set ytics (35000, 30000, 25000, 20000, 15000, 10000, 5000)
set xrange [-10:850]
set lmargin 12
set rmargin 2
set grid
set pointsize 2
set label 1 "I frames"
set label 1 at graph .85, .96 tc lt 1
set label 2 "P frames"
set label 2 at graph .85, .92 tc lt 2
set label 3 "B frames"
set label 3 at graph .85, .88 tc lt 3
plot 'column.dat' using 2:3:1 notitle with i lc rgb variable

Now, to work out how to write a sh script to make it easier.

You might also like