Re: [FFmpeg-devel] [PATCH 1/2] lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters

2016-06-08 Thread Jon Toohill
Michael et al., is this good to merge as-is? I just tested and a round trip with ffmpeg from wav -> mp3 -> wav retains the correct number of samples. Jon Toohill | Google Play Music | jtooh...@google.com | (650) 215-0770 On Wed, Jun 1, 2016 at 5:58 PM, Jon Toohill <jtooh...@google.c

[FFmpeg-devel] [PATCH 2/2] lavc: show gapless info in stream summary

2016-05-24 Thread Jon Toohill
From: Jon Toohill <jon.tooh...@gmail.com> Also adds trailing_padding to AVCodecContext to match AVCodecParameters so that it doesn't get lost when mapping between them. --- libavcodec/avcodec.h | 11 +++ libavcodec/utils.c | 38 ++ 2 files c

Re: [FFmpeg-devel] [PATCH 1/2] lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters

2016-06-01 Thread Jon Toohill
Toohill | Google Play Music | jtooh...@google.com | (650) 215-0770 On Thu, May 26, 2016 at 7:51 PM, Michael Niedermayer <mich...@niedermayer.cc > wrote: > On Wed, May 25, 2016 at 09:56:59AM -0700, Jon Toohill wrote: > > --- > > libavformat/mp3dec.c | 2 ++ > > 1

[FFmpeg-devel] [PATCH 0/3] Pass Xing gapless metadata to users during mp3 parsing

2016-06-16 Thread Jon Toohill
properly when encoding with libmp3lame, causing an encode/decode round trip to add trailing silence. This is not a regression from current behavior, and will be addressed in a separate patch set. Jon Toohill (3): lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters lavc: show gapless info

[FFmpeg-devel] [PATCH 3/3] ffmpeg: copy trailing_padding when using -acodec copy

2016-06-16 Thread Jon Toohill
--- ffmpeg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ffmpeg.c b/ffmpeg.c index 652774f..442f818 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3001,6 +3001,7 @@ static int transcode_init(void) enc_ctx->audio_service_type = dec_ctx->audio_service_type;

[FFmpeg-devel] [PATCH 1/3] lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters

2016-06-16 Thread Jon Toohill
Also removes decoder delay compensation from libmp3lame and mp3enc. initial_padding specifies only encoder delay, decoder delay is handled by start_skip_samples. --- libavcodec/libmp3lame.c | 2 +- libavformat/mp3dec.c| 2 ++ libavformat/mp3enc.c| 9 ++--- 3 files changed, 9

[FFmpeg-devel] [PATCH 2/3] lavc: show gapless info in stream summary

2016-06-16 Thread Jon Toohill
Also adds trailing_padding to AVCodecContext to match AVCodecParameters so that it doesn't get lost when mapping between them. --- doc/APIchanges | 4 libavcodec/avcodec.h | 11 +++ libavcodec/utils.c | 40 +++- libavcodec/version.h | 2

[FFmpeg-devel] [PATCH 0/2] Pass Xing gapless metadata to users during mp3 parsing

2016-05-24 Thread Jon Toohill
These patches expose the encoder delay/padding parsed from an mp3's Xing header to users of lavc/lavf, and show gapless info in the stream summary string. Jon Toohill (2): lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters lavc: show gapless info in stream summary libavcodec

[FFmpeg-devel] [PATCH 1/2] lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters

2016-05-24 Thread Jon Toohill
From: Jon Toohill <jon.tooh...@gmail.com> --- libavformat/mp3dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 3725d67..192f5ef 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -234,6 +234,8 @@ stati

Re: [FFmpeg-devel] [PATCH 0/2] Pass Xing gapless metadata to users during mp3 parsing

2016-05-24 Thread Jon Toohill
Forgot to fix the author line in those patches, it should read "Jon Toohill <jtooh...@google.com>" instead. I can fix it when sending updated patches if there are revisions to make, otherwise can you change it before merging (or should I send updated patches)? Jon Toohill | G

[FFmpeg-devel] [PATCH 2/2] lavc: show gapless info in stream summary

2016-05-25 Thread Jon Toohill
Also adds trailing_padding to AVCodecContext to match AVCodecParameters so that it doesn't get lost when mapping between them. --- doc/APIchanges | 4 libavcodec/avcodec.h | 11 +++ libavcodec/utils.c | 38 ++ libavcodec/version.h | 2 +-

[FFmpeg-devel] [PATCH 0/2] Pass Xing gapless metadata to users during mp3 parsing

2016-05-25 Thread Jon Toohill
These patches expose the encoder delay/padding parsed from an mp3's Xing header to users of lavc/lavf, and show gapless info in the stream summary string. Jon Toohill (2): lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters lavc: show gapless info in stream summary doc/APIchanges

[FFmpeg-devel] [PATCH 1/2] lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters

2016-05-25 Thread Jon Toohill
--- libavformat/mp3dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 3725d67..192f5ef 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -234,6 +234,8 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st,

Re: [FFmpeg-devel] [PATCH 1/3] lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters

2016-07-12 Thread Jon Toohill
documentation and another minor version bump. Jon Toohill | Google Play Music | jtooh...@google.com | (650) 215-0770 On Fri, Jun 17, 2016 at 5:32 PM, Michael Niedermayer <mich...@niedermayer.cc > wrote: > On Thu, Jun 16, 2016 at 11:16:05AM -0700, Jon Toohill wrote: > > Also

[FFmpeg-devel] [PATCH 0/5] Pass Xing gapless metadata to users during mp3 parsing

2016-07-12 Thread Jon Toohill
properly when encoding with libmp3lame, causing an encode/decode round trip to add trailing silence. This is not a regression from current behavior, and will be addressed in a separate patch set. Jon Toohill (5): lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters libmp3lame + mp3enc

[FFmpeg-devel] [PATCH 4/5] ffmpeg: copy trailing_padding when using -acodec copy

2016-07-12 Thread Jon Toohill
--- ffmpeg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ffmpeg.c b/ffmpeg.c index 652774f..442f818 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3001,6 +3001,7 @@ static int transcode_init(void) enc_ctx->audio_service_type = dec_ctx->audio_service_type;

[FFmpeg-devel] [PATCH 2/5] libmp3lame + mp3enc: removes decoder delay compensation

2016-07-12 Thread Jon Toohill
initial_padding specifies only encoder delay, decoder delay is handled by start_skip_samples. --- doc/APIchanges | 4 libavcodec/libmp3lame.c | 2 +- libavcodec/version.h| 2 +- libavformat/mp3enc.c| 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git

[FFmpeg-devel] [PATCH 5/5] lavf/mp3enc: write trailing_padding in Xing header

2016-07-12 Thread Jon Toohill
--- libavformat/mp3enc.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index 3b77d29..da70d13 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -248,11 +248,14 @@ static int mp3_write_xing(AVFormatContext *s)

[FFmpeg-devel] [PATCH 3/5] lavc: show gapless info in stream summary

2016-07-12 Thread Jon Toohill
Also adds trailing_padding to AVCodecContext to match AVCodecParameters so that it doesn't get lost when mapping between them. --- doc/APIchanges | 4 libavcodec/avcodec.h | 11 +++ libavcodec/utils.c | 40 +++- libavcodec/version.h | 2

[FFmpeg-devel] [PATCH 1/5] lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters

2016-07-12 Thread Jon Toohill
--- libavformat/mp3dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 56c7f8c..345fa88 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -239,6 +239,8 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st,

[FFmpeg-devel] [PATCH 0/2] Minor fixes for encoder padding

2016-08-15 Thread Jon Toohill
patch set. Jon Toohill (2): lavc: add trailing_padding to AVCodecContext to match AVCodecParameters. ffmpeg: copy trailing_padding when using -acodec copy doc/APIchanges | 4 ffmpeg.c | 1 + libavcodec/avcodec.h | 11 +++ libavcodec/utils.c | 40

[FFmpeg-devel] [PATCH 1/2] lavc: add trailing_padding to AVCodecContext to match AVCodecParameters.

2016-08-15 Thread Jon Toohill
Shows encoder delay/padding in the stream summary if they are set. --- doc/APIchanges | 4 libavcodec/avcodec.h | 11 +++ libavcodec/utils.c | 40 +++- libavcodec/version.h | 2 +- 4 files changed, 39 insertions(+), 18 deletions(-) diff

[FFmpeg-devel] [PATCH 2/2] ffmpeg: copy trailing_padding when using -acodec copy

2016-08-15 Thread Jon Toohill
--- ffmpeg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ffmpeg.c b/ffmpeg.c index bae515d..49a1b03 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3001,6 +3001,7 @@ static int transcode_init(void) enc_ctx->audio_service_type = dec_ctx->audio_service_type;

[FFmpeg-devel] [PATCH 1/4] ffmpeg: re-copy codec contexts after encoding

2016-09-26 Thread Jon Toohill
This preserves changes to fields of AVCodecContext that get updated during encoding, such as trailing_padding (which may not be known until encoding is complete). --- ffmpeg.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/ffmpeg.c b/ffmpeg.c index df55a49..1e973f5 100644

[FFmpeg-devel] [PATCH 2/4] lavc/libmp3lame: set trailing_padding after flushing encoder

2016-09-26 Thread Jon Toohill
--- libavcodec/libmp3lame.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 5642264..1566921 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -218,6 +218,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx,

[FFmpeg-devel] [PATCH 0/4] Handle trailing_padding in MP3 Info tag

2016-09-26 Thread Jon Toohill
Trimming trailing_padding samples from the end of the track is not yet implemented. Jon Toohill (4): ffmpeg: re-copy codec contexts after encoding lavc/libmp3lame: set trailing_padding after flushing encoder lavf/mp3enc: write encoder delay/padding upon closing lavf/mp3dec: read encoder

[FFmpeg-devel] [PATCH 4/4] lavf/mp3dec: read encoder delay/padding from Info tag

2016-09-26 Thread Jon Toohill
--- libavformat/mp3dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 56c7f8c..9cc85a3 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -239,6 +239,8 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st,

[FFmpeg-devel] [PATCH 3/4] lavf/mp3enc: write encoder delay/padding upon closing

2016-09-26 Thread Jon Toohill
trailing_padding is not known before encoding. --- libavformat/mp3enc.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index de63401..433b070 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@

[FFmpeg-devel] [PATCH 3/4] lavf/mp3enc: write encoder delay/padding upon closing

2016-09-28 Thread Jon Toohill
trailing_padding is not known before encoding. --- libavformat/mp3enc.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index de63401..37608f1 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@

[FFmpeg-devel] [PATCH 0/4] Handle trailing_padding in MP3 Info tag

2016-09-28 Thread Jon Toohill
Trimming trailing_padding samples from the end of the track is not yet implemented. Jon Toohill (4): ffmpeg: re-copy codec parameters after encoding lavc/libmp3lame: set trailing_padding after flushing encoder lavf/mp3enc: write encoder delay/padding upon closing lavf/mp3dec: read encoder

[FFmpeg-devel] [PATCH 1/4] ffmpeg: re-copy codec parameters after encoding

2016-09-28 Thread Jon Toohill
This preserves changes to fields of AVCodecParameters that get updated during encoding, such as trailing_padding (which may not be known until encoding is complete). --- ffmpeg.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/ffmpeg.c b/ffmpeg.c index d0f247e..0cdc762 100644

[FFmpeg-devel] [PATCH 2/4] lavc/libmp3lame: set trailing_padding after flushing encoder

2016-09-28 Thread Jon Toohill
--- libavcodec/libmp3lame.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 5642264..1566921 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -218,6 +218,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx,

[FFmpeg-devel] [PATCH 1/4] ffmpeg: re-copy codec contexts after encoding

2016-09-28 Thread Jon Toohill
This preserves changes to fields of AVCodecContext that get updated during encoding, such as trailing_padding (which may not be known until encoding is complete). --- ffmpeg.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/ffmpeg.c b/ffmpeg.c index df55a49..1e973f5 100644

Re: [FFmpeg-devel] [PATCH 0/4] Handle trailing_padding in MP3 Info tag

2016-09-28 Thread Jon Toohill
Oops, forgot to send this in reply to the previous thread. Should I re-send? http://ffmpeg.org/pipermail/ffmpeg-devel/2016-September/200092.html On Wed, Sep 28, 2016 at 11:28 AM, Jon Toohill <jtooh...@google.com> wrote: > Trimming trailing_padding samples from the end of the track i

[FFmpeg-devel] [PATCH 4/4] lavf/mp3dec: read encoder delay/padding from Info tag

2016-09-28 Thread Jon Toohill
--- libavformat/mp3dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 56c7f8c..9cc85a3 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -239,6 +239,8 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st,

Re: [FFmpeg-devel] [PATCH 2/4] lavc/libmp3lame: set trailing_padding after flushing encoder

2016-09-28 Thread Jon Toohill
On Tue, Sep 27, 2016 at 1:04 AM, Carl Eugen Hoyos <ceffm...@gmail.com> wrote: > 2016-09-26 19:13 GMT+02:00 Jon Toohill <jtoohill-at-google@ffmpeg.org > >: > > > +avctx->trailing_padding = FFMAX(lame_get_encoder_padding(s->gfp) > - 528 - 1, 0); &g

Re: [FFmpeg-devel] [PATCH 3/3] lavf/mp3dec: read encoder delay/padding from Info tag

2016-10-05 Thread Jon Toohill
On Tue, Oct 4, 2016 at 7:19 AM, wm4 <nfx...@googlemail.com> wrote: > On Mon, 3 Oct 2016 17:45:08 -0700 > Jon Toohill <jtoohill-at-google@ffmpeg.org> wrote: > > > Muxers can check AVCodecParameters.initial_padding for the > > encoder+decoder delay, and

Re: [FFmpeg-devel] [PATCH 3/3] lavf/mp3dec: read encoder delay/padding from Info tag

2016-10-05 Thread Jon Toohill
On Tue, Oct 4, 2016 at 9:10 AM, Michael Niedermayer <mich...@niedermayer.cc> wrote: > On Mon, Oct 03, 2016 at 05:45:08PM -0700, Jon Toohill wrote: > > Muxers can check AVCodecParameters.initial_padding for the > > encoder+decoder delay, and read the AV_PKT_DATA_SKIP_SAMPL

[FFmpeg-devel] [PATCH 0/2] Fix gapless encoding/remuxing for MP3

2016-10-05 Thread Jon Toohill
Round trip wav->mp3->wav now preserves the correct number of samples. Remuxing mp3->mp3 with -c:a copy also preserves any existing gapless metadata in the Info tag. The code in libmp3lame.c to set AV_PKT_DATA_SKIP_SAMPLES was mostly copied from libopusenc.c. Jon Toohill (2): lavc/l

[FFmpeg-devel] [PATCH 2/2] lavf/mp3enc: write encoder delay/padding upon closing

2016-10-05 Thread Jon Toohill
--- libavformat/mp3enc.c | 34 +++--- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index de63401..ddf4b93 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -111,6 +111,8 @@ typedef struct

Re: [FFmpeg-devel] [PATCH 3/3] lavf/mp3dec: read encoder delay/padding from Info tag

2016-10-05 Thread Jon Toohill
On Wed, Oct 5, 2016 at 11:03 AM, wm4 <nfx...@googlemail.com> wrote: > On Wed, 5 Oct 2016 10:42:13 -0700 > Jon Toohill <jtoohill-at-google@ffmpeg.org> wrote: > > > On Wed, Oct 5, 2016 at 10:40 AM, Jon Toohill <jtooh...@google.com> > wrote: > > >

[FFmpeg-devel] [PATCH 1/2] lavc/libmp3lame: send encoder delay/padding in packet side data

2016-10-05 Thread Jon Toohill
--- libavcodec/libmp3lame.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 5642264..b3ba0d8 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -50,6 +50,7 @@ typedef struct

Re: [FFmpeg-devel] [PATCH 1/4] ffmpeg: re-copy codec contexts after encoding

2016-09-28 Thread Jon Toohill
This was sent in error, please disregard. Jon Toohill | Google Play Music | jtooh...@google.com | (650) 215-0770 On Wed, Sep 28, 2016 at 11:28 AM, Jon Toohill <jtooh...@google.com> wrote: > This preserves changes to fields of AVCodecContext that get > updated dur

[FFmpeg-devel] [PATCH 1/3] lavc/libmp3lame: send encoder padding in side data of final packet

2016-10-03 Thread Jon Toohill
--- libavcodec/libmp3lame.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 5642264..a1bf122 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -185,7 +185,7 @@ static int

[FFmpeg-devel] [PATCH 2/3] lavf/mp3enc: write encoder delay/padding upon closing

2016-10-03 Thread Jon Toohill
--- libavformat/mp3enc.c | 32 +--- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index de63401..48cb0b4 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -111,6 +111,7 @@ typedef struct

[FFmpeg-devel] [PATCH 0/3] Fix gapless encoding/decoding for MP3

2016-10-03 Thread Jon Toohill
Round trip wav->mp3->wav now preserves the correct number of samples. Remuxing mp3->mp3 with -c:a copy also preserves any existing gapless metadata in the Info tag. The code in libmp3lame.c to set AV_PKT_DATA_SKIP_SAMPLES was mostly copied from libopusenc.c. Jon Toohill (3): lavc/l

[FFmpeg-devel] [PATCH 3/3] lavf/mp3dec: read encoder delay/padding from Info tag

2016-10-03 Thread Jon Toohill
Muxers can check AVCodecParameters.initial_padding for the encoder+decoder delay, and read the AV_PKT_DATA_SKIP_SAMPLES side data from the last packet for the encoder padding. This change also fixes the first_discard_sample calculation which erroneously included the decoder delay. Decoder delay

Re: [FFmpeg-devel] [PATCH 4/4] lavf/mp3dec: read encoder delay/padding from Info tag

2016-09-26 Thread Jon Toohill
case where knowing trailing_padding at the start of a stream is necessary, then that's not possible, but I'm pretty new to this and don't know of one. Thoughts? Jon Toohill | Google Play Music | jtooh...@google.com | (650) 215-0770 On Mon, Sep 26, 2016 at 11:30 AM, wm4 <nfx...@googlemail.

[FFmpeg-devel] [PATCH 1/2] lavc/libmp3lame: send encoder delay/padding in packet side data

2016-10-17 Thread Jon Toohill
--- libavcodec/libmp3lame.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 5642264..e55aa85 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -50,6 +50,7 @@ typedef struct

[FFmpeg-devel] [PATCH 2/2] lavf/mp3enc: write encoder delay/padding upon closing

2016-10-17 Thread Jon Toohill
--- libavformat/mp3enc.c | 34 -- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index de63401..4c97fa1 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -111,6 +111,8 @@ typedef struct

[FFmpeg-devel] [PATCH 0/2] Fix gapless encoding/remuxing for MP3

2016-10-17 Thread Jon Toohill
Round trip wav->mp3->wav now preserves the correct number of samples. Remuxing mp3->mp3 with -c:a copy also preserves any existing gapless metadata in the Info tag. The code in libmp3lame.c to set AV_PKT_DATA_SKIP_SAMPLES was mostly copied from libopusenc.c. Jon Toohill (2): lavc/l