Page 1 of 1

can hear audio in a stream, but can't save it to file

Posted: 28 Apr 2006 16:38
by rramsey
Hi,

I'm using vlc to watch and listen to streaming video/audio from a web camera. When I use vlc (or WMP, quicktime, or RealPlayer) I can hear the audio just fine. But when I try to record the stream, there's no audio in the file, even though I can hear the audio from the stream while I'm recording.

Here's the stream information:

stream 0
codec: mp4v
type: Video
Stream 1
codec: ulaw
Type: Audio
Channels: 1
Sample Rate 8000 Hz

Here's the messages I get when recording:

main warning: late picture skipped (56389)
main warning: late picture skipped (17389)
mux_ts debug: adjusting rate at 0/1034711 (91/0)
main warning: audio drift is too big (-120494), clearing out
main warning: timing screwed, stopping resampling
main warning: mixer start isn't output start (-2960)
main warning: audio drift is too big (-121494), clearing out
main debug: audio output is starving (255244), playing silence
ffmpeg debug: concealing 1 DC, 1 AC, 1 MV errors
(mpeg4@08B2C870)
ffmpeg warning: illegal dc vlc
(mpeg4@08B2C870)
ffmpeg warning: Error at MB: 1348
(mpeg4@08B2C870)
ffmpeg debug: concealing 1 DC, 1 AC, 1 MV errors
(mpeg4@08B2C870)
ffmpeg warning: I cbpc damaged at 43 29
(mpeg4@08B2C870)


But even though it says it is playing silence, I still hear the audio in the stream. It just isn't in the recorded files.

Any ideas?

Thanks!

Posted: 28 Apr 2006 19:35
by DJ
What are you transcoding this into?

Have you looked at your Task manager for CPU usage considering you are monitoring the transcode locally?

Posted: 28 Apr 2006 20:09
by rramsey
I've tried mpeg, mov, asf and get the same result. It may be related to:

viewtopic.php?p=61626&

But I haven't had a chance to read through that yet to know for sure.

Thanks!

Posted: 28 Apr 2006 20:21
by rramsey
Yep, viewtopic.php?t=18287&start=0&postdays= ... highlight=

is the same error, so any replies should go to that post.

Thanks

Posted: 28 Apr 2006 20:25
by DJ
Those are containers not formats. Very doubtful the container will change the issue. Well is may depending on the chosen format as not all formats are not compatible with all containers.

What is the format you are using for the transcode (audio & video)?

Posted: 28 Apr 2006 21:20
by kcorey
I tried a capture from the 214. The capture was 17 seconds long. I got video for all 17 seconds, but audio for only the first 1.5 seconds or so.

Here is the MRL:
:sout=#transcode{acodec=mp4a,ab=128,samplerate=44100}:duplicate{dst=display,dst=std{access=file,mux=mp4,dst="C:\Documents and Settings\kcorey\Desktop\test6.mp4"}}

CPU peaked once at 40%, but was generally under 10%-- CPU is P4 3GHz. Video and audio both played fine to the console during the capture.

Here are the messages:

main debug: creating new input thread
main debug: waiting for thread completion
main debug: thread 5252 (input) created at priority 1 (input/input.c:261)
main debug: stream=`transcode'
main debug: looking for sout stream module: 1 candidate
main debug: stream=`duplicate'
main debug: looking for sout stream module: 1 candidate
stream_out_duplicate debug: creating 'duplicate'
stream_out_duplicate debug: * adding `display'
main debug: stream=`display'
main debug: looking for sout stream module: 1 candidate
main debug: using sout stream module "stream_out_display"
stream_out_duplicate debug: * adding `std{access=file,mux=mp4,dst=C:\Documents and Settings\kcorey\Desktop\test6.mp4}'
main debug: stream=`std'
main debug: looking for sout stream module: 1 candidate
main debug: set sout option: sout-standard-access to file
main debug: set sout option: sout-standard-mux to mp4
main debug: set sout option: sout-standard-dst to C:\Documents and Settings\kcorey\Desktop\test6.mp4
stream_out_standard debug: creating `file/mp4://C:\Documents and Settings\kcorey\Desktop\test6.mp4'
stream_out_standard debug: extension is mp4
stream_out_standard debug: extension -> mux=mp4
stream_out_standard debug: using `file/mp4://C:\Documents and Settings\kcorey\Desktop\test6.mp4'
main debug: looking for sout access module: 1 candidate
access_output_file debug: file access output opened (`C:\Documents and Settings\kcorey\Desktop\test6.mp4')
main debug: using sout access module "access_output_file"
stream_out_standard debug: access opened
main debug: looking for sout mux module: 1 candidate
mux_mp4 debug: Mp4 muxer opend
main debug: using sout mux module "mux_mp4"
stream_out_standard debug: mux opened
main debug: using sout stream module "stream_out_standard"
main debug: using sout stream module "stream_out_duplicate"
main debug: set sout option: sout-transcode-acodec to mp4a
main debug: set sout option: sout-transcode-ab to 128
main debug: set sout option: sout-transcode-samplerate to 44100
stream_out_transcode debug: codec audio=mp4a 44100Hz 0 channels 128Kb/s
stream_out_transcode warning: bad aspect ratio
main debug: using sout stream module "stream_out_transcode"
main debug: `rtsp://192.42.172.15/mpeg4/media.amp' gives access `rtsp' demux `' path `192.42.172.15/mpeg4/media.amp'
main debug: creating demux: access='rtsp' demux='' path='192.42.172.15/mpeg4/media.amp'
main debug: looking for access_demux module: 1 candidate
livedotcom debug: sdp=v=0
o=- 1146233387998219 1146233387998226 IN IP4 192.42.172.15
s=Media Presentation
e=NONE
c=IN IP4 0.0.0.0
b=AS:8000
t=0 0
a=control:*
a=range:npt=now-
a=mpeg4-iod: "data:application/mpeg4-iod;base64,<blah blah blah>
livedotcom debug: RTP subsession 'video/MP4V-ES'
livedotcom debug: RTP subsession 'audio/PCMU'
livedotcom debug: We have a timeout of 60 seconds
main debug: waiting for thread completion
main debug: thread 5028 (liveMedia-timeout) created at priority 0 (livedotcom.cpp:467)
livedotcom debug: spawned timeout thread
main debug: selecting program id=0
main debug: using access_demux module "livedotcom"
main debug: looking for a subtitle file in C:\Program Files\VideoLAN\VLC\
main debug: looking for packetizer module: 17 candidates
packetizer_mpeg4video debug: opening with vol size: 29
main debug: using packetizer module "packetizer_mpeg4video"
main debug: stream out mode -> no decoder thread
main debug: looking for packetizer module: 17 candidates
main debug: using packetizer module "packetizer_copy"
main debug: stream out mode -> no decoder thread
main debug: starting in synch mode
main debug: `rtsp://192.42.172.15/mpeg4/media.amp' successfully opened
packetizer_copy debug: need dts > 0
main debug: adding a new input
stream_out_transcode debug: creating audio transcoding from fcc=`ulaw' to fcc=`mp4a'
main debug: looking for decoder module: 27 candidates
araw debug: samplerate:8000Hz channels:1 bits/sample:0
main debug: using decoder module "araw"
main debug: looking for encoder module: 10 candidates
ffmpeg debug: libavcodec already initialized
ffmpeg debug: found encoder MPEG AAC Audio
main debug: using encoder module "ffmpeg"
main debug: looking for audio filter2 module: 5 candidates
audio_format debug: s16l->fl32, bits per sample: 16
main debug: using audio filter2 module "audio_format"
main debug: looking for audio filter2 module: 5 candidates
linear_resampler debug: fl32/8000KHz/1->s16l/44100KHz/1
main debug: using audio filter2 module "linear_resampler"
main debug: looking for audio filter2 module: 5 candidates
audio_format debug: fl32->s16l, bits per sample: 32
main debug: using audio filter2 module "audio_format"
stream_out_duplicate debug: duplicated a new stream codec=mp4a (es=1 group=0)
main debug: looking for decoder module: 27 candidates
main debug: using decoder module "faad"
main debug: thread 4496 (decoder) created at priority 2 (input/decoder.c:159)
stream_out_duplicate debug: - added for output 0
main debug: adding a new input
mux_mp4 debug: adding input
stream_out_duplicate debug: - added for output 1
main debug: adding a new input
stream_out_transcode debug: not transcoding a stream (fcc=`mp4v')
stream_out_duplicate debug: duplicated a new stream codec=mp4v (es=0 group=0)
main debug: looking for decoder module: 27 candidates
ffmpeg debug: libavcodec already initialized
ffmpeg debug: postprocessing disabled
ffmpeg debug: using direct rendering
ffmpeg debug: ffmpeg codec (MPEG-4 Video) started
main debug: using decoder module "ffmpeg"
main debug: thread 4476 (decoder) created at priority 0 (input/decoder.c:159)
stream_out_duplicate debug: - added for output 0
main debug: adding a new input
mux_mp4 debug: adding input
stream_out_duplicate debug: - added for output 1
main debug: no usable vout present, spawning one
main debug: window size: 704x528
main debug: looking for video output module: 5 candidates
main debug: Registering subpicture channel, ID: 2
main debug: Registering subpicture channel, ID: 3
main debug: Registering subpicture channel, ID: 4
main debug: Registering subpicture channel, ID: 5
vout_directx debug: creating DirectXEventThread
main debug: waiting for thread completion
vout_directx debug: DirectXCreateWindow
vout_directx debug: created video sub-window
main debug: thread 5424 (DirectX Events Thread) created at priority 0 (directx.c:263)
vout_directx debug: DirectXEventThread running
vout_directx debug: DirectXInitDDraw
vout_directx debug: directx-device:
vout_directx debug: DirectXEnumCallback: Primary Display Driver, display
vout_directx debug: DirectXEnumCallback: RADEON X300/X550 Series, \\.\DISPLAY1
vout_directx debug: selecting RADEON X300/X550 Series, \\.\DISPLAY1
vout_directx debug: screen dimensions (0x0,1280x1024)
vout_directx debug: DirectDraw Capabilities: overlay=1 yuvoverlay=1 can_deinterlace_overlay=1 colorkey=1 stretch=1 bltfourcc=1
vout_directx debug: End DirectXInitDDraw
vout_directx debug: DirectXCreateDisplay
vout_directx debug: DirectXCreateClipper
faad warning: decoded zero sample
main debug: looking for audio output module: 3 candidates
vout_directx debug: disabling screen saver
main debug: using video output module "vout_directx"
aout_directx debug: OpenAudio
main debug: waiting for thread completion
vout_directx debug: NewPictureVec overlay:yes chroma:YV12
aout_directx debug: found device: Primary Sound Driver
aout_directx debug: found device: SoundMAX Digital Audio
vout_directx debug: YUV overlay created successfully
vout_directx debug: End NewPictureVec (succeeded)
main debug: got 1 direct buffer(s)
main debug: picture in 704x480 (0,0,704x480), chroma I420, ar 4:3, sar 10:11
main debug: picture user 704x480 (0,0,704x480), chroma I420, ar 4:3, sar 10:11
main debug: picture out 704x480 (0,0,704x480), chroma I420, ar 4:3, sar 10:11
main debug: direct render, mapping render pictures 0-6 to system pictures 1-7
main debug: thread 5348 (video output) created at priority 1 (video_output/video_output.c:421)
ffmpeg warning: ac-tex damaged at 43 29
(mpeg4@081C9810)
ffmpeg warning: Error at MB: 1348
(mpeg4@081C9810)
ffmpeg debug: concealing 1 DC, 1 AC, 1 MV errors
(mpeg4@081C9810)
aout_directx debug: device supports 2 channels
aout_directx debug: device supports 1 channel
aout_directx debug: creating DirectSoundThread
main debug: thread 5296 (DirectSound Notification Thread) created at priority 15 (directx.c:372)
main debug: using audio output module "aout_directx"
aout_directx debug: DirectSoundThread ready
main debug: output 's16l' 44100 Hz Stereo frame=1 samples/4 bytes
main debug: mixer 'fl32' 44100 Hz Stereo frame=1 samples/8 bytes
main debug: filter(s) 'fl32'->'s16l' 44100 Hz->44100 Hz Stereo->Stereo
main debug: looking for audio filter module: 24 candidates
main debug: using audio filter module "float32tos16"
main debug: found a filter for the whole conversion
main debug: looking for audio mixer module: 3 candidates
main debug: using audio mixer module "trivial_mixer"
main debug: input 'fl32' 44100 Hz Stereo frame=1 samples/8 bytes
main debug: filter(s) 'fl32'->'fl32' 48510 Hz->44100 Hz Stereo->Stereo
main debug: looking for audio filter module: 24 candidates
main debug: using audio filter module "bandlimited_resampler"
main debug: found a filter for the whole conversion
mux_mp4 warning: i_length <= 0
mux_mp4 warning: i_length <= 0
mux_mp4 warning: i_length <= 0
mux_mp4 warning: i_length <= 0
livedotcom debug: tk->rtpSource->hasBeenSynchronizedUsingRTCP()
main warning: clock gap, unexpected stream discontinuity
mux_mp4 warning: i_length <= 0
packetizer_copy debug: need dts > 0
livedotcom debug: tk->rtpSource->hasBeenSynchronizedUsingRTCP()
ffmpeg warning: I cbpc damaged at 43 29
(mpeg4@081C9810)
ffmpeg warning: Error at MB: 1348
(mpeg4@081C9810)
ffmpeg debug: concealing 1 DC, 1 AC, 1 MV errors
(mpeg4@081C9810)
main warning: received buffer in the future (220446603405936)
main warning: received buffer in the future (220446603429155)
main warning: received buffer in the future (220446603508400)
main warning: buffer is 104204 in advance, triggering downsampling
main warning: audio drift is too big (-121224), clearing out
main warning: timing screwed, stopping resampling
main warning: mixer start isn't output start (-17167)
main warning: audio drift is too big (-121042), clearing out
main debug: audio output is starving (202216), playing silence
ffmpeg warning: illegal dc vlc
(mpeg4@081C9810)
ffmpeg warning: Error at MB: 1346
(mpeg4@081C9810)
ffmpeg debug: concealing 45 DC, 45 AC, 45 MV errors
(mpeg4@081C9810)
ffmpeg warning: ac-tex damaged at 43 29
(mpeg4@081C9810)
ffmpeg warning: Error at MB: 1348
(mpeg4@081C9810)
ffmpeg debug: concealing 1 DC, 1 AC, 1 MV errors
(mpeg4@081C9810)
ffmpeg debug: concealing 1 DC, 1 AC, 1 MV errors
(mpeg4@081C9810)
ffmpeg warning: illegal dc vlc
(mpeg4@081C9810)
ffmpeg warning: Error at MB: 1346
(mpeg4@081C9810)
ffmpeg debug: concealing 45 DC, 45 AC, 45 MV errors
(mpeg4@081C9810)
main warning: buffer is 40347 in advance, triggering downsampling
main warning: resampling stopped after 94000 usec (drift: 17081)
ffmpeg warning: illegal dc vlc
(mpeg4@081C9810)
ffmpeg warning: Error at MB: 1347
(mpeg4@081C9810)
ffmpeg debug: concealing 45 DC, 45 AC, 45 MV errors
(mpeg4@081C9810)
main warning: buffer is 42039 in advance, triggering downsampling
main warning: resampling stopped after 47000 usec (drift: 14422)
main warning: buffer is 41717 in advance, triggering downsampling
main warning: resampling stopped after 156000 usec (drift: 20442)
main warning: buffer is 41394 in advance, triggering downsampling
main warning: resampling stopped after 141000 usec (drift: 22233)
main warning: buffer is 40949 in advance, triggering downsampling
main warning: resampling stopped after 250000 usec (drift: 28106)
main warning: buffer is 40605 in advance, triggering downsampling
ffmpeg warning: ac-tex damaged at 42 29
(mpeg4@081C9810)
ffmpeg warning: Error at MB: 1347
(mpeg4@081C9810)
ffmpeg debug: concealing 45 DC, 45 AC, 45 MV errors
(mpeg4@081C9810)
main warning: resampling stopped after 344000 usec (drift: 31965)
main warning: buffer is 40238 in advance, triggering downsampling
ffmpeg warning: ac-tex damaged at 42 29
(mpeg4@081C9810)
ffmpeg warning: Error at MB: 1347
(mpeg4@081C9810)
ffmpeg debug: concealing 45 DC, 45 AC, 45 MV errors
(mpeg4@081C9810)
main debug: control type=0
main debug: control: stopping input
main debug: closing input
main debug: thread times: real 0m17.217207s, kernel 0m0.000000s, user 0m0.000000s
main debug: thread 5028 joined (livedotcom.cpp:798)
main debug: removing module "livedotcom"
main debug: removing module "packetizer_mpeg4video"
main debug: killing decoder fourcc `mp4v', 0 PES in FIFO
main debug: removing an input
ffmpeg debug: ffmpeg codec (MPEG-4 Video) stopped
main debug: removing module "ffmpeg"
main debug: thread times: real 0m17.092218s, kernel 0m0.031250s, user 0m0.812500s
main debug: thread 4476 joined (input/decoder.c:191)
main debug: killing decoder fourcc `mp4v', 18 PES in FIFO
mux_mp4 debug: removing input
main debug: removing module "packetizer_copy"
main debug: killing decoder fourcc `ulaw', 0 PES in FIFO
main debug: removing an input
main debug: removing module "araw"
main debug: removing module "ffmpeg"
main debug: removing module "audio_format"
main debug: removing module "linear_resampler"
main debug: removing module "audio_format"
main debug: removing module "faad"
main debug: thread times: real 0m17.123465s, kernel 0m0.093750s, user 0m0.015625s
main debug: thread 4496 joined (input/decoder.c:191)
main debug: killing decoder fourcc `mp4a', 30 PES in FIFO
main debug: removing module "bandlimited_resampler"
aout_directx debug: closing audio device
aout_directx debug: DirectSoundThread exiting
main debug: thread times: real 0m16.982853s, kernel 0m0.000000s, user 0m0.000000s
main debug: thread 5296 joined (directx.c:598)
main debug: removing module "aout_directx"
main debug: removing module "float32tos16"
main debug: removing module "trivial_mixer"
mux_mp4 debug: removing input
main warning: no more input streams for this mux
main debug: destroying sout
main debug: destroying chain... (name=transcode)
main debug: destroying chain... (name=duplicate)
stream_out_duplicate debug: closing a duplication
main debug: destroying chain... (name=display)
main debug: removing module "stream_out_display"
main debug: destroying chain done
main debug: destroying chain... (name=std)
mux_mp4 debug: Close
mux_mp4 debug: movie duration 17s
mux_mp4 debug: created 43 chunks (stco)
mux_mp4 debug: created 44 chunks (stco)
main debug: removing module "mux_mp4"
access_output_file debug: file access output closed
main debug: removing module "access_output_file"
main debug: removing module "stream_out_standard"
main debug: destroying chain done
main debug: removing module "stream_out_duplicate"
main debug: destroying chain done
main debug: removing module "stream_out_transcode"
main debug: destroying chain done
main debug: thread times: real 0m17.498432s, kernel 0m0.359375s, user 0m1.640625s
main debug: thread 5252 joined (input/input.c:399)
main debug: garbage collector destroys 1 vout
vout_directx debug: DirectXCloseSurface
vout_directx debug: DirectXCloseDisplay
vout_directx debug: DirectXCloseDisplay clipper
vout_directx debug: DirectXCloseDisplay display
vout_directx debug: DirectXCloseDDraw
vout_directx debug: CloseVideo
vout_directx debug: DirectXEventThread terminating
vout_directx debug: DirectXCloseWindow
vout_directx debug: WinProc WM_DESTROY
main debug: thread times: real 0m17.295325s, kernel 0m0.015625s, user 0m0.000000s
main debug: thread 5424 joined (directx.c:494)
main debug: removing module "vout_directx"
main debug: thread times: real 0m17.264078s, kernel 0m0.031250s, user 0m0.015625s
main debug: thread 5348 joined (video_output/video_output.c:461)

Posted: 28 Apr 2006 21:30
by rramsey
Those are containers not formats. Very doubtful the container will change the issue. Well is may depending on the chosen format as not all formats are not compatible with all containers.

What is the format you are using for the transcode (audio & video)?
I've tried a different settings in the transcoding section too: MPV4, WMV1 and WMV2 for video and mp3 and flac for audio. And I've tried just leaving the transcoding boxes unchecked and only selecting the encapsulation method and letting videolan use the defaults.

The format that is being sent from the camera is mpeg-4.

Posted: 28 Apr 2006 22:16
by DJ
Well at this juncture I think you are trying to hard and are floundering!

In the first example and in your second command line the issue was trying to do a copy and transcode IE copy for the mp4 format and transcode for the audio and place the end result into a container. This is not possible because the interleave will not be correct and the timing will be screwed as the messages file indicates.

The other issue is knowing your compatible formats and containers. You could try to transcode the whole thing IE MP4v for the video, MP4a for the audio and MP4 for the container.

Some users have found problems with their cams, IE VLC is sensitive to the source therefore the source does not want to transcode into every compatible format. So another logical one to try is WMV or DivX for video mp3 for audio and asf for the container. While the first one is QuickTime compatible this one is WMP compatible and would be more logical if you want to use these setting for streaming.

Now there is two other things I noticed:

1. The original bit rate is 8k upping this to 128k is not going to help the timing for interleave nor is it going to improve the audio.

2. It seems as though you are trying to stream this at the same time. I'm not saying you can't do that. But it would be smart not to until you know the transcode is correct and even then saving the file locally and streaming at the same time is not recommended.

Posted: 28 Apr 2006 22:52
by The DJ
packetizer_copy debug: need dts > 0
I think this is the problem. But i'm not sure. someone needs to confirm, or i need access to the stream to test myself.

Posted: 29 Apr 2006 00:32
by Guest
When I first read this I thought you were trying to do a transcode from a local cam! Rather than record or transcode a cam coming in on a stream off the web. It did require a bit of effort to fully appreciate the issue along with wading through all the stuff provided. Sorry I missed it.

Actually I came back here because there was something else that was bothering me and I was going to review it again and possibly reword my suggestions or ask some questions.

It's nice to know the developers can make some sense of these issues.

DJ