FAQ  •  Register  •  Login

[Solved] IP Cam stream and ffmpeg parameters

<<

Venom

Serviio newbie

Posts: 8

Joined: Wed Mar 20, 2013 3:29 pm

Location: Milan, IT

Post Thu Mar 21, 2013 2:42 pm

[Solved] IP Cam stream and ffmpeg parameters

Hi there!

I'm trying to use as Online Source an IP Cam stream (a DLink DCS-932L).
I found the right URL for the streaming but ffmpeg is not able to identify the format.

With the -f parameter set to mjpeg, ffmpeg works.
I think I need to change the parameters passed to ffmpeg by Serviio, but under Windows environment, I haven't found any tip.

Could you help me?

Thank you all!
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Mar 21, 2013 10:05 pm

Re: IP Cam stream and ffmpeg parameters

can you give an example of the ffmpeg command you're talking about?
<<

Venom

Serviio newbie

Posts: 8

Joined: Wed Mar 20, 2013 3:29 pm

Location: Milan, IT

Post Fri Mar 22, 2013 9:39 am

Re: IP Cam stream and ffmpeg parameters

Sure.
First of all: I use a Win 2008 Server environment, commands are from cmd, redirected to log file.

Command:
c:\[Serviio folder]\lib>ffmpeg.exe -i "http://[user]:[password]@[ipaddress]/video/mjpg.cgi?resolution=VGA"

STDERR:
ffmpeg version 1.1.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Feb 5 2013 21:59:54 with gcc 4.7.2 (GCC)
configuration: --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --enable-libass --enable-librtmp --enable-fontconfig --enable-libfreetype --enable-zlib --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm -lexpat -lfreetype -lfribidi -lz' --arch=x86 --enable-runtime-cpudetect --enable-pthreads --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --pkg-config=pkg-config
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 86.100 / 54. 86.100
libavformat 54. 59.106 / 54. 59.106
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
[loas @ 02725AE0] Format loas detected only with low score of 1, misdetection possible!
[loas @ 02725AE0] Stream #0: not enough frames to estimate rate; consider increasing probesize
[loas @ 02725AE0] decoding for stream 0 failed
[loas @ 02725AE0] Could not find codec parameters for stream 0 (Audio: aac_latm, 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[loas @ 02725AE0] Estimating duration from bitrate, this may be inaccurate
http://[user]:[password]@[ipaddress]/video/mjpg.cgi?resolution=VGA: could not find codec parameters

What I understand is that ffmpeg is unable to detect the stream format.
In fact, if I use the -f parameter to force it, I obtain:

Command:
c:\[Serviio folder]\lib>ffmpeg.exe -f mjpeg -i "http://[user]:[password]@[ipaddress]/video/mjpg.cgi?resolution=VGA"

STDERR:
ffmpeg version 1.1.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Feb 5 2013 21:59:54 with gcc 4.7.2 (GCC)
configuration: --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --enable-libass --enable-librtmp --enable-fontconfig --enable-libfreetype --enable-zlib --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm -lexpat -lfreetype -lfribidi -lz' --arch=x86 --enable-runtime-cpudetect --enable-pthreads --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --pkg-config=pkg-config
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 86.100 / 54. 86.100
libavformat 54. 59.106 / 54. 59.106
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
[mjpeg @ 02B35B20] max_analyze_duration 5000000 reached at 5000000
[mjpeg @ 02B35B20] Estimating duration from bitrate, this may be inaccurate
Input #0, mjpeg, from 'http://[user]:[password]@[ipaddress]/video/mjpg.cgi?resolution=VGA':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj422p, 640x480, 25 fps, 25 tbr, 1200k tbn, 25 tbc
At least one output file must be specified

So, I think I need to force this parameter in Serviio call.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Mar 22, 2013 4:10 pm

Re: IP Cam stream and ffmpeg parameters

what if you provide the analyzeduration parameter with a high value instead?
<<

Venom

Serviio newbie

Posts: 8

Joined: Wed Mar 20, 2013 3:29 pm

Location: Milan, IT

Post Fri Mar 22, 2013 5:48 pm

Re: IP Cam stream and ffmpeg parameters

I don't know how to increase analyzeduration, ffmpeg is a new software to me, but I can search for it.

Anyway, I think there's no need: in the meantime, good news.
Instead of trying direct connection to the ip camera, I found the video streamed by monitoring software I have installed.
Since this software lacks of DLNA capabilities, here's why I need Serviio on my W2K8 Server.

The stream is working on ffmpeg:
ffmpeg -i http://[user]:[password]@[ipaddress]:[port]/mjpg/salone/video.mjpg

Returns:
ffmpeg version 1.1.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Feb 5 2013 21:59:54 with gcc 4.7.2 (GCC)
configuration: --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --enable-libass --enable-librtmp --enable-fontconfig --enable-libfreetype --enable-zlib --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm -lexpat -lfreetype -lfribidi -lz' --arch=x86 --enable-runtime-cpudetect --enable-pthreads --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --pkg-config=pkg-config
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 86.100 / 54. 86.100
libavformat 54. 59.106 / 54. 59.106
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
[mjpeg @ 03405AE0] Estimating duration from bitrate, this may be inaccurate
Input #0, mjpeg, from 'http://[user]:[password]@[ipaddress]:[port]/mjpg/salone/video.mjpg':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p, 640x480 [SAR 96:96 DAR 4:3], 25 fps, 25 tbr, 1200k tbn, 25 tbc
At least one output file must be specified

So, it seems to me that it's working, isn't it?
Furthermore, in VLC the same link is working perfectly, showing the video.

But in Serviio the Check stream URL keeps showing the red X and from two DLNA clients (Samsung TV and VLC) there is not any online content.
<<

Venom

Serviio newbie

Posts: 8

Joined: Wed Mar 20, 2013 3:29 pm

Location: Milan, IT

Post Sat Mar 23, 2013 11:12 am

Re: IP Cam stream and ffmpeg parameters

Some other info.

Added as Live Stream, in Serviio log file I find:
[FeedUpdaterThread] Failed to retrieve online item information for http://[user]:[password]@[ipaddress]:[port]/mjpg/salone/video.mjpg. It might not play.

Added as Web Resource I find:
Cannot parse resource from http://[user]:[password]@[ipaddress]:[port]/mjpg/salone/video.mjpg. Message: No plugin for web resource http://[user]:[password]@[ipaddress]:[port]/mjpg/salone/video.mjpg has been found.

Anyway, ffmpeg -i keeps getting information, I don't know if enough, but the url is readeble in VLC and also in Firefox.
Should I try create a plugin for this particular kind of url?

Just for information, the software from which I'm getting this mjpg stream is Blue Iris 3.

PS - sorry for my English ;)
<<

Venom

Serviio newbie

Posts: 8

Joined: Wed Mar 20, 2013 3:29 pm

Location: Milan, IT

Post Sat Mar 23, 2013 3:32 pm

Re: IP Cam stream and ffmpeg parameters

SOLVED.

The security software is capable of various webcasting formats.
From the point of view of ffmpeg, the difference between the working one and the others is the Metadata presence.

With MPEG-2 transport stream (MIME type video/MP2T), ffmpeg -i [streamurl] returns the Metadata too.
Green check in Serviio console and streaming (audio and video) on my TV.

Perfect!

Hope this will help others.
<<

Albertohv

Serviio newbie

Posts: 2

Joined: Tue Mar 18, 2014 9:12 pm

Post Tue Mar 18, 2014 9:17 pm

Re: [Solved] IP Cam stream and ffmpeg parameters

Hi,
After see this topic and after several days checking for other similar topics in other forums, finally I got to see the IPCamera in the TV and in XBMC by Serviio. (I can not see yet in my Philips TVs, (7007,4508, 5407, looks like the format is not supported)
I would like to write more clear how to make this, since the instrucction given here was not clearl at least for me, and made me mad several days until I found clear solution.

1. Is used the software Blu Iris 3 for to get the streaming from the IP Camera. This software has a "webcast" service that is working as a streaming service. That is simple to configurate just ussing the own instructions in the help menu. Just marking enable "JPEG,MJPEG,H.264, web/mobile streaming" in the tab webcast of camera properties.
2. in the online feeds on serviio, add a new online feed: life stream, URL: http://[URL of your server:Port]/h264/[ShortName of IPCamera from Blue Iris]/temp.ts (in my case: http://192.168.1.2:81/h264/trast/temp.ts)

I tried to write with the "ffmpeg -i" in front, but doesnt work.

By now with this is working, as I said in the XBMC by now, and following the previous in samsung TV too.
With serviigo in android device also can see, just with a delay of around 10 sec.

I find a trouble in XBMC, after open the onlinefeed is in pause, need to push play for start to see the stream and cause a little delay too, I havent idea why is happening this.

If some one need, I hope this can be clear about how to do, and sorry for my english, I try my best.

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 54 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.