From patchwork Tue Jul 24 22:18:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Brian C. Wiles" X-Patchwork-Id: 9785 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp118039jad; Tue, 24 Jul 2018 15:24:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfhJfZBQ4TTfdA4xPf/FlIIvRmUOCZtzbQhcPFZk0IRWongLutiPN8l6YgiEl15fTq5axzn X-Received: by 2002:a1c:9c56:: with SMTP id f83-v6mr2815006wme.135.1532471057440; Tue, 24 Jul 2018 15:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532471057; cv=none; d=google.com; s=arc-20160816; b=mqh9TzQnuMK5MUXND8xXDVR93JzMeSa70R+Q5Q3IrpWRnbZ0jMs37eZ9UXt30Ko9PD 23zlLDSwcf03EejuAT6fjP21XiW0pkWGrj5b6+6+ndjEi5yfN9LVCK+3SZXxnDk8KCgv D/gL6lvRJqgFhyxwJwXRuBbWJF2ZcxO4wR0tK0MktG5hfDPbAtPTJbiqXY6+MMG4ZRyo 861Nl9AeozQ0y/NKpcSaiqu9yOH7ZbMPEE5qdnv5pshhNWwNvDZ9t1AVGlY31sRi1xXg E8ry2VsVyB5xPv47+6e4gIOd/blPp/rQQgykti6JZ5DZR2t/jlIvG3BEdZLKKgTeVSIq jGIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:message-id:thread-index :references:mime-version:date:to:from:dkim-signature:dkim-signature :delivered-to:arc-authentication-results; bh=EGJUQRfkimg12iS4VfEFvfQDHazu4HR34NKcGXvMRlg=; b=DyZQsxDMQKka43lyGnNnRKGlrAHwBwGJKpKc9Rvs7/rzhuRnKy8qb+lBSgTXP6Xt7T phFubL5FCEFQ8gfMTlgXEFTM04GiDNLd5pCJe3s29ZVCdODGolz/W3FcVcRnzjsKGiuK 41UYsVSQ7nG5a6McZfWSFBmhjq3phmoYbLy/SyZb1vsr95d65xUZpCEewo/t0/0syLGT +tlBrOQWStCaunxaLx0+Nwm/9PloZOTSTvKgv8l9pRB05kwUVa2/nH7aOeQkQcZ5vN6i cPLyYUzAU3RnTARfGxk9A+LaOtDZ9ak4PQRF/evbgv1EaheRqZUHL2bCm2ok+R1A740p jLPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@streamcomm.com header.s=ouwwwk4d4l6udc3eyoxkq4fuz4f5dvsu header.b="GULs//Gz"; dkim=neutral (body hash did not verify) header.i=@amazonses.com header.s=7v7vs6w47njt4pimodk5mmttbegzsi6n header.b=L55UXJvh; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t63-v6si1943663wmd.124.2018.07.24.15.24.16; Tue, 24 Jul 2018 15:24:17 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@streamcomm.com header.s=ouwwwk4d4l6udc3eyoxkq4fuz4f5dvsu header.b="GULs//Gz"; dkim=neutral (body hash did not verify) header.i=@amazonses.com header.s=7v7vs6w47njt4pimodk5mmttbegzsi6n header.b=L55UXJvh; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F51668829D; Wed, 25 Jul 2018 01:24:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a27-106.smtp-out.us-west-2.amazonses.com (a27-106.smtp-out.us-west-2.amazonses.com [54.240.27.106]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D915C680A49 for ; Wed, 25 Jul 2018 01:23:53 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ouwwwk4d4l6udc3eyoxkq4fuz4f5dvsu; d=streamcomm.com; t=1532470697; h=Subject:From:To:Cc:Date:Mime-Version:Content-Type:Content-Transfer-Encoding:References:Message-Id; bh=NUYBnoB46KT1wvF8VvYQy0GoLlGm6m/JE7XxqU1z+5M=; b=GULs//GzDTsjS5SrE1ZjOZzDPjAqBUKADlA+B7ppO90NHIUI0KkZtOS/x4s8uuNA teS/2IxSosqda0JAjsjybCtrAWw9Wje5HISYRsQPe3v3s0r8ZM3DUgvcAvCRgeL2hEz RmohTDt5emZDXZUhktxikbBjdignCPqh0pX1EDko= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=7v7vs6w47njt4pimodk5mmttbegzsi6n; d=amazonses.com; t=1532470697; h=Subject:From:To:Cc:Date:Mime-Version:Content-Type:Content-Transfer-Encoding:References:Message-Id:Feedback-ID; bh=NUYBnoB46KT1wvF8VvYQy0GoLlGm6m/JE7XxqU1z+5M=; b=L55UXJvhzTgU6HOl9zPm4IMw50b1BeqbaukSmERa1U0vPQYHVGDOgZ1twlnNleqy IViObBgaFfQyFdqa1Uq/se+Hwf4WjloxZMlSw1H5tZhoXIMyfhvfZKmcHeoXHIQl+zA 5ft3imeK1zfSCtmYfb1Zlk2yT5MUXe+lwn3sHGSg= From: =?UTF-8?Q?Brian_C=2E_Wiles?= To: =?UTF-8?Q?ffmpeg-devel=40ffmpeg=2Eorg?= Date: Tue, 24 Jul 2018 22:18:17 +0000 Mime-Version: 1.0 References: <20180724221756.16484-1-brian@streamcomm.com> X-Mailer: Amazon WorkMail Thread-Index: AQHUI5w3yJNDnHm3TuyjtpTWp4SppQ== X-Original-Mailer: git-send-email 2.17.1 Message-ID: <01010164ce5f1cb3-8ad44823-17fa-4b6c-972a-abcd8cb2939e-000000@us-west-2.amazonses.com> X-SES-Outgoing: 2018.07.24-54.240.27.106 Feedback-ID: 1.us-west-2.An468LAV0jCjQDrDLvlZjeAthld7qrhZr+vow8irkvU=:AmazonSES Subject: [FFmpeg-devel] [PATCH] Fixed incorrect timestamps and initialization issues in transcoding.c example. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: =?UTF-8?Q?Brian_C=2E_Wiles?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- doc/examples/transcoding.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/doc/examples/transcoding.c b/doc/examples/transcoding.c index a83fa3a185..bf653f7c50 100644 --- a/doc/examples/transcoding.c +++ b/doc/examples/transcoding.c @@ -2,6 +2,7 @@ * Copyright (c) 2010 Nicolas George * Copyright (c) 2011 Stefano Sabatini * Copyright (c) 2014 Andrey Utkin + * Copyright (c) 2018 Brian C. Wiles. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -517,6 +518,11 @@ int main(int argc, char **argv) return 1; } + av_register_all(); + avcodec_register_all(); + avfilter_register_all(); + avformat_network_init(); + if ((ret = open_input_file(argv[1])) < 0) goto end; if ((ret = open_output_file(argv[2])) < 0) @@ -554,7 +560,9 @@ int main(int argc, char **argv) } if (got_frame) { - frame->pts = frame->best_effort_timestamp; + frame->pts = av_rescale_q(frame->best_effort_timestamp, + stream_ctx[stream_index].dec_ctx->time_base, + stream_ctx[stream_index].enc_ctx->time_base); ret = filter_encode_write_frame(frame, stream_index); av_frame_free(&frame); if (ret < 0)