Changes between Version 1 and Version 2 of FFprobeTips


Ignore:
Timestamp:
May 30, 2014, 1:49:05 AM (5 years ago)
Author:
llogan
Comment:

change loglevel; expand basic example

Legend:

Unmodified
Added
Removed
Modified
  • FFprobeTips

    v1 v2  
    2020
    2121{{{
    22 $ ffprobe -v 0 -show_format input.mkv
     22$ ffprobe -v error -show_format input.mkv
    2323[FORMAT]
    2424filename=input.mkv
     
    3737}}}
    3838
    39 * `-v 0` sets the loglevel. `0` will omit the build and "generic" file information.
     39If you only want `size=56164272` you can add `grep`:
     40
     41{{{
     42$ ffprobe -v error -show_format input.mkv | grep size
     43size=56164272
     44}}}
     45
     46There are several methods to get only the value such as by using `awk`:
     47
     48{{{
     49$ ffprobe -v error -show_format input.mkv | awk -F= '/size/{print $NF}'
     5056164272
     51}}}
     52
     53Or with `eval` and `echo`:
     54
     55{{{
     56eval $(ffprobe -v error -show_format -show_entries format=size -of flat=s=_ input.mkv); echo $format_size
     5756164272
     58}}}
     59
     60* `-v` sets the loglevel. `error` will omit the build and "generic" file information, but will allow errors to be shown in addition to the desired `ffprobe` output.
    4061* `-print_format` is useful to change the output format. Available formats are: default, compact, csv, flat, ini, json, xml.
    4162
     
    4364
    4465{{{
    45 eval $(ffprobe -v 0 -show_format -of flat=s=_ input.mkv | grep format_duration); echo $format_duration
     66eval $(ffprobe -v error -show_format -of flat=s=_ input.mkv | grep format_duration); echo $format_duration
    4667}}}
    4768
    4869Alternatively you can omit `grep` by using the `-show_entries` option:
     70
    4971{{{
    50 eval $(ffprobe -v 0 -show_format -of flat=s=_ -show_entries format=duration input.mkv); echo $format_duration
     72eval $(ffprobe -v error -show_format -of flat=s=_ -show_entries format=duration input.mkv); echo $format_duration
    5173}}}
    5274
    5375Example output in seconds:
     76
    5477{{{
    5578108.501000
     
    5780
    5881Adding the `-sexagesimal` option will use the `HOURS:MM:SS.MICROSECONDS` time unit format such as:
     82
    5983{{{
    60840:01:48.501000
     
    6690
    6791{{{
    68 eval $(ffprobe -v 0 -of flat=s=_ -select_streams v:0 -show_entries stream=r_frame_rate input.mkv); echo $streams_stream_0_r_frame_rate
     92eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=r_frame_rate input.mkv); echo $streams_stream_0_r_frame_rate
    6993}}}
    7094
    7195Example output for a NTSC-film video:
     96
    7297{{{
    739824000/1001
     
    75100
    76101Example output for a PAL video:
     102
    77103{{{
    7810425/1
     
    85111
    86112{{{
    87 eval $(ffprobe -v 0 -of flat=s=_ -select_streams v:0 -show_entries stream=height,width input.mkv)
     113eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width input.mkv)
    88114size=${streams_stream_0_width}x${streams_stream_0_height}
    89115echo $size