mpeg2 video playback abnormal
I have some dvd iso and vob video, some of them playback OK, some are abnormal. One of dvd iso can't seek. One of vob video can't hardware decode, picture will broken, if no hardware decode, picture is OK. I also tried mplayer2, if demuxer is lavf, It's same as mpv, if demuxer is mpegps, the 2 problem both solved, but, mpv have no mpegps demuxer.
Sounds like a ffmpeg/libavformat problem.
Do you have any samples?
file size is very large, but I can cut it down. Where can I submit to? Do I need to report this issue to ffmpeg or libav?
Upload a small sample somewhere, (such as http://www.datafilehost.com/ or any other 1-click hoster).
I'm not sure what your problem is. Maybe there are multiple bugs. Possible error sources include:
- bug in dvd:// access
- bug in the mpeg demuxer
- bug in the mpv vdpau code
- something else
I uploaded 2 files http://www1.datafilehost.com/d/27de60ea http://www1.datafilehost.com/d/bc88aee7
Thanks.
The vdpau issue is as you said: it doesn't work with -demuxer lavf anywhere, but it does work in mplayer with -demuxer mpegps. I filed a ffmpeg bug report, and your sample file will be very useful: https://ffmpeg.org/trac/ffmpeg/ticket/2915
The .iso sample is unfortunately useless. In general, you can't test seeking on an incomplete file. But the complete one is probably too big for you to upload. So I'll need more information to know what could possibly be wrong.
What information you need?
What happens, how often does it happen (are other files ok?), possible instructions how to reproduce and terminal output.
Some files are OK, Some are can't seek. if command is: mpv --dvd-device=dvd.iso dvd:// each time I press up/right arrow key, playback will back to video's begin if command is: mpv dvd.iso can seek, but unstable, mpv may interrupt.
terminal output:
mpv --dvd-device="From Up On Poppy Hill.iso" dvd://
Playing dvd://.
libdvdread: Using libdvdcss version 1.2.13 for DVD access
*** Zero check failed in ifo_read.c:2123
for vts_attributes->vtstt_audio_attr[i] = 0x10a36e6500000000
*** Zero check failed in ifo_read.c:2123
for vts_attributes->vtstt_audio_attr[i] = 0x10a36e6500000000
*** Zero check failed in ifo_read.c:2123
for vts_attributes->vtstt_audio_attr[i] = 0x10a36e6500000000
*** Zero check failed in ifo_read.c:2123
for vts_attributes->vtstt_audio_attr[i] = 0x10a36e6500000000
*** Zero check failed in ifo_read.c:2123
for vts_attributes->vtstt_audio_attr[i] = 0x10a36e6500000000
There are 3 titles on this DVD.
There are 1 angles in this DVD title.
*** Zero check failed in ifo_read.c:705
for vtsi_mat->vts_audio_attr[i] = 0x10a36e6500000000
*** Zero check failed in ifo_read.c:705
for vtsi_mat->vts_audio_attr[i] = 0x10a36e6500000000
*** Zero check failed in ifo_read.c:705
for vtsi_mat->vts_audio_attr[i] = 0x10a36e6500000000
*** Zero check failed in ifo_read.c:705
for vtsi_mat->vts_audio_attr[i] = 0x10a36e6500000000
*** Zero check failed in ifo_read.c:705
for vtsi_mat->vts_audio_attr[i] = 0x10a36e6500000000
libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x0000014e
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x00000207
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_1.VOB at 0x002183e7
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_1.VOB at 0x002183fc
libdvdread: Elapsed time 0
libdvdread: Found 3 VTS's
libdvdread: Elapsed time 0
audio stream: 0 format: ac3 (stereo) language: ja aid: 128.
audio stream: 1 format: ac3 (5.1/6.1) language: zh aid: 130.
number of audio channels on disk: 2.
subtitle ( sid ): 0 language: zh
subtitle ( sid ): 1 language: zh
subtitle ( sid ): 2 language: ja
subtitle ( sid ): 3 language: en
number of subtitles on disk: 4
Detected file format: MPEG-PS (MPEG-2 Program Stream) (libavformat)
[stream] Video (+) --vid=0 (mpeg2video)
[stream] Audio --aid=0 --alang=zh (ac3)
[stream] Audio (+) --aid=1 --alang=ja (ac3)
[stream] Subs (+) --sid=0 --slang=zh (<unknown>)
[stream] Subs --sid=1 --slang=zh (<unknown>)
[stream] Subs --sid=2 --slang=ja (dvd_subtitle)
[stream] Subs --sid=3 --slang=en (dvd_subtitle)
Selected video codec: MPEG-2 video [lavc:mpeg2video]
Selected audio codec: ATSC A/52A (AC-3) [lavc:ac3]
AO: [alsa] 48000Hz stereo 2ch floatle
VO: [vdpau] 720x480 => 853x480 vdpau
[vdpau] Got display refresh rate 59.887 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
AV: 00:00:01 / 01:30:45 (0%) A-V: -0.000
Exiting... (Quit)
mpv "From Up On Poppy Hill.iso"
Playing From Up On Poppy Hill.iso.
[ffmpeg/mpeg] Further flags set but no bytes left
[ffmpeg/mpeg] Could not find codec parameters for stream 8 (Audio: mp2, 0 channels): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Detected file format: MPEG-PS (MPEG-2 Program Stream) (libavformat)
[stream] Video (+) --vid=0 (mpeg2video)
[stream] Audio (+) --aid=0 (ac3)
[stream] Audio --aid=1 (ac3)
[stream] Audio --aid=2 (mp2)
[stream] Subs --sid=0 (dvd_subtitle)
[stream] Subs --sid=1 (dvd_subtitle)
[stream] Subs --sid=2 (dvd_subtitle)
[stream] Subs --sid=3 (dvd_subtitle)
Selected video codec: MPEG-2 video [lavc:mpeg2video]
[ffmpeg/ac3] Channel layout '5.0(side)' with 5 channels does not match specified number of channels 2: ignoring specified channel layout
Selected audio codec: ATSC A/52A (AC-3) [lavc:ac3]
AO: [alsa] 48000Hz stereo 2ch floatle
VO: [vdpau] 720x480 => 853x480 vdpau
[vdpau] Got display refresh rate 59.887 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
AV: 00:00:00 / 01:30:50 (0%) A-V: 0.008
VO: [vdpau] 720x480 => 720x539 vdpau
[vdpau] Got display refresh rate 59.887 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
AV: 00:00:00 / 01:30:50 (0%) A-V: -0.000
VO: [vdpau] 720x480 => 853x480 vdpau
[vdpau] Got display refresh rate 59.887 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
Decreasing video pts: 0.233567 < 0.580933
AV: 00:00:00 / 01:30:50 (0%) A-V: 0.000
Decreasing video pts: 0.266933 < 0.580933
AV: 00:00:00 / 01:30:50 (0%) A-V: -0.000
Decreasing video pts: 0.316978 < 0.580933
AV: 00:00:00 / 01:30:50 (0%) A-V: 0.000
Decreasing video pts: 0.350344 < 0.580933
AV: 00:00:00 / 01:30:50 (0%) A-V: -0.000
Decreasing video pts: 0.400389 < 0.580933
AV: 00:00:00 / 01:30:50 (0%) A-V: 0.000
Decreasing video pts: 0.433756 < 0.580933
AV: 00:00:00 / 01:30:50 (0%) A-V: -0.000
Decreasing video pts: 0.483800 < 0.580933
AV: 00:00:00 / 01:30:50 (0%) A-V: 0.000
Decreasing video pts: 0.517167 < 0.580933
AV: 00:00:00 / 01:30:50 (0%) A-V: 0.000
Decreasing video pts: 0.567211 < 0.580933
AV: 00:00:02 / 01:30:50 (0%) A-V: 0.000
[ffmpeg/ac3] frame sync error
AV: 00:01:03 / 01:30:50 (1%) A-V: -0.007
[ffmpeg/ac3] frame sync error
AV: 00:01:14 / 01:30:50 (1%) A-V: -0.000
[ffmpeg/ac3] frame sync error
AV: 00:02:14 / 01:30:50 (2%) A-V: -0.011
[ffmpeg/ac3] frame sync error
AV: 00:03:15 / 01:30:50 (3%) A-V: 0.000
[ffmpeg/ac3] frame sync error
AV: 00:04:16 / 01:30:50 (4%) A-V: -0.000
[ffmpeg/ac3] frame sync error
AV: 00:05:16 / 01:30:50 (5%) A-V: -0.009
[ffmpeg/ac3] frame sync error
AV: 00:06:17 / 01:30:50 (6%) A-V: -0.012
[ffmpeg/ac3] frame sync error
AV: 00:07:18 / 01:30:50 (8%) A-V: -0.000
[ffmpeg/ac3] frame sync error
AV: 00:08:19 / 01:30:50 (9%) A-V: -0.000
[ffmpeg/ac3] frame sync error
AV: 00:09:19 / 01:30:50 (10%) A-V: 0.000
[ffmpeg/ac3] frame sync error
AV: 00:08:19 / 01:30:50 (9%) A-V: 0.000
[ffmpeg/ac3] frame sync error
AV: 00:07:20 / 01:30:50 (8%) A-V: -0.012
[ffmpeg/ac3] frame sync error
AV: 00:06:20 / 01:30:50 (6%) A-V: -0.015
[ffmpeg/ac3] frame sync error
AV: 00:05:20 / 01:30:50 (5%) A-V: -0.000
[ffmpeg/ac3] frame sync error
AV: 00:04:20 / 01:30:50 (4%) A-V: 0.000
[ffmpeg/ac3] frame sync error
AV: 00:03:20 / 01:30:50 (3%) A-V: -0.012
[ffmpeg/ac3] frame sync error
AV: 00:02:21 / 01:30:50 (2%) A-V: -0.015
[ffmpeg/ac3] frame sync error
AV: 00:01:21 / 01:30:50 (1%) A-V: 0.000
[ffmpeg/ac3] frame sync error
AV: -00:00:37 / 01:30:50 (0%) A-V: 0.000
Exiting... (End of file)
Sorry, I just remembered, I have other 2 mpeg2 video file also playback abnormal, one is m2t file, one is vob file, both cut and merge with dvbcut, save as mpegps format, problems are:
- m2t file ( save as .mpg extension ): if demuxer is lavf, video seems pause half second at begin, audio is OK, other m2t files are OK.
- vob file: rip with mplayer -dumpstream from dvd iso, cut and merge with dvbcut, if vo is vdpau, some frames are broken, at same position each time. almost all dvd iso, cut and merge with dvbcut will cause this problem.
terminal output:
mpv dvbcut_lavf_pause_half_second.mpg
Playing dvbcut_lavf_pause_half_second.mpg.
[ffmpeg/NULL] start time is not set in estimate_timings_from_pts
Detected file format: MPEG-PS (MPEG-2 Program Stream) (libavformat)
[stream] Video (+) --vid=0 (mpeg2video)
[stream] Audio (+) --aid=0 (mp2)
[stream] Audio --aid=1 (mp2)
Selected video codec: MPEG-2 video [lavc:mpeg2video]
Selected audio codec: MP2 (MPEG audio layer 2) [lavc:mp2]
AO: [alsa] 48000Hz stereo 2ch s16le
VO: [vdpau] 704x480 => 704x527 vdpau
[vdpau] Got display refresh rate 59.887 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
AV: 00:00:20 / 00:00:20 (100%) A-V: 0.000
[ffmpeg/mp2] incomplete frame
AV: 00:00:20 / 00:00:20 (100%) A-V: 0.000
Exiting... (End of file)
mpv dvbcut_vdpau_pic_brk_at_same_pos.vob
Playing dvbcut_vdpau_pic_brk_at_same_pos.vob.
[ffmpeg/NULL] start time is not set in estimate_timings_from_pts
Detected file format: MPEG-PS (MPEG-2 Program Stream) (libavformat)
[stream] Video (+) --vid=0 (mpeg2video)
[stream] Audio (+) --aid=0 (ac3)
Selected video codec: MPEG-2 video [lavc:mpeg2video]
[ffmpeg/ac3] Channel layout '5.1(side)' with 6 channels does not match specified number of channels 2: ignoring specified channel layout
Selected audio codec: ATSC A/52A (AC-3) [lavc:ac3]
AO: [alsa] 48000Hz stereo 2ch floatle
VO: [vdpau] 720x480 => 853x480 vdpau
[vdpau] Got display refresh rate 59.887 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
AV: 00:00:00 / 00:00:14 (6%) A-V: 0.000
Decreasing video pts: 0.539467 < 0.572811
AV: 00:00:01 / 00:00:14 (10%) A-V: 0.000
Decreasing video pts: 1.090011 < 1.240167
AV: 00:00:01 / 00:00:14 (10%) A-V: 0.000
Decreasing video pts: 1.123378 < 1.240167
AV: 00:00:01 / 00:00:14 (12%) A-V: 0.000
Decreasing video pts: 1.540467 < 1.573811
AV: 00:00:06 / 00:00:14 (44%) A-V: -0.000
Decreasing video pts: 6.595522 < 6.612178
AV: 00:00:14 / 00:00:14 (100%) A-V: 0.000 D: 1
Exiting... (End of file)
files are uploaded http://www1.datafilehost.com/d/447eb3d6 http://www1.datafilehost.com/d/f4ac806a
I edited your posts and added tripple backtick quotes around the log messages to make github format them more readable.
About the DVD seek problem: does it work in mplayer? Does it work with dvdnav:// in mplayer? (I want to readd dvdnav, but it hasn't happened yet.)
- m2t file ( save as .mpg extension ): if demuxer is lavf, video seems pause half second at begin, audio is OK, other m2t files are OK.
It's a bit hard to tell where this pause is...
- vob file: rip with mplayer -dumpstream from dvd iso, cut and merge with dvbcut, if vo is vdpau, some frames are broken, at same position each time. almost all dvd iso, cut and merge with dvbcut will cause this problem.
Does this play correctly with anything? Also, this file has bad timestamps, resulting in jittery playback. I'm not sure if that's normal with DVD, and/or if DVD players compensate for this normally. Maybe you can try with --no-correct-pts (which I wouldn't recommand for normal playback, but it might help in some situations).
About the DVD seek problem: it work in mplayer2 ( compiled from mplayer-build, at 2012-12-16 ), no any problem if demuxer is mpegps. sometimes picture hangs but continue playing after seek, if demux is lavf. it doesn't work with dvdnav://, mplayer2 crached and shows error message: MPlayer interrupted by signal 6 in module: decode video
- MPlayer crashed. This shouldn't happen. It can be a bug ...
About the m2t file: I don't know how to explain it correct and detail, because I don't know too much about english. Maybe you can try mplayer, compare then picture with --demuxer mpegps and lavf, you will know what I mean.
About the bad timestamps file: hardware decode doesn't work, no any error/warning message. software decode work correctly but shows message like this: [ffmpeg/mpeg2video] slice mismatch [ffmpeg/mpeg2video] Warning MVs not available [ffmpeg/mpeg2video] concealing 45 DC, 45 AC, 45 MV errors in P frame
--no-correct-pts is helpless in my situations. these files works before cut and merge, maybe it's dvbcut's bug, but, software decode work correctly.
So I actually have no idea what's going on here. It seems you reported multiple bugs: hw decoding (ffmpeg issue), a dvdread crash (almost certainly a libdvdread bug), apparently some other problem...
Just open a new issue if there are still problems, and DO NOT REPORT MULTIPLE ISSUES IN ONE ISSUE. Make a separate issue for each bug.