[FFmpeg-user] Copying streams from partial FLVs?

Chris Pennello chris at redux.com
Thu Mar 20 00:22:55 CET 2014


On Mar 19, 2014, at 2:23 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

>> ffmpeg version 2.0.1-tessus
> 
> Please try current git head.

Unfortunately, git head doesn't compile on my system.  I get the same problem as here:
http://fate.ffmpeg.org/report.cgi?time=20140319091724&slot=x86_64-darwin-clang-apple-5.1

Thanks for pointing out that my version was behind the times.  I've updated via `brew install ffmpeg` to 2.1.4.  However, this didn't help matters.  The behavior of FFmpeg is as before.  See the invocation below.

>> [flv  <at>  0x102018600] Could not find codec parameters 
>> for stream 0 (Video: h264): unspecified size
>> Consider increasing the value for the 'analyzeduration' 
>> and 'probesize' options
> 
> Did you try this?

I hadn't; but given your comment, I did.  The output of ffprobe improved slightly--it can see the third Data stream now; but it still fails to extract the video.  The sample file I have is under a megabyte and ~14 seconds long, so the default values of analyzeduration and probesize probably already covered it.  Nevertheless, I pasted an invocation below.

> If there really is software that can play this 
> sample but current FFmpeg cannot, please provide 
> the file.

Sure; here it is.
https://www.dropbox.com/s/sqthlxffdjhf764/rangetest2.flv

Note, though, that Flash can't play this without already having loaded up the non-"pseudo-streaming" resource.  That is, in the example I gave, when a user seeks ahead of the buffer, the Flash player has already started playback from the very beginning of the file.  So presumably, there is some additional metadata that Flash is aware of that enables it to transition to successfully decoding this partial FLV. Perhaps my question should be: what is the character of that additional metadata, and how can I provide it to FFmpeg to enable it to extract the video stream in addition to the audio stream?

Another attempt I tried was to pull all of the data from the FLV preceding the first frame of video (I consulted the table of keyframes, and used the byte offset of time index 0 to get this data): it's almost 4K.  I then prepended this (presumably fuller) header to the partial FLV fetched, replacing its existing 13-byte FLV header returned by the "pseudo-streaming"-compatible web server.  This produced all the same results, though.

% ffmpeg -i tmp/rangetest2.flv -vcodec copy -acodec copy tmp/rangetest2.mp4
ffmpeg version 2.1.4 Copyright (c) 2000-2014 the FFmpeg developers
  built on Mar  2 2014 13:38:24 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.1.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[h264 @ 0x7fe589024e00] no frame!
    Last message repeated 133 times
[h264 @ 0x7fe589024e00] non-existing PPS 1 referenced
[h264 @ 0x7fe589024e00] decode_slice_header error
[h264 @ 0x7fe589024e00] no frame!
    Last message repeated 16 times
[h264 @ 0x7fe589024e00] SEI type 79 size 1104 truncated at 359
[h264 @ 0x7fe589024e00] no frame!
[flv @ 0x7fe589004a00] decoding for stream 0 failed
[flv @ 0x7fe589004a00] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flv, from 'tmp/rangetest2.flv':
  Duration: 00:20:32.23, start: 1218.614000, bitrate: 5 kb/s
    Stream #0:0: Video: h264, 30 tbr, 1k tbn, 2k tbc
    Stream #0:1: Audio: aac, 44100 Hz, mono, fltp
File 'tmp/rangetest2.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'tmp/rangetest2.mp4':
  Metadata:
    encoder         : Lavf55.19.104
    Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
Press [q] to stop, [?] for help
[flv @ 0x7fe589004a00] Stream discovered after head already parsed
[flv @ 0x7fe589004a00] New data stream 0:2 at pos:757450 and DTS:1231.23s
size=     134kB time=00:00:14.14 bitrate=  77.6kbits/s    
video:0kB audio:131kB subtitle:0 global headers:0kB muxing overhead 2.402472%

% ffprobe -analyzeduration 14000000 -probesize 1000000 tmp/rangetest2.flv
ffprobe version 2.1.4 Copyright (c) 2007-2014 the FFmpeg developers
  built on Mar  2 2014 13:38:24 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.1.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[h264 @ 0x7fc8f3818800] no frame!
    Last message repeated 133 times
[h264 @ 0x7fc8f3818800] non-existing PPS 1 referenced
[h264 @ 0x7fc8f3818800] decode_slice_header error
[h264 @ 0x7fc8f3818800] no frame!
    Last message repeated 16 times
[h264 @ 0x7fc8f3818800] SEI type 79 size 1104 truncated at 359
[h264 @ 0x7fc8f3818800] no frame!
    Last message repeated 49 times
[h264 @ 0x7fc8f3818800] non-existing PPS 15 referenced
[h264 @ 0x7fc8f3818800] decode_slice_header error
[h264 @ 0x7fc8f3818800] no frame!
    Last message repeated 31 times
[h264 @ 0x7fc8f3818800] Partitioned H.264 support is incomplete
[h264 @ 0x7fc8f3818800] no frame!
    Last message repeated 79 times
[h264 @ 0x7fc8f3818800] SEI type 84 size 1304 truncated at 1286
[h264 @ 0x7fc8f3818800] no frame!
    Last message repeated 13 times
[h264 @ 0x7fc8f3818800] non-existing PPS 0 referenced
[h264 @ 0x7fc8f3818800] decode_slice_header error
[h264 @ 0x7fc8f3818800] no frame!
[h264 @ 0x7fc8f3818800] sps_id out of range
[h264 @ 0x7fc8f3818800] no frame!
    Last message repeated 50 times
[flv @ 0x7fc8f3804a00] Stream discovered after head already parsed
[h264 @ 0x7fc8f3818800] no frame!
    Last message repeated 11 times
[h264 @ 0x7fc8f3818800] Partitioned H.264 support is incomplete
[h264 @ 0x7fc8f3818800] no frame!
    Last message repeated 15 times
[h264 @ 0x7fc8f3818800] slice type too large (24) at 0 0
[h264 @ 0x7fc8f3818800] decode_slice_header error
[h264 @ 0x7fc8f3818800] no frame!
    Last message repeated 2 times
[flv @ 0x7fc8f3804a00] decoding for stream 0 failed
[flv @ 0x7fc8f3804a00] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flv, from 'tmp/rangetest2.flv':
  Duration: 00:20:32.23, start: 1218.614000, bitrate: 5 kb/s
    Stream #0:0: Video: h264, 30 tbr, 1k tbn, 2k tbc
    Stream #0:1: Audio: aac, 44100 Hz, mono, fltp
    Stream #0:2: Data: none
Unsupported codec with id 0 for input stream 2


More information about the ffmpeg-user mailing list