Opened 5 years ago

Last modified 4 years ago

#2348 new defect

Slowmotion when reencoding mpeg stream

Reported by: cehoyos Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: dts mpeg2video mpegps
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

http://thread.gmane.org/gmane.comp.video.ffmpeg.user/44508
A user uploaded a mpeg sample file that plays for approximately 11 seconds with current ffplay, mplayer (both -demuxer mpegps and -demuxer lavf, both -vc ffmpeg12 and -vc mpeg12), vlc and WMP.
If the sample gets re-encoded with ffmpeg, the output file plays at half speed (for 22 seconds).

$ ffmpeg -i rob-test.mpg -qscale 2 out.avi
ffmpeg version N-50651-g1123080 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 11 2013 12:49:54 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack --enable-libopenjpeg
  libavutil      52. 19.100 / 52. 19.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 44.101 /  3. 44.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpeg @ 0x1be0f40] max_analyze_duration 5000000 reached at 5005000 microseconds
Input #0, mpeg, from 'rob-test.mpg':
  Duration: 00:00:11.34, start: 0.360000, bitrate: 7140 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [SAR 32:27 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf54.63.104
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 720x480 [SAR 32:27 DAR 16:9], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> mpeg4)
Press [q] to stop, [?] for help
frame=  341 fps=0.0 q=2.0 Lsize=   11255kB time=00:00:22.68 bitrate=4063.5kbits/s
video:11233kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.193383%

Workaround is to specify an input frame rate:
$ ffmpeg -r 30 -i rob-test.mpg -qscale 2 out.avi

Change History (1)

comment:1 Changed 4 years ago by cehoyos

The problem has changed, speed is correct but frames are dropped now:

$ ffmpeg -i rob-test.mpg -qscale 2 out.avi
ffmpeg version N-59187-g09d6cea Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec 18 2013 12:46:12 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --enable-libzvbi
  libavutil      52. 58.101 / 52. 58.101
  libavcodec     55. 45.102 / 55. 45.102
  libavformat    55. 22.100 / 55. 22.100
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.100 /  4.  0.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpeg, from 'rob-test.mpg':
  Duration: 00:00:11.34, start: 0.360000, bitrate: 7140 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x480 [SAR 32:27 DAR 16:9], max. 8500 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf55.22.100
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 720x480 [SAR 32:27 DAR 16:9], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> mpeg4)
Press [q] to stop, [?] for help
frame=  228 fps=0.0 q=2.0 Lsize=    7526kB time=00:00:11.37 bitrate=5418.7kbits/s dup=0 drop=113
video:7512kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.182652%
Note: See TracTickets for help on using tickets.