Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#3140 closed defect (duplicate)

ffmpeg fails to convert some files with pts (xx) < dts (yy) in stream z

Reported by: julian Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: av_interleaved_write_frame h264
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

download https://dl.dropboxusercontent.com/u/7221986/test.mkv

(i have several other files exhibiting the same issue)
try to convert with ffmpeg from mkv to mp4:

$ ffmpeg -i test.mkv -acodec copy -vcodec copy test.mp4
ffmpeg version 2.1-tessus Copyright (c) 2000-2013 the FFmpeg developers
  built on Oct 28 2013 04:17:07 with llvm-gcc 4.2.1 (LLVM build 2336.1.00)
  configuration: --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --enable-runtime-cpudetect
  libavutil      52. 48.100 / 52. 48.100
  libavcodec     55. 39.100 / 55. 39.100
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from 'test.mkv':
  Metadata:
    ENCODER         : Lavf54.29.104
  Duration: 00:00:10.24, start: 0.000000, bitrate: 4107 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x700, SAR 1:1 DAR 64:35, 25 fps, 25 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      title           : x264_L4.1 @ 2555 Kbps
      LANGUAGE        : eng
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
    Metadata:
      title           : English Dolby Digital 5.1 @ 640 Kbps
      LANGUAGE        : eng
[mp4 @ 0x103823e00] track 1: codec frame size is not set
Output #0, mp4, to 'test.mp4':
  Metadata:
    encoder         : Lavf55.19.104
    Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x700 [SAR 1:1 DAR 64:35], q=2-31, 25 fps, 16k tbn, 1k tbc (default)
    Metadata:
      title           : x264_L4.1 @ 2555 Kbps
      LANGUAGE        : eng
    Stream #0:1(eng): Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, 5.1(side), 640 kb/s (default)
    Metadata:
      title           : English Dolby Digital 5.1 @ 640 Kbps
      LANGUAGE        : eng
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x103823e00] pts (3200) < dts (47232) in stream 0
av_interleaved_write_frame(): Invalid argument

Change History (7)

comment:1 Changed 6 years ago by cehoyos

  • Component changed from undetermined to avcodec
  • Keywords av_interleaved_write_frame h264 added
  • Reproduced by developer set
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version changed from 2.1 to git-master

This is a duplicate of several other tickets, the problem is (presumably) always that h264 timestamps are not correctly determined, see for example #1150 and #2220 (your problem is also reproducible with -fflags +genpts -bsf h264_mp4toannexb -f mpegts).

For future tickets: Please always test current git head before reporting a problem.

Last edited 6 years ago by cehoyos (previous) (diff)

comment:2 follow-up: Changed 6 years ago by julian

thanks for the information and sorry for the duplicate.

i'm unable to compile git-head (*) but it doesn't seem to be fixed as of

ffmpeg-58433-g7668a03.7z 2013-11-17 05:59 5.7M

still the same problem.

(*)

on a mac:
iMac27:ffmpeg julian$ make
LD	ffmpeg_g
Undefined symbols for architecture x86_64:
  "_avpriv_do_elbg", referenced from:
      _filter_frame in libavfilter.a(vf_elbg.o)
  "_avpriv_init_elbg", referenced from:
      _filter_frame in libavfilter.a(vf_elbg.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ffmpeg_g] Error 1


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

Replying to julian:

i'm unable to compile git-head

If you can reproduce this with make distclean && git pull && ./configure && make ffmpeg it would be very important, please report it!

comment:4 follow-up: Changed 6 years ago by julian

no it only happens if i configure with

./configure --disable-encoders --disable-muxers --enable-muxer=ac3 --enable-muxer=mp4 --enable-encoder=ac3 --enable-encoder=ac3_fixed --enable-encoder=movtext --enable-encoder=pcm_s16le --enable-muxer=wav --enable-muxer=pcm_s16le --enable-muxer=mp3

comment:5 Changed 6 years ago by julian

but as i said, the problem still exists in git-head

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

Replying to julian:

no it only happens if i configure with

./configure --disable-encoders --disable-muxers --enable-muxer=ac3 --enable-muxer=mp4 --enable-encoder=ac3 --enable-encoder=ac3_fixed --enable-encoder=movtext --enable-encoder=pcm_s16le --enable-muxer=wav --enable-muxer=pcm_s16le --enable-muxer=mp3

Should be fixed, thank you for the report!

comment:7 Changed 4 years ago by julian

i had to change the uploaded location of the file to reproduce the issue

http://www.filehosting.org/file/details/501407/ffmpeg_3140_pts.mkv

Note: See TracTickets for help on using tickets.