[FFmpeg-devel] [PATCH 2/2] ffprobe: print codec timecode if available.

Clément Bœsch ubitux at gmail.com
Fri Nov 25 11:38:31 CET 2011


On Fri, Nov 25, 2011 at 11:21:55AM +0100, Stefano Sabatini wrote:
[...]
> > From b8df0e43e7cda142cab2483ebd433c4dd9c88ebb Mon Sep 17 00:00:00 2001
> > From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <clement.boesch at smartjog.com>
> > Date: Wed, 16 Nov 2011 17:42:48 +0100
> > Subject: [PATCH 2/2] ffprobe: print codec timecode if available.
> > 
> > ---
> >  ffprobe.c |    8 ++++++++
> >  1 files changed, 8 insertions(+), 0 deletions(-)
> > 
> > diff --git a/ffprobe.c b/ffprobe.c
> > index 52f07e7..f529fd1 100644
> > --- a/ffprobe.c
> > +++ b/ffprobe.c
> > @@ -951,6 +951,7 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
> >      print_int("index", stream->index);
> >  
> >      if ((dec_ctx = stream->codec)) {
> > +        uint32_t tc;
> >          if ((dec = dec_ctx->codec)) {
> >              print_str("codec_name",      dec->name);
> >              print_str("codec_long_name", dec->long_name);
> > @@ -993,6 +994,13 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
> >              if (s) print_str    ("pix_fmt", s);
> >              else   print_str_opt("pix_fmt", "unknown");
> >              print_int("level",   dec_ctx->level);
> > +            tc = (uint32_t)dec_ctx->timecode_frame_start;
> > +            print_fmt("timecode", "%02d:%02d:%02d%c%02d",
> > +                      tc>>19 & 0x1f,              // hours
> > +                      tc>>13 & 0x3f,              // minutes
> > +                      tc>>6  & 0x3f,              // seconds
> > +                      tc     & 1<<24 ? ';' : ':', // drop
> > +                      tc     & 0x3f);             // frames
> >              break;
> 
> So it will *always* show 00:00:00:00 in case it is not set.
> 
> I'm fine with it if you think it makes sense.

Well it should make sense for codecs where it is supported. But maybe the
default timecode_frame_start should be set to -1... I'll resend a patch :)

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111125/6bb51bb0/attachment.asc>


More information about the ffmpeg-devel mailing list