creating a grid like Zoom

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

creating a grid like Zoom

Michael Glenn Williams
Hi All,

We tried following the examples of making grids when reading live streams
liek this:
https://www.reddit.com/r/ffmpeg/comments/aimdx9/ffserver_video_grid_source_ffserver_http_ts/

With the example:
$ ffmpeg -i '
http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4'
-i '
http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4'
-i '
http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4'
-i '
http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4'
-filter_complex
"nullsrc=size=640x480[base];[0:v]scale=320x240[upperleft];[1:v]scale=320x240[upperright];[2:v]scale=320x240[lowerleft];[3:v]scale=320x240[lowerright];[base][upperleft]overlay[tmp1];[tmp1][upperright]overlay=x=320[tmp2];[tmp2][lowerleft]overlay=y=240[tmp3];[tmp3][lowerright]overlay=x=320:y=240"
-an -dn -sn -c:v "libx264" -crf "23" -preset "faster" -f "mpegts" udp://
239.0.0.1:1234

We wrote the output into a file output.mkv for testing. However when we
playback the file it has a terrible flickering, see this output sample:
https://www.dropbox.com/s/58gj99u0ezplscw/output.mkv?dl=0

Any thoughts on what we are doing wrong?

The actual bash code is something like this:
FFMPEG='ffmpeg -y'
for (( p=1; p<=$PIPES; p++ ))
do
 FFMPEG="$FFMPEG -f rawvideo -video_size ${WIDTH}x${HEIGHT} -pix_fmt bgr24
-i unix://tmp/CoreFxPipe_VideoPipe$p"
done

FFMPEG="$FFMPEG -filter_complex \"nullsrc=size=${FULLWIDTH}x${FULLHEIGHT}
[background]"

LAST="background"
VY=$(($HEIGHT*-1))
for (( p=0; p<$PIPES; p++ ))
do
 OFFX=$(($p%$X))
 if [ $OFFX -eq 0 ]
 then
    VY=$(($VY+$HEIGHT+1))
 fi
 VX=$(($OFFX*$WIDTH))
 if [ $p -eq $(($PIPES-1)) ]
 then
    FFMPEG="$FFMPEG [${LAST}][$p:v] overlay=shortest=1:x=$VX"
 else
    FFMPEG="$FFMPEG [${LAST}][$p:v] overlay=shortest=1:x=$VX [$LAST+v$p];"
 fi

 LAST="$LAST+v$p"
done

FFMPEG="$FFMPEG\" output.mkv &"



--
<https://meetings.hubspot.com/michael-glenn-williams> Michael Williams

CEO | CTO

Smart Blonde Experiential
8054991994
[hidden email]
totalvu.tv
13900 Marquesas Way, Marina Del Rey, CA
<http://totalvu.tv>
[image: facebook]
<https://www.facebook.com/boldstream/app/128953167177144/> [image:
twitter] <https://twitter.com/smartblondecorp> [image: linkedin]
<https://www.linkedin.com/in/michaelglennwilliams/>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: creating a grid like Zoom

Moritz Barsnick
Hi Michael,

On Tue, May 19, 2020 at 10:25:17 -0700, Michael Glenn Williams wrote:
> We tried following the examples of making grids when reading live streams
> liek this:
> https://www.reddit.com/r/ffmpeg/comments/aimdx9/ffserver_video_grid_source_ffserver_http_ts/
>
> With the example:

Using that example works fine for you, right? It does for me. (I would
probably simplify the example using the "scale2ref", "hstack" and
"vstack" filters, but that's not the point.)

> We wrote the output into a file output.mkv for testing. However when we
> playback the file it has a terrible flickering, see this output sample:
> https://www.dropbox.com/s/58gj99u0ezplscw/output.mkv?dl=0

Oh, indeed.

> Any thoughts on what we are doing wrong?

Yes, but first:

> The actual bash code is something like this:

Though I can read bash, could you kindly provide us the actual
resulting command line (perhaps extracted using "bash -x"), and
ffmpeg's complete, uncut console output?

I do have a suspicion: Your framerates (or image timings), and perhaps
your resolutions, don't align very well. We may see from the output
log. Perhaps we can recommend some additional options or filters to
add.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".