Opened 11 years ago

Closed 11 years ago

#2218 closed defect (fixed)

Forcing input codec for flv broken

Reported by: ami_stuff Owned by:
Priority: important Component: avformat
Version: git-master Keywords: flv regression
Cc: donmoir@comcast.net Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

attached file decodes incorrectly on big-endian because pcm_s16be is used instead of pcm_s16ble (see "libavformat/flvdec.c")

no idea if this is a bug in squeeze (creates broken files) or in ffmpeg

(also seeking does not work in ffplay - works fine with mplayer)

http://www.datafilehost.com/download-6e96d20a.html

ffplay seeking_fail.flv
ffplay version 0.9.1.git-7df9937 Copyright (c) 2003-2012 the FFmpeg developers
  built on Feb 11 2012 18:08:56 with gcc 4.5.0
  libavutil      51. 35.101 / 51. 35.101
  libavcodec     54.  0.100 / 54.  0.100
  libavformat    54.  0.100 / 54.  0.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 60.100 /  2. 60.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[flv @ 0x10e403e0] max_analyze_duration 5000000 reached at 5063000
Input #0, flv, from 'seeking_fail.flv':
  Metadata:
    creationdate    : Sun Jul 15 18:01:39 2012 
[...]
    Encoded_With    : Sorenson Squeeze
    Encoded_By      : 
  Duration: 00:03:46.53, start: 0.000000, bitrate: 354 kb/s
Codec 0x10001 is not in the full list.
    Stream #0:0: Audio: pcm_s16be, 22050 Hz, 1 channels, s16, 352 kb/s
Codec 0x10001 is not in the full list.
Seek to 45% ( 0:01:41) of total duration ( 0:03:46)       B f=0/0   
seeking_fail.flv: error while seeking=    0B f=0/0   
   7.10 A-V:  0.000 fd=   0 aq=  322KB vq=    0KB sq=    0B f=0/0  

Change History (7)

comment:1 by Carl Eugen Hoyos, 11 years ago

Component: undeterminedavformat
Keywords: flv added
Status: newopen
Version: unspecifiedgit-master

See r12184

comment:2 by Carl Eugen Hoyos, 11 years ago

Priority: normalwish
Type: defectenhancement

I think an option to invert "native" endian pcm_s16 format 0 audio is possible.

comment:3 by DonMoir, 11 years ago

As far as I can tell, you can't seek by audio stream with any flv even if it includes video.

Since above file is audio only, it fails seeking.

comment:4 by DonMoir, 11 years ago

Cc: donmoir@comcast.net added

comment:5 by Carl Eugen Hoyos, 11 years ago

Keywords: regression added
Priority: wishimportant
Reproduced by developer: set
Type: enhancementdefect

The obvious (and only possible) work-around to force the audio codec is broken since 86e107a.

$ ffmpeg -acodec pcm_s16be -i seeking_fail.flv out.wav
ffmpeg version N-42179-gaf392ef Copyright (c) 2000-2012 the FFmpeg developers
  built on Feb  1 2013 11:05:15 with gcc 4.7.1 20120723 [gcc-4_7-branch revision 189773]
  configuration:
  libavutil      51. 63.100 / 51. 63.100
  libavcodec     54. 32.100 / 54. 32.100
  libavformat    54. 14.100 / 54. 14.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     3.  0.101 /  3.  0.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
[pcm_s16be @ 0x2a9f5a0] PCM channels out of bounds
[flv @ 0x2a991c0] max_analyze_duration 5000000 reached at 5063000
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, flv, from 'seeking_fail.flv':
  Metadata:
    creationdate    : Sun Jul 15 18:01:39 2012
    dc_title        : Land Down Under
    Artist          : Men At Work
    Encoded_With    : Sorenson Squeeze
    Encoded_By      :
  Duration: 00:03:46.53, start: 0.000000, bitrate: 354 kb/s
    Stream #0:0: Audio: pcm_s16be, 22050 Hz, mono, s16, 352 kb/s
[graph 0 input from stream 0:0 @ 0x2a9b420] tb:1/1000 samplefmt:s16 samplerate:22050 chlayout:0x4
Output #0, wav, to 'out.wav':
  Metadata:
    creationdate    : Sun Jul 15 18:01:39 2012
    dc_title        : Land Down Under
    Artist          : Men At Work
    Encoded_With    : Sorenson Squeeze
    Encoded_By      :
    encoder         : Lavf54.14.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16be -> pcm_s16le)
Press [q] to stop, [?] for help
size=    9756kB time=00:03:46.53 bitrate= 352.8kbits/s
video:0kB audio:9756kB subtitle:0 global headers:0kB muxing overhead 0.000460%

(The test assumes the opposite case: flv file written on big-endian, played on little-endian.)

comment:6 by Carl Eugen Hoyos, 11 years ago

Summary: flv pcm_s16le decodes incorrectlyForcing input codec for flv broken

comment:7 by Carl Eugen Hoyos, 11 years ago

Resolution: fixed
Status: openclosed

The following should work fine now on big-endian:
$ ffmpeg -acodec pcm_s16le -i seeking_fail.flv out.wav

Note: See TracTickets for help on using tickets.