Opened 4 years ago

Closed 4 years ago

#4758 closed defect (fixed)

Decoding flac in avi shows incorrect timestamps

Reported by: edoceo Owned by:
Priority: important Component: avformat
Version: git-master Keywords: avi flac regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I had an original WebM file, which reported

Duration: 00:07:54.65, start: 0.000000, bitrate: 751 kb/s

Then I transcoded to HuffYUV
ffmpeg -fflags +genpts -i '1f534644-7da1-4f5f-a6bf-fc7ceb4f6072.webm' -c:v huffyuv -b:v 1M -r 24 -pix_fmt yuv422p -c:a flac -ac 2 -f avi -y '1f534644-7da1-4f5f-a6bf-fc7ceb4f6072-P0.huffyuv'

Duration: 00:07:54.91, start: 0.000000, bitrate: 7708 kb/s

Then I transcode back to WebM with below command but the duration is very wrong

Duration: 212:18:27.54, start: 0.000000, bitrate: 0 kb/s

While encoding I can see the timestamp start jumping by large intervals towards the end of the video.

I've uploaded 'ffmpeg-20150805-155732.log' and '1f534644-7da1-4f5f-a6bf-fc7ceb4f6072-P0.huffyuv' to the FTP location.

ffmpeg -fflags +genpts -i '/tmp/1f534644-7da1-4f5f-a6bf-fc7ceb4f6072-P0.huffyuv'  -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis -ac 2 -threads 4 -f webm -y '/tmp/1f534644-7da1-4f5f-a6bf-fc7ceb4f6072-P1.webm'


ffmpeg version N-48686-gb27d4fd-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.3 (Debian 4.9.3-3)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --cc=gcc-4.9
  libavutil      54. 29.100 / 54. 29.100
  libavcodec     56. 56.101 / 56. 56.101
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 30.100 /  5. 30.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[avi @ 0x38b74a0] non-interleaved AVI
Input #0, avi, from '/tmp/1f534644-7da1-4f5f-a6bf-fc7ceb4f6072-P0.huffyuv':
  Metadata:
    encoder         : Lavf56.40.101
  Duration: 00:07:54.91, start: 0.000000, bitrate: 7708 kb/s
    Stream #0:0: Video: huffyuv (HFYU / 0x55594648), yuv422p, 640x480, 7169 kb/s, SAR 1:1 DAR 4:3, 24 fps, 24 tbr, 24 tbn, 24 tbc
    Stream #0:1: Audio: flac ([172][241][0][0] / 0xF1AC), 48000 Hz, stereo, s32 (24 bit), 128 kb/s
[libvpx @ 0x38b9860] v1.4.0-943-gc1b233d
Output #0, webm, to '/tmp/1f534644-7da1-4f5f-a6bf-fc7ceb4f6072-P1.webm':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: vp8 (libvpx), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 1000 kb/s, 24 fps, 1k tbn, 24 tbc
    Metadata:
      encoder         : Lavc56.56.101 libvpx
    Stream #0:1: Audio: vorbis (libvorbis), 48000 Hz, stereo, fltp (24 bit)
    Metadata:
      encoder         : Lavc56.56.101 libvorbis
Stream mapping:
  Stream #0:0 -> #0:0 (huffyuv (native) -> vp8 (libvpx))
  Stream #0:1 -> #0:1 (flac (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
[webm @ 0x38be580] Starting new cluster due to timestamp41 bitrate= 279.3kbits/s    
    Last message repeated 1 times
[libvorbis @ 0x38bb180] Queue input is backward in time6.92 bitrate=   0.2kbits/s    
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047695; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047716; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047737; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047759; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047780; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047801; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047823; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047844; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047865; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047887; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047908; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047929; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047951; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047972; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764047993; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048015; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048036; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048057; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048079; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048100; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048121; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048143; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048164; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048185; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048207; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048228; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048249; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048271; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048292; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048313; changing to 764306681. This may result in incorrect timestamps in the output file.
[webm @ 0x38be580] Non-monotonous DTS in output stream 0:1; previous: 764306681, current: 764048335; changing to 764306681. This may result in incorrect timestamps in the output file.
frame= 1873 fps= 40 q=0.0 Lsize=   21063kB time=212:18:27.51 bitrate=   0.2kbits/s    
video:16625kB audio:4084kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 1.710563%

Change History (5)

comment:1 Changed 4 years ago by cehoyos

Why do you think that you get a valid file if you put flac in avi?

comment:2 follow-up: Changed 4 years ago by edoceo

When I put flac into this avi container ffmpeg proceeds with out any warning or other errors.

For other files it "just works" to use this huffyuv/flac/avi container and convert into WebM or MP4 or other formats.

comment:3 in reply to: ↑ 2 Changed 4 years ago by cehoyos

Replying to edoceo:

When I put flac into this avi container ffmpeg proceeds with out any warning or other errors.

I am not saying this is ok but I suspect there are cases where the application cannot know that the user requested writing an invalid file.

For other files it "just works" to use this huffyuv/flac/avi container

Could you provide a working example? I failed to produce one...
(But note that if you can provide a working example, the warning discussed above probably makes no sense.)

comment:4 Changed 4 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords avi flac regression added; duration webm removed
  • Priority changed from normal to important
  • Summary changed from Transcoding from huffyuv to webm creates incorrect timestamps to Decoding flac in avi shows incorrect timestamps

Looks like a regression since d01144b9d3f592f1140b9f8418e76a126b3a17b0

comment:5 Changed 4 years ago by michael

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.