Hello,
I would like to stream directly my webcam from linux with ffmpeg.
I launched the following command (seeing the posts and helpcenter):
ffmpeg -f video4linux2 -s "320x240" -i /dev/video0 -f avi "rtmp://1.11645395.fme.ustream.tv/ustreamVideo/myurl/mycode flashver=FME/2.5\20(compatible;\20FMSc\201.0)"
Something seems to happen because the camera is working and I see the verbose output of ffmpeg; but I don't see anything on my channel.
Is there something wrong?
Is it "\20" for spaces and why not "%20"?
I am using mageia 2, ffmpeg 0.10.4
Thanks.
David
Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
-
lindom13,
Have you seen these two threads?
http://community.ustream.tv/ustream/t...
http://community.ustream.tv/ustream/t...
Can you please attach your output logs similar to what the other users have done? -
-
ffmpeg -loglevel debug -f video4linux2 -s "320x240" -i /dev/video0 -t 30 -f avi "rtmp://1.11645395.fme.ustream.tv/ustreamVideo/{$URL}/{$KEY} flashver=FME/2.5\20(compatible;\20FMSc\201.0)"
ffmpeg version 0.10.4 Copyright (c) 2000-2012 the FFmpeg developers
built on Jun 16 2012 22:55:53 with gcc 4.6.3
configuration: --prefix=/usr --enable-shared --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include --disable-stripping --enable-postproc --enable-gpl --enable-pthreads --enable-libtheora --enable-libvorbis --disable-encoder=vorbis --enable-libvpx --enable-x11grab --enable-runtime-cpudetect --enable-libdc1394 --enable-libschroedinger --enable-librtmp --enable-libspeex --enable-libfreetype --enable-libnut --enable-libgsm --enable-libcelt --enable-libopencv --enable-libopenjpeg --enable-libxavs --enable-frei0r --enable-libmodplug --enable-libass --enable-gnutls --enable-libcdio --enable-libpulse --enable-libdirac --enable-libv4l2 --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libx264 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libxvid
libavutil 51. 35.100 / 51. 35.100
libavcodec 53. 61.100 / 53. 61.100
libavformat 53. 32.100 / 53. 32.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 61.100 / 2. 61.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100
[video4linux2,v4l2 @ 0x21c80a0] [4]Capabilities: 5000001
[video4linux2,v4l2 @ 0x21c80a0] The V4L2 driver set input_id: 0, input: Camera 1
[rawvideo @ 0x21ce1c0] err{or,}_recognition separate: 1; 1
[rawvideo @ 0x21ce1c0] err{or,}_recognition combined: 1; 10001
[video4linux2,v4l2 @ 0x21c80a0] All info found
[video4linux2,v4l2 @ 0x21c80a0] Estimating duration from bitrate, this may be inaccurate
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 9469.173529, bitrate: 27648 kb/s
Stream #0:0, 1, 1/1000000: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240, 1/30, 27648 kb/s, 30 tbr, 1000k tbn, 30 tbc
Parsing...
Parsed protocol: 0
Parsed host : 1.11645395.fme.ustream.tv
Parsed app : ustreamVideo/11645395
RTMP_Connect1, ... connected, handshaking
HandShake: Type Answer : 03
HandShake: Server Uptime : 873192918
HandShake: FMS Version : 3.5.1.1
HandShake, client signature does not match!
RTMP_Connect1, handshaked
RTMP_SendPacket: fd=5, size=178
0000: 03 00 00 00 00 00 b2 14 00 00 00 00 ............
0000: 02 00 07 63 6f 6e 6e 65 63 74 00 3f f0 00 00 00 ...connect.?....
0010: 00 00 00 03 00 03 61 70 70 02 00 15 75 73 74 72 ......app...ustr
0020: 65 61 6d 56 69 64 65 6f 2f 31 31 36 34 35 33 39 eamVideo/1164539
0030: 35 00 04 74 79 70 65 02 00 0a 6e 6f 6e 70 72 69 5..type...nonpri
0040: 76 61 74 65 00 08 66 6c 61 73 68 56 65 72 02 00 vate..flashVer..
0050: 1e 46 4d 45 2f 32 2e 35 20 28 63 6f 6d 70 61 74 .FME/2.5 (compat
0060: 69 62 6c 65 3b 20 46 4d 53 63 20 31 2e 30 29 00 ible; FMSc 1.0).
0070: 05 74 63 55 72 6c 02 00 36 72 74 6d 70 3a 2f 2f .tcUrl..6rtmp://
0000: c3 .
0000: 31 2e 31 31 36 34 35 33 39 35 2e 66 6d 65 2e 75 1.11645395.fme.u
0010: 73 74 72 65 61 6d 2e 74 76 2f 75 73 74 72 65 61 stream.tv/ustrea
0020: 6d 56 69 64 65 6f 2f 31 31 36 34 35 33 39 35 00 mVideo/11645395.
0030: 00 09 ..
Invoking connect
RTMP_ReadPacket: fd=5
0000: 02 00 00 00 00 00 04 05 00 00 00 00 ............
0000: 00 26 25 a0 .&%.
HandleServerBW: server BW = 2500000
RTMP_ReadPacket: fd=5
0000: 02 00 00 00 00 00 05 06 00 00 00 00 ............
0000: 00 26 25 a0 02 .&%..
HandleClientBW: client BW = 2500000 2
RTMP_ReadPacket: fd=5
0000: 02 00 00 00 00 00 06 04 00 00 00 00 ............
0000: 00 00 00 00 00 00 ......
HandleCtrl, received ctrl. type: 0, len: 6
HandleCtrl, Stream Begin 0
RTMP_ReadPacket: fd=5
0000: 03 00 00 00 00 00 f0 14 00 00 00 00 ............
0000: 02 00 07 5f 72 65 73 75 6c 74 00 3f f0 00 00 00 ..._result.?....
0010: 00 00 00 03 00 06 66 6d 73 56 65 72 02 00 0d 46 ......fmsVer...F
0020: 4d 53 2f 33 2c 35 2c 31 2c 35 31 37 00 0c 63 61 MS/3,5,1,517..ca
0030: 70 61 62 69 6c 69 74 69 65 73 00 40 3f 00 00 00 pabilities.@?...
0040: 00 00 00 00 04 6d 6f 64 65 00 3f f0 00 00 00 00 .....mode.?.....
0050: 00 00 00 00 09 03 00 05 6c 65 76 65 6c 02 00 06 ........level...
0060: 73 74 61 74 75 73 00 04 63 6f 64 65 02 00 1d 4e status..code...N
0070: 65 74 43 6f 6e 6e 65 63 74 69 6f 6e 2e 43 6f 6e etConnection.Con
RTMP_ReadPacket: fd=5
0000: c3 .
0000: 6e 65 63 74 2e 53 75 63 63 65 73 73 00 0b 64 65 nect.Success..de
0010: 73 63 72 69 70 74 69 6f 6e 02 00 15 43 6f 6e 6e scription...Conn
0020: 65 63 74 69 6f 6e 20 73 75 63 63 65 65 64 65 64 ection succeeded
0030: 2e 00 0e 6f 62 6a 65 63 74 45 6e 63 6f 64 69 6e ...objectEncodin
0040: 67 00 00 00 00 00 00 00 00 00 00 04 64 61 74 61 g...........data
0050: 08 00 00 00 00 00 07 76 65 72 73 69 6f 6e 02 00 .......version..
0060: 09 33 2c 35 2c 31 2c 35 31 37 00 00 09 00 00 09 .3,5,1,517......
RTMP_ClientPacket, received: invoke 240 bytes
(object begin)
Property:
Property:
Property:
(object begin)
Property:
Property:
Property:
(object end)
Property:
(object begin)
Property:
Property:
Property:
Property:
Property:
(object begin)
Property:
(object end)
(object end)
(object end)
HandleInvoke, server invoking
HandleInvoke, received result for method call
RTMP_SendPacket: fd=5, size=61
0000: 43 00 00 00 00 00 3d 14 C.....=.
0000: 02 00 0d 72 65 6c 65 61 73 65 53 74 72 65 61 6d ...releaseStream
0010: 00 40 00 00 00 00 00 00 00 05 02 00 20 5a 6e 67 .@.......... Zng
0020: 57 65 45 79 39 74 34 58 67 50 78 63 64 45 44 79 WeEy9t4XgPxcdEDy
0030: 6f 30 36 79 50 43 53 42 6c 34 72 75 34 o06yPCSBl4ru4
Invoking releaseStream
RTMP_SendPacket: fd=5, size=57
0000: 43 00 00 00 00 00 39 14 C.....9.
0000: 02 00 09 46 43 50 75 62 6c 69 73 68 00 40 08 00 ...FCPublish.@..
0010: 00 00 00 00 00 05 02 00 20 5a 6e 67 57 65 45 79 ........ ZngWeEy
0020: 39 74 34 58 67 50 78 63 64 45 44 79 6f 30 36 79 9t4XgPxcdEDyo06y
0030: 50 43 53 42 6c 34 72 75 34 PCSBl4ru4
Invoking FCPublish
RTMP_SendPacket: fd=5, size=25
0000: 43 00 00 00 00 00 19 14 C.......
0000: 02 00 0c 63 72 65 61 74 65 53 74 72 65 61 6d 00 ...createStream.
0010: 40 10 00 00 00 00 00 00 05 @........
Invoking createStream
RTMP_ReadPacket: fd=5
0000: 03 00 00 00 00 00 15 14 00 00 00 00 ............
0000: 02 00 07 5f 72 65 73 75 6c 74 00 40 00 00 00 00 ..._result.@....
0010: 00 00 00 05 06 .....
RTMP_ClientPacket, received: invoke 21 bytes
(object begin)
Property:
Property:
Property: NULL
Property: NULL
(object end)
HandleInvoke, server invoking
HandleInvoke, received result id 2.000000 without matching request
RTMP_ReadPacket: fd=5
0000: 03 00 00 00 00 00 15 14 00 00 00 00 ............
0000: 02 00 07 5f 72 65 73 75 6c 74 00 40 08 00 00 00 ..._result.@....
0010: 00 00 00 05 06 .....
RTMP_ClientPacket, received: invoke 21 bytes
(object begin)
Property:
Property:
Property: NULL
Property: NULL
(object end)
HandleInvoke, server invoking
HandleInvoke, received result id 3.000000 without matching request
RTMP_ReadPacket: fd=5
0000: 03 00 00 00 00 00 1d 14 00 00 00 00 ............
0000: 02 00 07 5f 72 65 73 75 6c 74 00 40 10 00 00 00 ..._result.@....
0010: 00 00 00 05 00 3f f0 00 00 00 00 00 00 .....?.......
RTMP_ClientPacket, received: invoke 29 bytes
(object begin)
Property:
Property:
Property: NULL
Property:
(object end)
HandleInvoke, server invoking
HandleInvoke, received result for method call
RTMP_SendPacket: fd=5, size=62
0000: 04 00 00 00 00 00 3e 14 01 00 00 00 ......>.....
0000: 02 00 07 70 75 62 6c 69 73 68 00 40 14 00 00 00 ...publish.@....
0010: 00 00 00 05 02 00 20 5a 6e 67 57 65 45 79 39 74 ...... ZngWeEy9t
0020: 34 58 67 50 78 63 64 45 44 79 6f 30 36 79 50 43 4XgPxcdEDyo06yPC
0030: 53 42 6c 34 72 75 34 02 00 04 6c 69 76 65 SBl4ru4...live
Invoking publish
RTMP_ReadPacket: fd=5
0000: 02 00 00 00 00 00 06 04 00 00 00 00 ............
0000: 00 06 34 0b 98 14 ..4...
HandleCtrl, received ctrl. type: 6, len: 6
HandleCtrl, Ping 873175060
sending ctrl. type: 0x0007
RTMP_SendPacket: fd=5, size=6
0000: 42 00 00 00 00 00 06 04 B.......
0000: 00 07 34 0b 98 14 ..4...
RTMP_ReadPacket: fd=5
0000: 03 00 00 00 00 00 8f 14 00 00 00 00 ............
0000: 02 00 0a 6d 6f 64 75 6c 65 49 6e 66 6f 00 00 00 ...moduleInfo...
0010: 00 00 00 00 00 00 05 03 00 04 6d 65 74 61 03 00 ..........meta..
0020: 0f 62 72 6f 61 64 63 61 73 74 65 72 54 79 70 65 .broadcasterType
0030: 02 00 03 66 6d 65 00 04 74 61 67 73 0a 00 00 00 ...fme..tags....
0040: 01 02 00 05 65 73 73 61 69 00 05 74 69 74 6c 65 ....essai..title
0050: 02 00 08 6c 69 6e 64 6f 6d 31 33 00 03 75 72 6c ...lindom13..url
0060: 02 00 26 68 74 74 70 3a 2f 2f 77 77 77 2e 75 73 ..&http://www.us
0070: 74 72 65 61 6d 2e 74 76 2f 63 68 61 6e 6e 65 6c tream.tv/channel
RTMP_ReadPacket: fd=5
0000: c3 .
0000: 2f 6c 69 6e 64 6f 6d 31 33 00 00 09 00 00 09 /lindom13......
RTMP_ClientPacket, received: invoke 143 bytes
(object begin)
Property:
Property:
Property: NULL
Property:
(object begin)
Property:
(object begin)
Property:
Property:
(object begin)
Property:
(object end)
Property:
Property:
(object end)
(object end)
(object end)
HandleInvoke, server invoking
RTMP_ReadPacket: fd=5
0000: 02 00 00 00 00 00 06 04 00 00 00 00 ............
0000: 00 00 00 00 00 01 ......
HandleCtrl, received ctrl. type: 0, len: 6
HandleCtrl, Stream Begin 1
RTMP_ReadPacket: fd=5
0000: 04 00 00 00 00 00 a0 14 01 00 00 00 ............
0000: 02 00 08 6f 6e 53 74 61 74 75 73 00 40 14 00 00 ...onStatus.@...
0010: 00 00 00 00 05 03 00 05 6c 65 76 65 6c 02 00 06 ........level...
0020: 73 74 61 74 75 73 00 04 63 6f 64 65 02 00 17 4e status..code...N
0030: 65 74 53 74 72 65 61 6d 2e 50 75 62 6c 69 73 68 etStream.Publish
0040: 2e 53 74 61 72 74 00 0b 64 65 73 63 72 69 70 74 .Start..descript
0050: 69 6f 6e 02 00 32 5a 6e 67 57 65 45 79 39 74 34 ion..2ZngWeEy9t4
0060: 58 67 50 78 63 64 45 44 79 6f 30 36 79 50 43 53 XgPxcdEDyo06yPCS
0070: 42 6c 34 72 75 34 20 69 73 20 6e 6f 77 20 70 75 Bl4ru4 is now pu
RTMP_ReadPacket: fd=5
0000: c4 .
0000: 62 6c 69 73 68 65 64 2e 00 08 63 6c 69 65 6e 74 blished...client
0010: 69 64 02 00 08 54 54 71 77 32 77 33 36 00 00 09 id...TTqw2w36...
RTMP_ClientPacket, received: invoke 160 bytes
(object begin)
Property:
Property:
Property: NULL
Property:
(object begin)
Property:
Property:
Property:
Property:
(object end)
(object end)
HandleInvoke, server invoking
HandleInvoke, onStatus: NetStream.Publish.Start
[buffer @ 0x21adbe0] w:320 h:240 pixfmt:yuv420p tb:1/1000000 sar:0/1 sws_param:
[mpeg4 @ 0x21cf680] err{or,}_recognition separate: 1; 1
[mpeg4 @ 0x21cf680] err{or,}_recognition combined: 1; 10001
[mpeg4 @ 0x21cf680] detected 2 logical cores
[mpeg4 @ 0x21cf680] intra_quant_bias = 0 inter_quant_bias = -64
[mpeg4 @ 0x21cf680] Unsupported bit depth: 0
[rawvideo @ 0x21ce1c0] err{or,}_recognition separate: 1; 10001
[rawvideo @ 0x21ce1c0] err{or,}_recognition combined: 1; 10001
Output #0, avi, to 'rtmp://1.11645395.fme.ustream.tv/ustreamVideo/11645395/ZngWeEy9t4XgPxcdEDyo06yPCSBl4ru4 flashver=FME/2.5\20(compatible;\20FMSc\201.0)':
Metadata:
ISFT : Lavf53.32.100
Stream #0:0, 0, 1/30: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 320x240, 1/30, q=2-31, 200 kb/s, 30 tbn, 30 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo -> mpeg4)
Press [q] to stop, [?] for help
*** drop!
Last message repeated 20 times
*** drop!25 fps= 0 q=2.2 size= 57kB time=00:00:02.86 bitrate= 162.0kbits/s dup=0 drop=21
Last message repeated 15 times
*** drop!25 fps= 24 q=2.2 size= 57kB time=00:00:02.86 bitrate= 162.0kbits/s dup=0 drop=37
*** drop!19 fps= 30 q=2.6 size= 635kB time=00:00:19.33 bitrate= 269.2kbits/s dup=0 drop=38
frame= 840 fps= 30 q=2.5 Lsize= 952kB time=00:00:30.03 bitrate= 259.6kbits/s dup=0 drop=39
video:943kB audio:0kB global headers:0kB muxing overhead 0.921590%
RTMP_SendPacket: fd=5, size=59
0000: 43 00 00 00 00 00 3b 14 C.....;.
0000: 02 00 0b 46 43 55 6e 70 75 62 6c 69 73 68 00 40 ...FCUnpublish.@
0010: 18 00 00 00 00 00 00 05 02 00 20 5a 6e 67 57 65 .......... ZngWe
0020: 45 79 39 74 34 58 67 50 78 63 64 45 44 79 6f 30 Ey9t4XgPxcdEDyo0
0030: 36 79 50 43 53 42 6c 34 72 75 34 6yPCSBl4ru4
Invoking FCUnpublish
RTMP_SendPacket: fd=5, size=34
0000: 43 00 00 00 00 00 22 14 C.....".
0000: 02 00 0c 64 65 6c 65 74 65 53 74 72 65 61 6d 00 ...deleteStream.
0010: 40 1c 00 00 00 00 00 00 05 00 3f f0 00 00 00 00 @.........?.....
0020: 00 00 ..
Invoking deleteStream -
-
OK I finally found the solution : just replace "-f avi" by "-f flv" :)
Now what are the options of bitrate and other quality aspect I can put?
in other words what are the quality limitations for the ustream free account?
Thanks -
-
lindom13,
What resolutions does your webcam support? I would start with those. You could something in the 500-900 kbps range. -
-
My actual webcam is supporting 640x480 at at least 25fps and higher resolutions but with less fluid images.
So I want to use it at 640x480
I plan also to use a logitech C615, supporting HD.
Ustream limits the bandwith for free subscription, isn't it?
So for both cameras what would be the best quality available? For example like the best quality that Ustream Producer offers?
Thanks
David -
-
David,
Limitations would depend on the encoder you use:
I am not aware of any limits when you encode in ffmpeg. I do not have a copy up and running to test with though.
If you are using Producer (free) to encode you are limited to 640X360. If you want to go HD in Producer you will need Producer Pro. -
-
Generally I can stream OK to USTREAM with the latest ffmpeg (RTMP/Flash/x264/AAC), but
1) sometimes RTMP connection unexpectedly drops, with "No more output streams to write to, finishing." diagnostic in verbose mode... maybe it's a network issue - I still checking...
2) quite often USTREAM's embedded ads "freeze" the encoding process :((( When advertising time has comes - ffmpeg stops encoding and does not send video to USTREAM (I see it from network activity). It has to be cancelled by Ctrl+C then it restarts, connects and work fine .... until next ad. However ads don't stop encoding... but quite often they do...
# uname -a
Linux hostname 3.2.0-30-generic-pae #48-Ubuntu SMP Fri Aug 24 17:14:09 UTC 2012 i686 i686 i386 GNU/Linux
# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"
----
ffmpeg version git-2012-09-15-c3c646a Copyright (c) 2000-2012 the FFmpeg developers
built on Sep 14 2012 19:44:00 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-nonfree --enable-version3 --enable-libvo-aacenc --enable-pthreads
libavutil 51. 73.100 / 51. 73.100
libavcodec 54. 56.100 / 54. 56.100
libavformat 54. 27.100 / 54. 27.100
libavdevice 54. 2.100 / 54. 2.100
libavfilter 3. 16.104 / 3. 16.104
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
--- -
Loading Profile...


EMPLOYEE
