hls and input http stream changes problem

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

hls and input http stream changes problem

Michal Hajek
Hi,
I need to generate one endless  hls stream from endless input http stream.
The input http stream is made from a few input files in a loop (using VLC
3.0.8).

The ffmpeg command:

.\ffmpeg -i http://10.200.100.79:8024 -c:v libx264 -crf 25 -preset veryfast
 ^
     -tune fastdecode  -hls_allow_cache 0  ^
     -c:a aac  -filter:a "volume=0.10" -f hls  -hls_segment_type  fmp4 ^
     -hls_flags delete_segments+discont_start+omit_endlist ^
     -g 25 -sc_threshold 0 stream.m3u8

And the output is:
.....
[hls @ 066e6d40] Opening 'stream0.m4s' for writing57 bitrate=N/A speed=5.16x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream1.m4s' for writing
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream2.m4s' for writing63 bitrate=N/A speed=4.42x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[mp4 @ 084d6180] Application provided duration: -1 / timestamp: 288379 is
out of range for mov/mp4 format
[hls @ 066e6d40] Opening 'stream3.m4s' for writing46 bitrate=N/A speed= 2.5x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream4.m4s' for writing34 bitrate=N/A speed=1.96x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream5.m4s' for writing73 bitrate=N/A speed=1.67x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream6.m4s' for writing41 bitrate=N/A speed=1.55x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream7.m4s' for writing76 bitrate=N/A speed=1.42x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream8.m4s' for writing68 bitrate=N/A speed=1.37x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream9.m4s' for writing37 bitrate=N/A speed=1.33x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream10.m4s' for writing9 bitrate=N/A speed=1.29x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream11.m4s' for writing4 bitrate=N/A speed=1.26x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream12.m4s' for writing7 bitrate=N/A speed=1.24x
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for
writing                                             <---- so far so good,
but here VLC starts streaming of next file
[mpegts @ 003d0200] New audio stream 0:2 at pos:12504256 and
DTS:62584.9s23x     <---- ffmpeg detects change in input stream
[mpegts @ 003d0200] New video stream 0:3 at pos:12505760 and
DTS:62585s1.21x     <---- but stops creating hls files
[mpegts @ 003d0200] New audio stream 0:4 at pos:14497432 and
DTS:62595.7s835x   <--- here VLC starts streamig next file
[mpegts @ 003d0200] New video stream 0:5 at pos:14508336 and
DTS:62595.7s          <--- still no new hls files
[mpegts @ 003d0200] New audio stream 0:6 at pos:20390856 and
DTS:62612.9s578x    <--- here VLC starts streamig next file
[mpegts @ 003d0200] New video stream 0:7 at pos:20401760 and
DTS:62613.3s554x      <---- I pressed CTRL-C in ffmpeg
[hls @ 066e6d40] Opening 'stream13.m4s' for writing3 bitrate=N/A
speed=0.508x          <---- ffmpeg starts correct shutdown
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
[hls @ 066e6d40] Opening 'stream14.m4s' for writing
[hls @ 066e6d40] Opening 'stream.m3u8.tmp' for writing
frame=  704 fps= 13 q=-1.0 Lsize=N/A time=00:00:28.17 bitrate=N/A
speed=0.504x
video:3572kB audio:454kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
[libx264 @ 003db640] frame I:29    Avg QP:22.27  size: 33274
[libx264 @ 003db640] frame P:459   Avg QP:25.30  size:  5259
[libx264 @ 003db640] frame B:216   Avg QP:28.36  size:  1286
[libx264 @ 003db640] consecutive B-frames: 51.8% 15.6% 18.3% 14.2%
[libx264 @ 003db640] mb I  I16..4: 11.6% 45.7% 42.7%
[libx264 @ 003db640] mb P  I16..4:  2.9%  9.9%  0.9%  P16..4: 29.2%  8.5%
 2.3%  0.0%  0.0%    skip:46.3%
[libx264 @ 003db640] mb B  I16..4:  0.5%  1.8%  0.0%  B16..8:  8.8%  2.5%
 0.3%  direct: 3.6%  skip:82.5%  L0:43.0% L1:36.5% BI:20.5%
[libx264 @ 003db640] 8x8 transform intra:64.7% inter:54.9%
[libx264 @ 003db640] coded y,uvDC,uvAC intra: 57.7% 53.5% 13.4% inter: 8.6%
6.9% 0.3%
[libx264 @ 003db640] i16 v,h,dc,p: 38% 37% 15% 10%
[libx264 @ 003db640] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 24% 35%  2%  3%  3%
 2%  3%  4%
[libx264 @ 003db640] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 21% 11%  6%  7%  8%
 7%  7%  7%
[libx264 @ 003db640] i8c dc,h,v,p: 43% 26% 24%  7%
[libx264 @ 003db640] kb/s:1038.85
[aac @ 066c0a40] Qavg: 9562.674
Exiting normally, received signal 2.

What parameters make ffmpeg to accept all input streams?

Thanks, Michal
_______________________________________________
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: hls and input http stream changes problem

kumowoon1025
> What parameters make ffmpeg to accept all input streams?

Try if adding -f mpegts -merge_pmt_versions 1 before the input works.
_______________________________________________
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: hls and input http stream changes problem

Michal Hajek
pá 14. 2. 2020 v 16:57 odesílatel Ted Park <[hidden email]> napsal:

> > What parameters make ffmpeg to accept all input streams?
>
> Try if adding -f mpegts -merge_pmt_versions 1 before the input works.
>

It seems to be working, thanks!

Michal


> _______________________________________________
> 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".
_______________________________________________
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: hls and input http stream changes problem

andrei ka
and why don't you do it all (almost) in ffmpeg ? make :
1) ffmpeg playlist input with your several files, transcode it the all to
required resolution / br / gops and stream it to local multicast ;
2) play that multicast in vlc (or ffplay) if you need visual control ;
3) repackage that multicast to hls output

On Mon, Feb 17, 2020 at 8:19 AM Michal Hajek <[hidden email]> wrote:

> pá 14. 2. 2020 v 16:57 odesílatel Ted Park <[hidden email]>
> napsal:
>
> > > What parameters make ffmpeg to accept all input streams?
> >
> > Try if adding -f mpegts -merge_pmt_versions 1 before the input works.
> >
>
> It seems to be working, thanks!
>
> Michal
>
>
> > _______________________________________________
> > 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".
> _______________________________________________
> 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".
_______________________________________________
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: hls and input http stream changes problem

Michal Hajek
út 18. 2. 2020 v 10:33 odesílatel andrei ka <[hidden email]> napsal:

> and why don't you do it all (almost) in ffmpeg ? make :
> 1) ffmpeg playlist input with your several files, transcode it the all to
> required resolution / br / gops and stream it to local multicast ;
>

  Because
  a) I did not know about ffmpeg before (I created the scripts about a year
ago)
  b) When I had found ffmpeg it seemed to me that making loops and
streaming  with it is impossible. (I need to stream also to HTML5 clients
now.)

 Am I wrong?

  Michal

2) play that multicast in vlc (or ffplay) if you need visual control ;

> 3) repackage that multicast to hls output
>
> On Mon, Feb 17, 2020 at 8:19 AM Michal Hajek <[hidden email]> wrote:
>
> > pá 14. 2. 2020 v 16:57 odesílatel Ted Park <[hidden email]>
> > napsal:
> >
> > > > What parameters make ffmpeg to accept all input streams?
> > >
> > > Try if adding -f mpegts -merge_pmt_versions 1 before the input works.
> > >
> >
> > It seems to be working, thanks!
> >
> > Michal
> >
> >
> > > _______________________________________________
> > > 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".
> > _______________________________________________
> > 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".
> _______________________________________________
> 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".
_______________________________________________
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: hls and input http stream changes problem

kumowoon1025
>  Because
>  a) I did not know about ffmpeg before (I created the scripts about a year
> ago)
>  b) When I had found ffmpeg it seemed to me that making loops and
> streaming  with it is impossible. (I need to stream also to HTML5 clients
> now.)
>
> Am I wrong?


Morning,

I mean I’m sure you’re right on the first one, but ffmpeg has looping options and even though ffserver is developed anymore, ffmpeg can stream output using many protocols, including http.

Regards,
Ted Park
_______________________________________________
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".