Opened 9 years ago

Closed 9 years ago

#4086 closed defect (fixed)

Decoding of a 20 minutes dvvideo / avi sample stops around 4:56 minutes.

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

Description

Summary of the bug: Have bunch of videos that I had captured from a miniDV tape as dvvideo (almost 30 mbps). I captured them by using a Windows Media Center version of Windows almost 10 years ago. When I try to convert them to libx264/aac, encoding stops around 4:56 minutes.
How to reproduce:
See the report file. If needed I can share a link to the original file (4GB).

Attachments (1)

ffmpeg-20141104-223005.log (1.3 MB ) - added by naciselim 9 years ago.
Log file for ticket 4086. Encoding stops around 4:56 mins.

Download all attachments as: .zip

Change History (12)

by naciselim, 9 years ago

Attachment: ffmpeg-20141104-223005.log added

Log file for ticket 4086. Encoding stops around 4:56 mins.

comment:1 by Carl Eugen Hoyos, 9 years ago

Keywords: dvvideo added

Please provide a sample that allows to reproduce your issue.

comment:3 by relaxed, 9 years ago

Please change the sharing preferences for this file to "Public", so that we don't need a drive account or need to ask permission to download it.

Last edited 9 years ago by relaxed (previous) (diff)

comment:4 by naciselim, 9 years ago

Sorry for that. Just changed. Could you retry? The only requirement is to use the link above to access it.

comment:5 by relaxed, 9 years ago

The download works now, thanks. I think this an FFmpeg regression because it fails at the spot you mentioned using today's git master, and with the latest mpv. And, oddly, ffmpeg exits with a 0 status when this happens.

However, I have an older version of mplayer2 around and it decodes the entire video properly. It's linked against the following libs:

MPlayer2 9d6b188 (C) 2000-2012 MPlayer Team
<..snip..>
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2 SSSE3 CMOV
Compiled against libavutil version 52.8.0
Compiled against libavcodec version 54.41.1
Compiled against libavformat version 54.21.3
Compiled against libswscale version 2.1.1

I hope this helps.

Last edited 9 years ago by relaxed (previous) (diff)

comment:6 by Carl Eugen Hoyos, 9 years ago

Component: undeterminedavformat
Keywords: avi regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Summary: Encoding stops around 4:56 minutes.Decoding of a 20 minutes dvvideo / avi sample stops around 4:56 minutes.
Version: unspecifiedgit-master

Regression since dd0429e1 / 756547ce

comment:7 by naciselim, 9 years ago

Is there an easy way for me to pull the older lib(s) sources and compile?

in reply to:  7 comment:8 by jamal, 9 years ago

Replying to naciselim:

Is there an easy way for me to pull the older lib(s) sources and compile?

You can use "git checkout dd0429e1" to reset your local tree to that commit, or searching for it on http://git.videolan.org/?p=ffmpeg.git and downloading a snapshot.

If you feel confident enough you could instead look at the changes 756547ce introduced and manually undo them in an up-to-date tree, and see if that works.
The commit that introduced the regression is pretty old, and you'd be missing a lot of development if you compile a snapshot that old.

comment:9 by Carl Eugen Hoyos, 9 years ago

You can either search for n = avi->dv_demux ? 0 : get_stream_idx(d); in libavformat/avidec.c and make it n = get_stream_idx(d); or use FFmpeg 1.2.10.

comment:10 by naciselim, 9 years ago

Yes, thanks, I did this change and the video worked. However, I did some extra changes also. Please let me know if they were needed or harm in a way:

$ diff -C 5 avidec.c.orig avidec.c
*** avidec.c.orig       2014-11-06 23:25:43.827512100 -0800
--- avidec.c    2014-11-06 23:31:47.626320200 -0800
***************
*** 1148,1158 ****
          if (d[0] == 'L' && d[1] == 'I' && d[2] == 'S' && d[3] == 'T') {
              avio_skip(pb, 4);
              goto start_sync;
          }

!         n = avi->dv_demux ? 0 : get_stream_idx(d);

          if (!((i - avi->last_pkt_pos) & 1) &&
              get_stream_idx(d + 1) < s->nb_streams)
              continue;

--- 1148,1159 ----
          if (d[0] == 'L' && d[1] == 'I' && d[2] == 'S' && d[3] == 'T') {
              avio_skip(pb, 4);
              goto start_sync;
          }

!         // n = avi->dv_demux ? 0 : get_stream_idx(d);
!       n = get_stream_idx(d);

          if (!((i - avi->last_pkt_pos) & 1) &&
              get_stream_idx(d + 1) < s->nb_streams)
              continue;

***************
*** 1720,1735 ****
      AVStream *st;
      int i, index;
      int64_t pos, pos_min;
      AVIStream *ast;

-     /* Does not matter which stream is requested dv in avi has the
-      * stream information in the first video stream.
-      */
-     if (avi->dv_demux)
-         stream_index = 0;
-
      if (!avi->index_loaded) {
          /* we only load the index on demand */
          avi_load_index(s);
          avi->index_loaded |= 1;
      }
--- 1721,1730 ----
***************
*** 1758,1768 ****

      if (CONFIG_DV_DEMUXER && avi->dv_demux) {
          /* One and only one real stream for DV in AVI, and it has video  */
          /* offsets. Calling with other stream indexes should have failed */
          /* the av_index_search_timestamp call above.                     */
!
          if (avio_seek(s->pb, pos, SEEK_SET) < 0)
              return -1;

          /* Feed the DV video stream version of the timestamp to the */
          /* DV demux so it can synthesize correct timestamps.        */
--- 1753,1764 ----

      if (CONFIG_DV_DEMUXER && avi->dv_demux) {
          /* One and only one real stream for DV in AVI, and it has video  */
          /* offsets. Calling with other stream indexes should have failed */
          /* the av_index_search_timestamp call above.                     */
!         av_assert0(stream_index == 0);
!
          if (avio_seek(s->pb, pos, SEEK_SET) < 0)
              return -1;

          /* Feed the DV video stream version of the timestamp to the */
          /* DV demux so it can synthesize correct timestamps.        */

tt@NaciTT ~/ffmpeg/libavformat

comment:11 by Michael Niedermayer, 9 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.