As I may have stated in previous issues, I have "constructed" a `gpac` command that takes an RTMP stream as input and generates multiple LL-HLS qualities from it.

Here is the command for one quality specifically:
```
gpac ffdmx:src=rtmp://server/live/key:gpac:analyzeduration=10M:probesize=10M:fflags=genpts reframer:rt=on ffsws:osize=1280x720:keepar=nosrc c=libx264:b=2000k:profile=baseline:level=3.2:preset=fast:maxrate=2400k:bufsize=3600k:fintra=1001/1000:FID=VENC720 c=aac:b=96k:FID=AENC720 -o 720p/index.m3u8:segdur=2:cdur=0.5:asto=0.25:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC720,AENC720
```

Here is for multiple qualities at once:
```
 gpac ffdmx:src=rtmp://server/live/key:gpac:analyzeduration=10M:probesize=10M:fflags=genpts \
 @@ ffsws:osize=1920x1080:keepar=nosrc \
 @ c=libx264:b=5500k:profile=main:level=3.0:preset=fast:maxrate=6600k:bufsize=9900k:fintra=0.5:FID=VENC1080 \
 @@ c=aac:b=96k:fintra=0.5:FID=AENC1080 \
 -o 1080p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC1080,AENC1080 \
 @@ ffsws:osize=1280x720:keepar=nosrc \
 @ c=libx264:b=2000k:profile=baseline:level=3.0:preset=fast:maxrate=2400k:bufsize=3600k:fintra=0.5:FID=VENC720 \
 @@ c=aac:b=96k:fintra=0.5:FID=AENC720 \
 -o 720p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC720,AENC720 \
 @@ ffsws:osize=854x480:keepar=nosrc \
 @ c=libx264:b=985k:profile=baseline:level=3.0:preset=fast:maxrate=1182k:bufsize=1773k:fintra=0.5:FID=VENC480 \
 @@ c=aac:b=96k:fintra=0.5:FID=AENC480 \
 -o 480p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC480,AENC480 \
 @@ ffsws:osize=640x360:keepar=nosrc \
 @ c=libx264:b=486k:profile=baseline:level=3.0:preset=fast:maxrate=583k:bufsize=874k:fintra=0.5:FID=VENC360 \
 @@ c=aac:b=40k:fintra=0.5:FID=AENC360 \
 -o 360p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC360,AENC360 \
 @@ ffsws:osize=426x240:keepar=nosrc \
 @ c=libx264:b=216k:profile=baseline:level=3.0:preset=fast:maxrate=259k:bufsize=388k:fintra=0.5:FID=VENC240 \
 @@ c=aac:b=40k:fintra=0.5:FID=AENC240 \
 -o 240p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC240,AENC240 \
 @@ ffsws:osize=256x144:keepar=nosrc \
 @ c=libx264:b=126k:profile=main:level=3.0:preset=fast:maxrate=151k:bufsize=226k:fintra=0.5:FID=VENC144 \
 @@ c=aac:b=40k:fintra=0.5:FID=AENC144 \
 -o 144p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:hlsc=true:template='index_$Number%07d$':muxtype=ts:SID=VENC144,AENC144
 ```
 
 Both commands seem to work fine, but I am facing some issues when I process the stream in a kubernetes pod.
 I have to launch one pod for each quality otherwise the output playback won't be smooth, but even when I split each quality in a specific pod, I'm still facing lag issues qualities >= 720p.
 
 Is there room for optimization in this command, if so: How can I optimize it? - Preferably one and multiple qualities
GPAC command - Optimization 
This is a GitHub Issue
repo:gpac
owner:gpac
Title : GPAC command - Optimization 
Issue date:

--- start body ---
As I may have stated in previous issues, I have "constructed" a `gpac` command that takes an RTMP stream as input and generates multiple LL-HLS qualities from it.

Here is the command for one quality specifically:
```
gpac ffdmx:src=rtmp://server/live/key:gpac:analyzeduration=10M:probesize=10M:fflags=genpts reframer:rt=on ffsws:osize=1280x720:keepar=nosrc c=libx264:b=2000k:profile=baseline:level=3.2:preset=fast:maxrate=2400k:bufsize=3600k:fintra=1001/1000:FID=VENC720 c=aac:b=96k:FID=AENC720 -o 720p/index.m3u8:segdur=2:cdur=0.5:asto=0.25:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC720,AENC720
```

Here is for multiple qualities at once:
```
 gpac ffdmx:src=rtmp://server/live/key:gpac:analyzeduration=10M:probesize=10M:fflags=genpts \
 @@ ffsws:osize=1920x1080:keepar=nosrc \
 @ c=libx264:b=5500k:profile=main:level=3.0:preset=fast:maxrate=6600k:bufsize=9900k:fintra=0.5:FID=VENC1080 \
 @@ c=aac:b=96k:fintra=0.5:FID=AENC1080 \
 -o 1080p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC1080,AENC1080 \
 @@ ffsws:osize=1280x720:keepar=nosrc \
 @ c=libx264:b=2000k:profile=baseline:level=3.0:preset=fast:maxrate=2400k:bufsize=3600k:fintra=0.5:FID=VENC720 \
 @@ c=aac:b=96k:fintra=0.5:FID=AENC720 \
 -o 720p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC720,AENC720 \
 @@ ffsws:osize=854x480:keepar=nosrc \
 @ c=libx264:b=985k:profile=baseline:level=3.0:preset=fast:maxrate=1182k:bufsize=1773k:fintra=0.5:FID=VENC480 \
 @@ c=aac:b=96k:fintra=0.5:FID=AENC480 \
 -o 480p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC480,AENC480 \
 @@ ffsws:osize=640x360:keepar=nosrc \
 @ c=libx264:b=486k:profile=baseline:level=3.0:preset=fast:maxrate=583k:bufsize=874k:fintra=0.5:FID=VENC360 \
 @@ c=aac:b=40k:fintra=0.5:FID=AENC360 \
 -o 360p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC360,AENC360 \
 @@ ffsws:osize=426x240:keepar=nosrc \
 @ c=libx264:b=216k:profile=baseline:level=3.0:preset=fast:maxrate=259k:bufsize=388k:fintra=0.5:FID=VENC240 \
 @@ c=aac:b=40k:fintra=0.5:FID=AENC240 \
 -o 240p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:muxtype=ts:hlsc=true:template='index_$Number%07d$':SID=VENC240,AENC240 \
 @@ ffsws:osize=256x144:keepar=nosrc \
 @ c=libx264:b=126k:profile=main:level=3.0:preset=fast:maxrate=151k:bufsize=226k:fintra=0.5:FID=VENC144 \
 @@ c=aac:b=40k:fintra=0.5:FID=AENC144 \
 -o 144p/index.m3u8:segdur=2:cdur=0.5:profile=live:dmode=dynamic:llhls=sf:hlsc=true:template='index_$Number%07d$':muxtype=ts:SID=VENC144,AENC144
 ```
 
 Both commands seem to work fine, but I am facing some issues when I process the stream in a kubernetes pod.
 I have to launch one pod for each quality otherwise the output playback won't be smooth, but even when I split each quality in a specific pod, I'm still facing lag issues qualities >= 720p.
 
 Is there room for optimization in this command, if so: How can I optimize it? - Preferably one and multiple qualities
--- end body ---
