Opened 5 years ago

Closed 5 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 5 years ago.
Log file for ticket 4086. Encoding stops around 4:56 mins.

Download all attachments as: .zip

Change History (12)

Changed 5 years ago by naciselim

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

comment:1 Changed 5 years ago by cehoyos

  • Keywords dvvideo added

Please provide a sample that allows to reproduce your issue.

comment:3 Changed 5 years ago by relaxed

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 5 years ago by relaxed (previous) (diff)

comment:4 Changed 5 years ago by naciselim

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

comment:5 Changed 5 years ago by relaxed

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 5 years ago by relaxed (previous) (diff)

comment:6 Changed 5 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords avi regression added
  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open
  • Summary changed from Encoding stops around 4:56 minutes. to Decoding of a 20 minutes dvvideo / avi sample stops around 4:56 minutes.
  • Version changed from unspecified to git-master

Regression since dd0429e1 / 756547ce

comment:7 follow-up: Changed 5 years ago by naciselim

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

comment:8 in reply to: ↑ 7 Changed 5 years ago by jamal

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 Changed 5 years ago by cehoyos

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 Changed 5 years ago by naciselim

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 Changed 5 years ago by michael

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