[FFmpeg-user] creating a grid like Zoom

Michael Glenn Williams michael.glenn.williams at smartblondeco.com
Tue May 19 20:25:17 EEST 2020


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
michael.glenn.williams at smartblondeco.com
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/>


More information about the ffmpeg-user mailing list