[FFmpeg-user] mmsh streams and immense buffering

Patrick Cornwell patrick at cornwell.org
Mon Jun 4 16:05:29 CEST 2012


Hi again,

Just to sneek back into my thread at a point before an arguement seemingly
broke out, I have moved further without having to complile a debug version
as the latest build does not crash FFmpeg.

I have found if I remove any audio stream from the output of one of the
problematic stream, the transcoding occurs fine. e.g:

C:\ffmpeg\bin>ffmpeg -probesize 2048 -i "mmsh://209.105.232.35/cssaitek1"
-an
-y "out.flv"
ffmpeg version N-41195-g8a0efa9 Copyright (c) 2000-2012 the FFmpeg
developers
  built on May 31 2012 20:04:59 with gcc 4.6.3
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r
--enable-libass
 --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable
-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut
--enable-libope
njpeg --enable-librtmp --enable-libschroedinger --enable-libspeex
--enable-libth
eora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-
libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid
--e
nable-zlib
  libavutil      51. 55.100 / 51. 55.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[wmv3 @ 01fdfa80] Extra data: 8 bits left, value: 0
[asf @ 01fdc240] Stream #0: not enough frames to estimate rate; consider
increas
ing probesize
[asf @ 01fdc240] Stream #1: not enough frames to estimate rate; consider
increas
ing probesize
[asf @ 01fdc240] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, asf, from 'mmsh://209.105.232.35/cssaitek1':
  Metadata:
    WMFSDKVersion   : 12.0.7600.16385
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 0
  Duration: N/A, start: 631952.290000, bitrate: 266 kb/s
    Stream #0:0(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 22050 Hz, mono,
s16, 1
6 kb/s
    Stream #0:1(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p,
640x480,
250 kb/s, 1k tbr, 1k tbn, 1k tbc
[buffer @ 035c7380] w:640 h:480 pixfmt:yuv420p tb:1/1000 sar:0/1
sws_param:flags
=2
[buffersink @ 0363afe0] No opaque field provided
[wmv3 @ 01fdfa80] Extra data: 8 bits left, value: 0
Output #0, flv, to 'out.flv':
  Metadata:
    WMFSDKVersion   : 12.0.7600.16385
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 0
    encoder         : Lavf54.6.101
    Stream #0:0(eng): Video: flv1 ([2][0][0][0] / 0x0002), yuv420p, 640x480,
q=2
-31, 200 kb/s, 1k tbn, 1k tbc
Stream mapping:
  Stream #0:1 -> #0:0 (wmv3 -> flv)
Press [q] to stop, [?] for help
frame=   10 fps=0.0 q=22.5 size=      48kB time=00:00:00.71 bitrate=
542.4kbits/
frame=   27 fps= 14 q=31.0 size=      72kB time=00:00:02.08 bitrate=
283.2kbits/
frame=   40 fps= 13 q=31.0 size=      85kB time=00:00:03.12 bitrate=
223.2kbits/
frame=   54 fps= 13 q=31.0 size=      98kB time=00:00:04.24 bitrate=
190.0kbits/
frame=   67 fps= 13 q=31.0 size=     112kB time=00:00:05.28 bitrate=
173.1kbits/
frame=   81 fps= 12 q=31.0 size=     125kB time=00:00:06.39 bitrate=
159.9kbits/
frame=   93 fps= 12 q=31.0 Lsize=     138kB time=00:00:07.36 bitrate=
153.4kbits
/s
video:136kB audio:0kB global headers:0kB muxing overhead 1.269791%
Received signal 2: terminating.



If I allow the audio stream to remain, the file gets written out right at
the end of the transcode (when I force it to stop):



C:\ffmpeg\bin>ffmpeg -probesize 2048 -i "mmsh://209.105.232.35/cssaitek1" -y
"ou
t.flv"
ffmpeg version N-41195-g8a0efa9 Copyright (c) 2000-2012 the FFmpeg
developers
  built on May 31 2012 20:04:59 with gcc 4.6.3
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r
--enable-libass
 --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable
-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut
--enable-libope
njpeg --enable-librtmp --enable-libschroedinger --enable-libspeex
--enable-libth
eora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-
libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid
--e
nable-zlib
  libavutil      51. 55.100 / 51. 55.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[wmv3 @ 0220f120] Extra data: 8 bits left, value: 0
[asf @ 0220c1e0] Stream #0: not enough frames to estimate rate; consider
increas
ing probesize
[asf @ 0220c1e0] Stream #1: not enough frames to estimate rate; consider
increas
ing probesize
[asf @ 0220c1e0] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, asf, from 'mmsh://209.105.232.35/cssaitek1':
  Metadata:
    WMFSDKVersion   : 12.0.7600.16385
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 0
  Duration: N/A, start: 632040.409000, bitrate: 266 kb/s
    Stream #0:0(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 22050 Hz, mono,
s16, 1
6 kb/s
    Stream #0:1(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p,
640x480,
250 kb/s, 1k tbr, 1k tbn, 1k tbc
[buffer @ 01d785c0] w:640 h:480 pixfmt:yuv420p tb:1/1000 sar:0/1
sws_param:flags
=2
[buffersink @ 01d788e0] No opaque field provided
[wmv3 @ 0220f120] Extra data: 8 bits left, value: 0
Output #0, flv, to 'out.flv':
  Metadata:
    WMFSDKVersion   : 12.0.7600.16385
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 0
    encoder         : Lavf54.6.101
    Stream #0:0(eng): Video: flv1 ([2][0][0][0] / 0x0002), yuv420p, 640x480,
q=2
-31, 200 kb/s, 1k tbn, 1k tbc
    Stream #0:1(eng): Audio: mp3 ([2][0][0][0] / 0x0002), 22050 Hz, mono,
s16
Stream mapping:
  Stream #0:1 -> #0:0 (wmv3 -> flv)
  Stream #0:0 -> #0:1 (wmav2 -> libmp3lame)
Press [q] to stop, [?] for help
frame=   12 fps=0.0 q=28.2 size=       0kB time=00:00:00.00 bitrate=
0.0kbits/
frame=   27 fps= 14 q=31.0 size=       0kB time=00:00:00.00 bitrate=
0.0kbits/
frame=   41 fps= 14 q=31.0 size=       0kB time=00:00:00.00 bitrate=
0.0kbits/
frame=   55 fps= 13 q=31.0 size=       0kB time=00:00:00.00 bitrate=
0.0kbits/
frame=   68 fps= 13 q=31.0 size=       0kB time=00:00:00.00 bitrate=
0.0kbits/
Trying to remove 576 samples, but que empty
[flv @ 01d722c0] Encoder did not produce proper pts, making some up.
[libmp3lame @ 01d77e40] Trying to remove 576 samples, but que empty
frame=   80 fps= 13 q=31.0 Lsize=     122kB time=00:00:00.05
bitrate=19288.6kbit
s/s
video:121kB audio:0kB global headers:0kB muxing overhead 1.377018%
Received signal 2: terminating.


I'm in an interesting position. The first thing to do is get the encoder
fixed. What is happening is the encoder is presenting a stream then not
putting any data through it - it should not create an audio stream at all in
this instance (when the user is selecting to not stream audio) but instead
creates one and makes it blank, giving the lack of pts values the second
output complains of. 

But until then, whilst I can use the -map option to select which stream to
transcode, there are some streams with an actual audio feed, so I can't just
eliminate sound completely, and have no reliable way beforehand of knowing
whether a stream has an audio stream with actual data in it or not.

My question is, is there a way to tell Ffmpeg to just 'blank' or remove the
audio stream if there is no data within it, or indeed just use a video
streams' pts values? Again, forgive me if this is overly simplistic.

Pat



More information about the ffmpeg-user mailing list