[FFmpeg-devel] [PATCH v2] lavf/movenc: suggest video_track_timescale for invalid timescale
Michael Niedermayer
michael at niedermayer.cc
Wed Oct 12 02:27:04 EEST 2016
On Tue, Oct 11, 2016 at 08:06:39PM +0100, Josh de Kock wrote:
> Fixes ticket #5882. While it doesn't automatically set the timescale
> for the user as that would destroy data without prompt, it will tell
> the user how they could set the timescale (as this is mostly likely
> what they want).
>
> Signed-off-by: Josh de Kock <josh at itanimul.li>
> ---
>
> >Would it be useful to print the max duration?
> I'm not entirely sure, open to suggestions though.
>
> libavformat/movenc.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index d7c7158..6bada25 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -5677,11 +5677,16 @@ static int mov_write_header(AVFormatContext *s)
> ret = AVERROR(EINVAL);
> goto error;
> }
> - if (track->mode == MODE_MOV && track->timescale > 100000)
> + if (track->mode == MODE_MOV && track->timescale > 100000) {
> + /* NOTE: forcing setting the suggested timescale manually means ffmpeg won't destroy
> + * timestamps without explicit instruction. */
> + unsigned int suggested = (unsigned int)av_rescale(st->time_base.den, 1000, st->time_base.num);
> av_log(s, AV_LOG_WARNING,
> "WARNING codec timebase is very high. If duration is too long,\n"
> "file may not be playable by quicktime. Specify a shorter timebase\n"
> - "or choose different container.\n");
> + "or choose different container. Using -video_track_timescale %d\n"
> + "may fix this issue.\n", suggested);
maybe a -max_timescale parameter would be usefull
users could with that limit teh value without having to do something
per file
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161012/d4c3ad39/attachment.sig>
More information about the ffmpeg-devel
mailing list