need help in reducing the stream start latency in a network enviroment

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

need help in reducing the stream start latency in a network enviroment

Ratheendran R
Hi All,

I am wrote an app which reads elementary streams of encoded audio/video and
mux them into mpegts stream subsequently write to unix domain socket as
client, an Unix socket  server app using  libwebsocket takes this streams
and send it to websocket server.

Now this works as expected, currently mpegts stream start latency is ~ 10
sec.


Also this is an embedded system use case and encoding happens through
hardware accelarators on soc fixed properties.I would like to know if we
can further  reduce the size of library and bypass redundant task like
probe and parsing metadata of mpegts streams.

options used for configuring ffmpeg
--enable-decoder=h264  --enable-decoder=aac --enable-bsf=h264_mp4toannexb
---enable-muxer=mpegts --enable-protocol=unix

can any one in the forum share their experience on fixing the high latency
on mpegts streaming.

Thanks,
Ratheendran
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://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
|  
Report Content as Inappropriate

Re: need help in reducing the stream start latency in a network enviroment

Moritz Barsnick
On Wed, May 31, 2017 at 19:41:00 +0530, Ratheendran R wrote:
> Also this is an embedded system use case and encoding happens through
> hardware accelarators on soc fixed properties.I would like to know if we
> can further  reduce the size of library and bypass redundant task like
> probe and parsing metadata of mpegts streams.

Then please be so kind and show us what you have been doing so far,
otherwise it's hard to say where to improve. The full command line, and
complete, uncut console output.

> options used for configuring ffmpeg
> --enable-decoder=h264  --enable-decoder=aac --enable-bsf=h264_mp4toannexb
> ---enable-muxer=mpegts --enable-protocol=unix

This won't make your binary/library smaller, unless you actually
disabled something first.

> can any one in the forum share their experience on fixing the high latency
> on mpegts streaming.

People have already shared a bit:
https://trac.ffmpeg.org/wiki/StreamingGuide#Latency

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://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
|  
Report Content as Inappropriate

Re: need help in reducing the stream start latency in a network enviroment

Ratheendran R
Thanks Mortiz for your attending my query.

On Thu, Jun 1, 2017 at 1:43 PM, Moritz Barsnick <[hidden email]> wrote:

> On Wed, May 31, 2017 at 19:41:00 +0530, Ratheendran R wrote:
> > Also this is an embedded system use case and encoding happens through
> > hardware accelarators on soc fixed properties.I would like to know if we
> > can further  reduce the size of library and bypass redundant task like
> > probe and parsing metadata of mpegts streams.
>
>

> Then please be so kind and show us what you have been doing so far,
> otherwise it's hard to say where to improve. The full command line, and
> complete, uncut console output.
>
> Apologies for my ignorance.I wanted to keep it short.

configuration options used. in busybox source.
BR2_PACKAGE_FFMPEG_EXTRACONF="--disable-encoders --disable-decoders
--enable-decoder=h264  --enable-decoder=aac  --disable-bsfs
--enable-bsf=h264_mp4toannexb --disable-hwaccels --disable-indevs
--disable-outdevs --disable-muxers --enable-muxer=mpegts --disable-parsers
--enable-parser=h264 --enable-parser=aac  --enable-small --disable-network
--disable-demuxers --enable-demuxer=aac --enable-demuxer=h264
--enable-demuxer=mpegts  --disable-filters --disable-filter=aformat
--disable-filter=format --disable-filter=setpts --disable-filter=anull
--disable-filter=null --disable-filter=trim --disable-filter=atrim
--disable-avdevice --enable-network --disable-swscale --disable-swresample
--disable-avfilter --disable-bzlib --disable-openssl --disable-zlib
--enable-protocol=unix --enable-protocol=file --disable-protocol=rtp
--disable-protocol=http --disable-protocol=tcp"

o/p I got on the console.

install prefix            /usr
source path               .
C compiler
/home/hitem/Microskybell/software/source/Buildroot/output/host/usr/bin/arm-linux-gcc
C library                 uclibc
host C compiler           /usr/bin/gcc
host C library            glibc
ARCH                      arm (arm926ej-s)
big-endian                no
runtime cpu detection     yes
ARMv5TE enabled           yes
ARMv6 enabled             no
ARMv6T2 enabled           no
VFP enabled               no
NEON enabled              yes
THUMB enabled             no
debug symbols             yes
strip symbols             no
optimize for size         yes
optimizations             yes
static                    no
shared                    yes
postprocessing support    no
new filter support        no
network support           yes
threading support         pthreads
safe bitstream reader     yes
SDL support               no
opencl enabled            no
texi2html enabled         no
perl enabled              yes
pod2man enabled           yes
makeinfo enabled          no
makeinfo supports HTML    no
Enabled programs:
ffprobe
External libraries:
Enabled decoders:
aac            h264
Enabled encoders:
Enabled hwaccels:
Enabled parsers:
aac            h264
Enabled demuxers:
aac            h264            mpegts
Enabled muxers:
adts            latm            mpegts
Enabled protocols:
file            unix
Enabled filters:

Enabled bsfs:
h264_mp4toannexb
Enabled indevs:
Enabled outdevs:

-> with this library size obtained is

 libavcodec.so.56.60.100 --> 992244 bytes
 libavformat.so.56.40.101 --> 212216 bytes
 libavutil.so.54.31.100 --> 213936 bytes

so ffmpeg lib ~ 1.5 mb

People have already shared a bit:
> https://trac.ffmpeg.org/wiki/StreamingGuide#Latency
>
> I already working on  gop =10  in the encoder.

So please let me know where I can improve upon.


Ratheendran
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://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
|  
Report Content as Inappropriate

Re: need help in reducing the stream start latency in a network enviroment

Moritz Barsnick
On Thu, Jun 01, 2017 at 18:50:07 +0530, Ratheendran R wrote:
> configuration options used. in busybox source.
> BR2_PACKAGE_FFMPEG_EXTRACONF="--disable-encoders --disable-decoders
[...]

This looks okay, nothing superfluous in there. Perhaps you can get rid
of the debug symbols.

> I already working on  gop =10  in the encoder.
>
> So please let me know where I can improve upon.

We also need to see your ffmpeg command line, and its complete, uncut
console output. That's the stuff that's relevant for the latency.

(You may be able to accelerate probing by explicitly providing the
input format and codec, or reducing the analyzelength & probesize.)

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://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
|  
Report Content as Inappropriate

Re: need help in reducing the stream start latency in a network enviroment

Ratheendran R
Thanks Moritz for your valuable support.

About my app.

I wrote a stand alone app  using ffmpeg library which implements my usecase,
I have a producer thread and consumer thread in the app, producer thread
takes the h264 and aac frames from hardware encoders and gives to ffmpeg
thread(consumer ) on a pipe. The app muxes the streams and  writes to a
unix socket.


Now I have observed the latency in the following steps.
1. producer & consumer thread communication introdues a latency of 8 sec.
2. IPC(Unix domian sockets used)  between two app for cloud upload -->  a
latency of 6 secs.

let me know if you have a better way to handle this scenario.

Regards,
Ratheendran



On Fri, Jun 2, 2017 at 1:13 AM, Moritz Barsnick <[hidden email]> wrote:

> On Thu, Jun 01, 2017 at 18:50:07 +0530, Ratheendran R wrote:
> > configuration options used. in busybox source.
> > BR2_PACKAGE_FFMPEG_EXTRACONF="--disable-encoders --disable-decoders
> [...]
>
> This looks okay, nothing superfluous in there. Perhaps you can get rid
> of the debug symbols.
>
> > I already working on  gop =10  in the encoder.
> >
> > So please let me know where I can improve upon.
>
> We also need to see your ffmpeg command line, and its complete, uncut
> console output. That's the stuff that's relevant for the latency.
>
> (You may be able to accelerate probing by explicitly providing the
> input format and codec, or reducing the analyzelength & probesize.)
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://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
|  
Report Content as Inappropriate

Re: need help in reducing the stream start latency in a network enviroment

Ratheendran R
In reply to this post by Moritz Barsnick
Hi Moritz,

Here is the  on the o/p produced by ffmpeg on my embedded setup and let me
know were I can improve it further.

Start to use memory manager library version 4.1.0.0 !!
Open EDMC device driver version 6.1.0.6 successful !!
ffmpeg version 2.8.1 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (Buildroot 2014.08)
  configuration: --enable-cross-compile
--cross-prefix=/home/hitem/sources/Microskybell/software/source/Buildroot/output/host/usr/bin/arm-linu'
  WARNING: library configuration mismatch
  avutil      configuration: --enable-cross-compile
--cross-prefix=/home/hitem/sources/Microskybell/software/source/Buildroot/output/host/usr/'
  avcodec     configuration: --enable-cross-compile
--cross-prefix=/home/hitem/sources/Microskybell/software/source/Buildroot/output/host/usr/'
  avformat    configuration: --enable-cross-compile
--cross-prefix=/home/hitem/sources/Microskybell/software/source/Buildroot/output/host/usr/'
  avdevice    configuration: --enable-cross-compile
--cross-prefix=/home/hitem/sources/Microskybell/software/source/Buildroot/output/host/usr/'
  avfilter    configuration: --enable-cross-compile
--cross-prefix=/home/hitem/sources/Microskybell/software/source/Buildroot/output/host/usr/'
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswresample   1.  2.101 /  1.  2.101
Input #0, h264, from 'venc:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264, yuvj420p(pc, bt470bg/bt470bg/smpte170m),
1280x720, 10 fps, 10 tbr, 1200k tbn, 20 tbc
Input #1, aac, from 'aenc:':
  Duration: N/A, bitrate: 13 kb/s
    Stream #1:0: Audio: aac (LC), 8000 Hz, stereo, fltp, 13 kb/s
Output #0, mpegts, to '/home/ravi/misc/out.ts':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264, yuvj420p, 1280x720, q=2-31, 10 fps, 10 tbr,
90k tbn, 1200k tbc
    Stream #0:1: Audio: aac, 8000 Hz, stereo, 13 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[h264 @ 0x1192460] Thread message queue blocking; consider raising the
thread_queue_size option (current value: 8)
[aac @ 0x12ed2a0] Thread message queue blocking; consider raising the
thread_queue_size option (current value: 8)


Thanks,
Ratheendran


On Fri, Jun 2, 2017 at 1:13 AM, Moritz Barsnick <[hidden email]> wrote:

> On Thu, Jun 01, 2017 at 18:50:07 +0530, Ratheendran R wrote:
> > configuration options used. in busybox source.
> > BR2_PACKAGE_FFMPEG_EXTRACONF="--disable-encoders --disable-decoders
> [...]
>
> This looks okay, nothing superfluous in there. Perhaps you can get rid
> of the debug symbols.
>
> > I already working on  gop =10  in the encoder.
> >
> > So please let me know where I can improve upon.
>
> We also need to see your ffmpeg command line, and its complete, uncut
> console output. That's the stuff that's relevant for the latency.
>
> (You may be able to accelerate probing by explicitly providing the
> input format and codec, or reducing the analyzelength & probesize.)
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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