[FFmpeg-user] Setting ffmpeg duration to indefinite?

Cory J. Geesaman cory at geesaman.com
Tue Mar 19 12:19:53 CET 2013


I'm trying to use ffmpeg to process some live streams and send the output to
an ffserver feed but am running into issues.

 

I have 16  of these:

 

<Feed 0.ffm>

File /tmp/0.ffm

FileMaxSize 5M

ACL allow 10.1.2.2

</Feed>

<Feed 0_webm.ffm>

File /tmp/0_webm.ffm

FileMaxSize 5M

ACL allow localhost

</Feed>

 

<Stream 0.mpg>

Feed 0.ffm

Format mpeg1video

NoAudio

VideoFrameRate 29.97

VideoBitRate 512K

VideoSize 320x240

VideoBufferSize 40

VideoGopSize 12

</Stream>

 

<Stream 0.webm>

Feed 0_webm.ffm

Format webm

NoAudio

VideoCodec libvpx

VideoSize 320x240

VideoFrameRate 29.97

AVOptionVideo flags +global_header

AVOptionVideo cpu-used 0

AVOptionVideo quality good

PreRoll 0

StartSendOnKey

VideoGopSize 12

VideoBitRate 256

</Stream>

 

Driven by the following two ffmpeg processes built into upstart daemons (the
first one is on a different machine):

 

ffmpeg -f video4linux2 -standard ntsc -i /dev/video0
http://10.1.2.1:8090/0.ffm

ffmpeg -f mpegvideo -i http://localhost:8090/0.mpg -vcodec libvpx
http://localhost:8090/0_webm.ffm

 

And that works great to get a live .webm stream for each channel, however
when I attempt to combine them into this:

 

<Feed all_webm.ffm>

File /tmp/all_webm.ffm

FileMaxSize 20M

ACL allow localhost

</Feed>

 

<Stream all.webm>

Feed all_webm.ffm

Format webm

NoAudio

VideoCodec libvpx

VideoSize 1280x960

VideoFrameRate 24

AVOptionVideo flags +global_header

AVOptionVideo cpu-used 0

AVOptionVideo qmin [1|10]

AVOptionVideo qmax [31|42]

AVOptionVideo quality good

PreRoll 0

StartSendOnKey

VideoBitRate [512|700|800|1024|3M|3686400]

</Stream>

 

With this upstart-daemon ffmpeg instance:

 

ffmpeg -i http://localhost:8090/0.webm -i http://localhost:8090/1.webm -i
http://localhost:8090/2.webm -i http://localhost:8090/3.webm -i
http://localhost:8090/4.webm -i http://localhost:8090/5.webm -i
http://localhost:8090/6.webm -i http://localhost:8090/7.webm -i
http://localhost:8090/8.webm -i http://localhost:8090/9.webm -i
http://localhost:8090/10.webm -i http://localhost:8090/11.webm -i
http://localhost:8090/12.webm -i http://localhost:8090/13.webm -i
http://localhost:8090/14.webm -i http://localhost:8090/15.webm
-filter_complex "

nullsrc=size=1280x960 [bg];

[0:v] setpts=PTS-STARTPTS [v0];

[1:v] setpts=PTS-STARTPTS [v1];

[2:v] setpts=PTS-STARTPTS [v2];

[3:v] setpts=PTS-STARTPTS [v3];

[4:v] setpts=PTS-STARTPTS [v4];

[5:v] setpts=PTS-STARTPTS [v5];

[6:v] setpts=PTS-STARTPTS [v6];

[7:v] setpts=PTS-STARTPTS [v7];

[8:v] setpts=PTS-STARTPTS [v8];

[9:v] setpts=PTS-STARTPTS [v9];

[10:v] setpts=PTS-STARTPTS [v10];

[11:v] setpts=PTS-STARTPTS [v11];

[12:v] setpts=PTS-STARTPTS [v12];

[13:v] setpts=PTS-STARTPTS [v13];

[14:v] setpts=PTS-STARTPTS [v14];

[15:v] setpts=PTS-STARTPTS [v15];

[bg][v0] overlay=shortest=1 [bg];

[bg][v1] overlay=shortest=1:x=320 [bg];

[bg][v2] overlay=shortest=1:x=640 [bg];

[bg][v3] overlay=shortest=1:x=960 [bg];

[bg][v4] overlay=shortest=1:y=240 [bg];

[bg][v5] overlay=shortest=1:x=320:y=240 [bg];

[bg][v6] overlay=shortest=1:x=640:y=240 [bg];

[bg][v7] overlay=shortest=1:x=960:y=240 [bg];

[bg][v8] overlay=shortest=1:y=480 [bg];[bg]

[v9] overlay=shortest=1:x=320:y=480 [bg];

[bg][v10] overlay=shortest=1:x=640:y=480 [bg];

[bg][v11] overlay=shortest=1:x=960:y=480 [bg];

[bg][v12] overlay=shortest=1:y=720 [bg];

[bg][v13] overlay=shortest=1:x=320:y=720 [bg];

[bg][v14] overlay=shortest=1:x=640:y=720 [bg];

[bg][v15] overlay=shortest=1:x=960:y=720" http://localhost:8090/all_webm.ffm

 

The stream all.webm is not viewable (but it works if I save it to a local
file then play it back).  I'd like to use this to get a 4x4 grid of live
streams to be restreamed (chrome has a limit of 5-6 .webm's playing at once,
ideally there would be a way around that, but if not I have to go with
combining them on the server-side and just streaming 1 video out at a time
per client looking at the overview rather than 16 - alternatively if someone
knows a way around the chrome issue that would help).



More information about the ffmpeg-user mailing list