Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
transcoding: fix encoder time_base again
  • Loading branch information
stbenz authored and perexg committed Mar 9, 2015
1 parent e797e46 commit a69ee15
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/plumbing/transcoding.c
Expand Up @@ -1027,10 +1027,17 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
octx->width = vs->vid_width ? vs->vid_width : ictx->width;
octx->height = vs->vid_height ? vs->vid_height : ictx->height;
octx->gop_size = 25;
octx->time_base.den = ictx->time_base.den;
octx->time_base.num = ictx->time_base.num;
octx->has_b_frames = ictx->has_b_frames;

// Encoder uses "time_base" for bitrate calculation, but "time_base" from decoder
// will be deprecated in the future, therefore calculate "time_base" from "framerate" if available.
octx->ticks_per_frame = ictx->ticks_per_frame;
if (ictx->framerate.num != 0 && ictx->framerate.den != 0) {
octx->time_base = av_inv_q(av_mul_q(ictx->framerate, av_make_q(ictx->ticks_per_frame, 1)));
} else {
octx->time_base = ictx->time_base;
}

switch (ts->ts_type) {
case SCT_MPEG2VIDEO:
octx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
Expand Down

4 comments on commit a69ee15

@markcs
Copy link

@markcs markcs commented on a69ee15 Mar 10, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this error while building with this change:

src/plumbing/transcoding.c: In function ‘transcoder_stream_video’:
src/plumbing/transcoding.c:1035:13: error: ‘AVCodecContext’ has no member named ‘framerate’
src/plumbing/transcoding.c:1035:41: error: ‘AVCodecContext’ has no member named ‘framerate’
src/plumbing/transcoding.c:1036:51: error: ‘AVCodecContext’ has no member named ‘framerate’
make: *** [/home/mark/git/tvheadend/build.linux/src/plumbing/transcoding.o] Error 1

@xDereCx
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, build failed
http://pastebin.com/NShaL9W2
ubuntu 14.04 64bit, not using trascoding build

@ProfYaffle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xDereCx
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build passed after patch applied, #605

Please sign in to comment.