summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-10-11 12:07:08 +0200
committerAnton Khirnov <anton@khirnov.net>2015-11-08 11:49:05 +0100
commit3efd71b4d0b4a73ccbbbdc092e6bbd54d92633f4 (patch)
tree1019eaafaa469d8bc593883f3a17a48d3c70f9ea /avconv.c
parenta0c71a575109f123978e345fa7eb4ac03cd4d3c3 (diff)
avconv: set packet duration for CFR video streams
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/avconv.c b/avconv.c
index 493f9d2507..7334851530 100644
--- a/avconv.c
+++ b/avconv.c
@@ -279,6 +279,11 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
uint8_t *sd = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_FACTOR,
NULL);
ost->quality = sd ? *(int *)sd : -1;
+
+ if (ost->frame_rate.num) {
+ pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate),
+ ost->st->time_base);
+ }
}
while (bsfc) {