From 13e999c8c26c67229207c7023e7375904bbe532c Mon Sep 17 00:00:00 2001 From: "H.G. Giorgis" Date: Fri, 4 Sep 2015 17:14:25 -0400 Subject: [PATCH] readme usage update --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4a5438b..71d3555 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,17 @@ func main() { filename := "/home/giorgis/media/sample.mp4" // Register all formats and codecs - avformat.Av_register_all() + avformat.AvRegisterAll() - if avformat.Avformat_open_input(&pFormatCtx, filename, nil, nil) != 0 { + // Open video file + if avformat.AvformatOpenInput(&ctxtFormat, filename, nil, nil) != 0 { + log.Println("Error: Couldn't open file.") + return + } + + // Retrieve stream information + if ctxtFormat.AvformatFindStreamInfo(nil) < 0 { + log.Println("Error: Couldn't find stream information.") return }