Re: [FFmpeg-user] FFplay network stream with low latency

2018-08-07 Thread Carl Eugen Hoyos
2018-08-06 3:41 GMT+02:00, Elliott Balsley :
> I discovered an option in picamera python module to include the framerate in
> the SPS headers, so now I will use that instead of raspivid.  Plus it’s more
> flexible, allowing for more advanced text overlays.
> Now ffplay detects it correctly as 30 tbr, although it shows 60 tbc and it

This would be expected for an interlaced stream.

> shows different numbers for fps like 28.83 or 29.25 each time I run it.  Why
> is that?

I guess the timing is not exact for this kind of hardware.

>  Anyway, it still has the same 10 seconds latency, with or without
> ffmpeg up front.

Did you already try the options that are proposed in the wiki?

Is there a reason why you have to use FFplay? ffmpeg supports
several output devices and it may be easier to convince it to
hurry up.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] FFplay network stream with low latency

2018-08-07 Thread Elliott Balsley

> This is just duplicating the latency.
Ok, understood, so I will avoid piping.
> 
> As said, the first thing to check is the actual framerate:
> If it really is 30fps, this has to be fixed first.

I did change the stream, so now ffmpeg detects it correctly at 30 tbr, did you 
see my last message?
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] FFplay network stream with low latency

2018-08-07 Thread Carl Eugen Hoyos
2018-08-05 3:50 GMT+02:00, Elliott Balsley :

> $ nc 192.168.3.172 8080 | /usr/local/bin/ffmpeg -r 5 -i pipe:0
> -analyzeduration 0 -probesize 32 -f h264 -an -c:v copy pipe:1 |
> /usr/local/bin/ffplay -i pipe:0

This is just duplicating the latency.

As said, the first thing to check is the actual framerate:
If it really is 30fps, this has to be fixed first.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] FFplay network stream with low latency

2018-08-07 Thread Roger Pack
https://trac.ffmpeg.org/wiki/StreamingGuide#Latency
may be useful to you...

On Sun, Aug 5, 2018 at 7:41 PM, Elliott Balsley
 wrote:
> I discovered an option in picamera python module to include the framerate in 
> the SPS headers, so now I will use that instead of raspivid.  Plus it’s more 
> flexible, allowing for more advanced text overlays.
> Now ffplay detects it correctly as 30 tbr, although it shows 60 tbc and it 
> shows different numbers for fps like 28.83 or 29.25 each time I run it.  Why 
> is that?  Anyway, it still has the same 10 seconds latency, with or without 
> ffmpeg up front.
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] FFplay network stream with low latency

2018-08-05 Thread Elliott Balsley
I discovered an option in picamera python module to include the framerate in 
the SPS headers, so now I will use that instead of raspivid.  Plus it’s more 
flexible, allowing for more advanced text overlays.
Now ffplay detects it correctly as 30 tbr, although it shows 60 tbc and it 
shows different numbers for fps like 28.83 or 29.25 each time I run it.  Why is 
that?  Anyway, it still has the same 10 seconds latency, with or without ffmpeg 
up front.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] FFplay network stream with low latency

2018-08-04 Thread Elliott Balsley
> Are you sure about the framerate?
> If it really is 30fps and FFmpeg reports it as 25fps, then you
> need a filter chain to speed playback up, "-r" only works with
> ffmpeg, see the documentation for setpts:
> 
I’m pretty sure.  The stream comes from a raspberry pi like this:
raspivid -n -ih -t 0 -w 1280 -h 720 -b 100 -fps 30 -o - | nc -lkv4 8080
If I lower the framerate to 5, then latency improves to about 3 seconds, but 
ffplay still detects it as 25.  See full output below from the latest build 
(with some duplicate error lines removed).  I’m piping ffmpeg to ffplay so I 
can use the -r option.

According to mplayer, it says "FPS not specified in the header or invalid, use 
the -fps option”. If I use “-fps 60” then it plays with no latency, but if I 
use “-fps 30” it has bad latency like ffmpeg.  I don’t understand why. nc 
192.168.1.3 8080 | mplayer -fps 60 -demuxer h264es -

Also, this stream plays with no latency in this app: 
https://github.com/ShawnBaker/iOS_RPiCameraViewer 



> You can also test -analyzeduration.
Thanks, I tried setting that to zero but it doesn’t help.


$ nc 192.168.3.172 8080 | /usr/local/bin/ffmpeg -r 5 -i pipe:0 -analyzeduration 
0 -probesize 32 -f h264 -an -c:v copy pipe:1 | /usr/local/bin/ffplay -i pipe:0
ffplay version N-91560-g476fd6ba3a Copyright (c) 2003-2018 the FFmpeg developers
  built with gcc 7.3.0 (MacPorts gcc7 7.3.0_1)
ffmpeg version N-91560-g476fd6ba3a  configuration: --enable-libopenjpeg 
--enable-libass --enable-libbluray --enable-libfreetype --enable-libx264 
--enable-libx265 --enable-nonfree --enable-libfdk-aac --enable-gpl
 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.3.0 (MacPorts gcc7 7.3.0_1)
  configuration: --enable-libopenjpeg --enable-libass --enable-libbluray 
--enable-libfreetype --enable-libx264 --enable-libx265 --enable-nonfree 
--enable-libfdk-aac --enable-gpl
  libavutil  56. 18.102 / 56. 18.102
  libavcodec 58. 22.100 / 58. 22.100
  libavformat58. 17.101 / 58. 17.101
  libavdevice58.  4.101 / 58.  4.101
  libavfilter 7. 26.100 /  7. 26.100
  libswscale  5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc55.  2.100 / 55.  2.100
  libavutil  56. 18.102 / 56. 18.102
  libavcodec 58. 22.100 / 58. 22.100
  libavformat58. 17.101 / 58. 17.101
  libavdevice58.  4.101 / 58.  4.101
  libavfilter 7. 26.100 /  7. 26.100
  libswscale  5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc55.  2.100 / 55.  2.100
[h264 @ 0x7fb52580ea00] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x7fb52580ea00] decode_slice_header error
[h264 @ 0x7fb52580ea00] no frame!
[h264 @ 0x7fb52580ea00] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x7fb52580ea00] decode_slice_header error
[h264 @ 0x7fb52580ea00] no frame!
Input #0, h264, from 'pipe:0':
  Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, 25 fps, 25 
tbr, 1200k tbn, 50 tbc
Output #0, h264, to 'pipe:1':
  Metadata:
encoder : Lavf58.17.101
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, q=2-31, 25 
fps, 25 tbr, 5 tbn, 5 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Input #0, h264, from 'pipe:0':
  Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, 25 fps, 25 
tbr, 1200k tbn, 50 tbc
nan M-V:nan fd=   0 aq=0KB vq=0KB sq=0B f=0/0
451.5kbits/s speed=1.81x
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:1: Broken pipeime=00:01:11.80 bitrate= 
450.5kbits/s speed= 1.8x
frame=  335 fps=8.4 q=-1.0 Lsize=3949kB time=00:01:11.80 bitrate= 
450.5kbits/s speed=1.79x
video:3964kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing 
overhead: unknown
Conversion failed!

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] FFplay network stream with low latency

2018-08-03 Thread Carl Eugen Hoyos
2018-08-03 7:07 GMT+02:00, Elliott Balsley :
> I’m trying to use ffplay with a network stream from netcat.
> It’s raw h.264, 1280x720, 30fps.

Are you sure about the framerate?
If it really is 30fps and FFmpeg reports it as 25fps, then you
need a filter chain to speed playback up, "-r" only works with
ffmpeg, see the documentation for setpts:
https://ffmpeg.org/ffmpeg-filters.html#setpts_002c-asetpts

> When I play it with ffplay, there is about 10 seconds
> latency over the LAN. Is there any way to reduce this?
> I’ve tried -probesize 32 and —fflags nobuffer.

You can also test -analyzeduration.

> I notice it plays at 25fps, so maybe that’s part of the problem.
> I can’t figure out how to force the rate to 30.

I wonder if the ten seconds are the start value for the
latency that increases over time.

And please test current FFmpeg git head, nothing else is
supported here.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".