Opened 5 years ago

Closed 2 years ago

#2289 closed defect (fixed)

ffplay loops audio on eof on Windows

Reported by: feelart Owned by: cus
Priority: normal Component: ffplay
Version: git-master Keywords: SDL
Cc: cus@passwd.hu Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

1/ ffmpeg.exe -i loopBug20130216.mov -vn outMP3.mp3
2/ ffplay out101MP3.mp3

Same if
ffmpeg.exe -i loopBug20130216.mov -vn outAAC.aac

Also tested & confirmed with FFMpeg 1.0.1 & 1.1.1

P.S. Can you also reproduce the bug 2284 I reported.

F:\danses\Salsa\Salsa Odance>ffmpeg.exe -i loopBug20130216.mov -vn outMP3.mp3
ffmpeg version N-49997-gb9c5448 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 16 2013 02:32:10 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-lib
mp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-am
rwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.103 / 54. 91.103
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 37.103 /  3. 37.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'loopBug20130216.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf54.63.100
  Duration: 00:00:00.30, start: 0.018000, bitrate: 29756 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 1280x720, 46817 kb/s, 50 fps, 50 tbr, 50k tbn, 100k tbc
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      handler_name    : DataHandler
Output #0, mp3, to 'outMP3.mp3':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    TSSE            : Lavf54.63.100
    Stream #0:0(eng): Audio: mp3, 48000 Hz, stereo, s16p
    Metadata:
      handler_name    : DataHandler
Stream mapping:
  Stream #0:1 -> #0:0 (pcm_s16le -> libmp3lame)
Press [q] to stop, [?] for help
size=       6kB time=00:00:00.31 bitrate= 145.5kbits/s
video:0kB audio:5kB subtitle:0 global headers:0kB muxing overhead 5.915179%

F:\danses\Salsa\Salsa Odance>

Attachments (3)

loopBug20130216.mov (1.1 MB) - added by feelart 5 years ago.
Audio extraction leads to loop
loopBug20130216COR.mov (1.1 MB) - added by feelart 5 years ago.
Correct test file
0001-ffplay-do-not-block-audio-thread-on-WIN32.patch (1.1 KB) - added by cus 3 years ago.

Change History (12)

Changed 5 years ago by feelart

Audio extraction leads to loop

comment:1 Changed 5 years ago by feelart

Well
2/ ffplay outMP3.mp3

comment:2 Changed 5 years ago by cehoyos

  • Priority changed from important to normal

Could you explain what the issue with the file you uploaded is? I don't understand...

comment:3 Changed 5 years ago by feelart

1/

ffplay loopBug20130216COR.mov

You'll hear 6 sec(SIX) of audio, then loops after these 6 sec (well it happens because it's a cut of a NON corrupted mov, but ffmpeg doesn't properly close the stream; CLI "ffmpeg.exe -t 6 -i "2011-01-28 Salsa2.mov" -acodec copy -vn loopBug20130216COR.mov")

So that my first post was incorrect in the reproducability, but not in the bug.
In trying to cut the original file(700Mb) to fit in your 2MB limit( by the way, would be nice to raise limit to 8Mb), I first did a mistake in isolation, sorry.

2/

ffmpeg.exe -t 3 -i loopBug20130216COR.mov outMP3.mp3

3/

ffplay outMP3.mp3

You'll hear that after 3 sec the audio loops, as if the audio stream is incorrectly closed, this seems like the fixing of bug 1435.

Trying aac convertion leads to same bug.

Correct test file is thus loopBug20130216COR.mov

Changed 5 years ago by feelart

Correct test file

comment:4 Changed 5 years ago by cehoyos

Do I understand correctly that there is no bug with the first sample you uploaded?

If the second sample fails with a ffmpeg command line, please provide the command line together with the complete, uncut console output. If the sample works fine with ffmpeg but fails somehow with ffplay, please provide the failing ffplay command line together with the complete, uncut console output.

The second sample plays fine here with "ffplay loopBug20130216COR.mov" and "ffplay loopBug20130216COR.mov -autoexit". I also tested reencoding with "ffmpeg -i loopBug20130216COR.mov out.mp2" and "ffmpeg -i loopBug20130216COR.mov -strict -2 out.aac" and both output files play fine.

comment:5 Changed 5 years ago by feelart

I run Win7 64bits.

ffplay loopBug20130216COR.mov
or
ffplay out.aac (as with your "ffmpeg -i loopBug20130216COR.mov -strict -2 out.aac"

Play buggy with FFmpeg(0.8 & 1.0.1 & 1.1.1 & 2013-02-16) or SMplayer AFTER 6sec.

It's not your case??

comment:6 Changed 5 years ago by cehoyos

  • Component changed from undetermined to FFplay
  • Keywords SDL added
  • Version changed from unspecified to git-master

The problem - that sound loops with ffplay on eof - is reproducible both with the Zeranoe builds and with a binary compiled with current SDL 1.2.15 binary release.
I don't know if this is a bug in SDL or if the current behaviour can be improved in ffplay.

comment:7 Changed 5 years ago by cehoyos

  • Summary changed from Audio: pcm_s16le (sowt / 0x74776F73) extraction bug to ffplay loops audio on eof on Windows

comment:8 Changed 3 years ago by cus

  • Cc cus@passwd.hu added
  • Owner set to cus
  • Status changed from new to open

Could you try the attached patch?

comment:9 Changed 2 years ago by cus

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