HLS - command line hls_segment_size creates problems in segments

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

HLS - command line hls_segment_size creates problems in segments

Phantom Scripts
Hello
I hope that here I can get some response, I tried several means to have some help.

I've been on this problem for several weeks.

first I'll leave a link to a page with a player for the HLS video with the problem:
http://phantsc.rf.gd/AAA/Bbb.html
in this video, just in the second 7, a locking occurs
this problem occurs in the transition from segment0.ts to segment1.ts

I used this command

ffmpeg.exe in.mp4 -vcodec copy -acodec aac -hls_list_size 0 -hls_segment_size 17000000 -f hls out.m3u8

I'm using ‘-hls_segment_size’ to have an ideal file size(17000000 =  ~17MB) for each segment and get byte-ranges in the m3u8 file

I researched everything, and tried everything to not have this problem but it always happens the same thing.
I think this is a bug from ffmpeg...


What I'm trying to get is this:


  1.  get segments (.ts) with sizes close to 17MB (-hls_segment_size was the ideal command)
  2.  have an M3U8 file, with bytes ranges (using '-hls_segment_size' I also get byte-ranges)



I'm looking at a way to cut my file in ideial size, and somehow get byte ranges to every 7 ~ 10 seconds, and create a custom m3u8 file (I do not know how to do it)
_______________________________________________
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 - command line hls_segment_size creates problems in segments

Carl Eugen Hoyos-2
2019-04-05 1:05 GMT+02:00, Phantom Scripts <[hidden email]>:

> I hope that here I can get some response, I tried several
> means to have some help.

Just curious:
What did you try?

> I've been on this problem for several weeks.
>
> first I'll leave a link to a page with a player for the HLS video with the
> problem:
> http://phantsc.rf.gd/AAA/Bbb.html
> in this video, just in the second 7, a locking occurs
> this problem occurs in the transition from segment0.ts to segment1.ts
>
> I used this command
>
> ffmpeg.exe in.mp4 -vcodec copy -acodec aac -hls_list_size 0
> -hls_segment_size 17000000 -f hls out.m3u8

Complete, uncut console output missing.

> I'm using ‘-hls_segment_size’ to have an ideal file size(17000000 =  ~17MB)
> for each segment and get byte-ranges in the m3u8 file

And what does not work?

> I researched everything, and tried everything to not have this problem but
> it always happens the same thing.
> I think this is a bug from ffmpeg...
>
>
> What I'm trying to get is this:
>
>
>   1.  get segments (.ts) with sizes close to 17MB (-hls_segment_size was the
> ideal command)
>   2.  have an M3U8 file, with bytes ranges (using '-hls_segment_size' I also
> get byte-ranges)
>
>
>
> I'm looking at a way to cut my file in ideial size, and somehow get byte
> ranges to every 7 ~ 10 seconds, and create a custom m3u8 file (I do not know
> how to do it)

Why do you use hls_segment_size if you want a time segment?

Carl Eugen
_______________________________________________
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
|

RES: HLS - command line hls_segment_size creates problems in segments

Phantom Scripts
thanks for answering Carl Eugen, but I think you do not understand.



I'm trying to create segments with a defined file size, for example 17MB, and have byte ranges in the m3u8 file



this command:

ffmpeg.exe -i in.mp4 -vcodec copy -accodec aac -hls_list_size 0 -hls_segment_size 17000000 -f hls out.m3u8

in the console works, creates the .TS Files, and the .m3u8 file.

the m3u8 file contains byte ranges.



but there is a problem during the vídeo.

in this link:

http://phantsc.rf.gd/AAA/Bbb.html

contains an hls player, which contains the files I created with the mentioned command,

touch play in the video and look at the second 7, for some milleseconds the video and audio 'hangs'

this happens in the whole video, when it is from a segment to a new segment.





I need to use '-hls_segment_size' to set a maximum size of segment files

and use '-hls_time' to set the seconds for byte-ranges in the m3u8 file.





touch play on the video of the link, you will see the problem(pay attention to audio and video)





________________________________
De: ffmpeg-user <[hidden email]> em nome de Carl Eugen Hoyos <[hidden email]>
Enviado: Thursday, April 4, 2019 9:56:48 PM
Para: FFmpeg user questions
Assunto: Re: [FFmpeg-user] HLS - command line hls_segment_size creates problems in segments

2019-04-05 1:05 GMT+02:00, Phantom Scripts <[hidden email]>:

> I hope that here I can get some response, I tried several
> means to have some help.

Just curious:
What did you try?

> I've been on this problem for several weeks.
>
> first I'll leave a link to a page with a player for the HLS video with the
> problem:
> http://phantsc.rf.gd/AAA/Bbb.html
> in this video, just in the second 7, a locking occurs
> this problem occurs in the transition from segment0.ts to segment1.ts
>
> I used this command
>
> ffmpeg.exe in.mp4 -vcodec copy -acodec aac -hls_list_size 0
> -hls_segment_size 17000000 -f hls out.m3u8

Complete, uncut console output missing.

> I'm using ‘-hls_segment_size’ to have an ideal file size(17000000 =  ~17MB)
> for each segment and get byte-ranges in the m3u8 file

And what does not work?

> I researched everything, and tried everything to not have this problem but
> it always happens the same thing.
> I think this is a bug from ffmpeg...
>
>
> What I'm trying to get is this:
>
>
>   1.  get segments (.ts) with sizes close to 17MB (-hls_segment_size was the
> ideal command)
>   2.  have an M3U8 file, with bytes ranges (using '-hls_segment_size' I also
> get byte-ranges)
>
>
>
> I'm looking at a way to cut my file in ideial size, and somehow get byte
> ranges to every 7 ~ 10 seconds, and create a custom m3u8 file (I do not know
> how to do it)

Why do you use hls_segment_size if you want a time segment?

Carl Eugen
_______________________________________________
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: RES: HLS - command line hls_segment_size creates problems in segments

Moritz Barsnick
On Fri, Apr 05, 2019 at 01:28:35 +0000, Phantom Scripts wrote:
> thanks for answering Carl Eugen, but I think you do not understand.

Still, if you think there's an issue with how ffmpeg is encoding your
video, please provide the actual command line used and the command's
complete, uncut console output.

There may be useful information in there, and it might help us to
reproduce the issue.

Which BugBuckBunny video are you using as input? (In case we want to
reproduce.)

> but there is a problem during the vídeo.
> in this link:
> http://phantsc.rf.gd/AAA/Bbb.html
> contains an hls player, which contains the files I created with the mentioned command,
> touch play in the video and look at the second 7, for some milleseconds the video and audio 'hangs'
> this happens in the whole video, when it is from a segment to a new segment.

Have you tried in a different player? (I understand well that this is
HTML5, so the browser is the player.) I was trying to let ffmpeg play
this stream, and I figured out that the HLS URL seems to be
http://phantsc.rf.gd/AAA/SampleVideo_1280x720_30mb/SampleVideo_1280x720_30mb.m3u8,
but I get a 403 on that link, even if I try with "Referer:" and
"Cookie:" headers. What a convoluted piece of JavasScript obfuscation
"sh*t" (sorry) - this is just to prevent the video to be seen in
anything else but the browser window?

In a Wireshark trace (thank you, obfuscation!), I can see that the m3u8
contains:

#EXTM3U
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:8.400000,
#EXT-X-BYTERANGE:1662108@0
SampleVideo_1280x720_30mb0.ts
#EXTINF:4.560000,
#EXT-X-BYTERANGE:383896@0
SampleVideo_1280x720_30mb1.ts

So I assume the issue with the stalling picture occurs in the first
segment named SampleVideo_1280x720_30mb0.ts? Can you just provide a
(downloadable!) link to this segment?



> I need to use '-hls_segment_size' to set a maximum size of segment files
> and use '-hls_time' to set the seconds for byte-ranges in the m3u8 file.

But that's not part of your issue, right? Are you assuming it is? You
provided so much information around this fact that it was hard to
understand your actual issue.

Thanks,
Moritz
_______________________________________________
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
|

RES: RES: HLS - command line hls_segment_size creates problems in segments

Phantom Scripts
Thank you for replying again.





I'm using this video:

https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_30mb.mp4

mp4 format, size 30MB and resolution 1280x720



- Command Line:

ffmpeg.exe -i SampleVideo_1280x720_30mb.mp4  -vcodec copy -acodec aac -hls_list_size 0 -hls_segment_size 2000000 -f hls SampleVideo_1280x720_30mb.m3u8

- Console output:

https://pastebin.com/B7tgTGp8

- Created files download(m3u8 and TS files):

https://ufile.io/fg8w5 (OR)

https://mega.nz/#!wscHyAxS!pKj4RjVBFCwe3tjbaSoJUly_im72h6ZrIncF4_ex100





this time I used ffplay.exe, and this is the output of the console:

https://pastebin.com/aSRnuyJF





sorry if I forgot to send you more details.

but I hope this is enough.



Thx





________________________________
De: ffmpeg-user <[hidden email]> em nome de Moritz Barsnick <[hidden email]>
Enviado: Friday, April 5, 2019 4:36:34 AM
Para: FFmpeg user discussions
Assunto: Re: [FFmpeg-user] RES: HLS - command line hls_segment_size creates problems in segments

On Fri, Apr 05, 2019 at 01:28:35 +0000, Phantom Scripts wrote:
> thanks for answering Carl Eugen, but I think you do not understand.

Still, if you think there's an issue with how ffmpeg is encoding your
video, please provide the actual command line used and the command's
complete, uncut console output.

There may be useful information in there, and it might help us to
reproduce the issue.

Which BugBuckBunny video are you using as input? (In case we want to
reproduce.)

> but there is a problem during the vídeo.
> in this link:
> http://phantsc.rf.gd/AAA/Bbb.html
> contains an hls player, which contains the files I created with the mentioned command,
> touch play in the video and look at the second 7, for some milleseconds the video and audio 'hangs'
> this happens in the whole video, when it is from a segment to a new segment.

Have you tried in a different player? (I understand well that this is
HTML5, so the browser is the player.) I was trying to let ffmpeg play
this stream, and I figured out that the HLS URL seems to be
http://phantsc.rf.gd/AAA/SampleVideo_1280x720_30mb/SampleVideo_1280x720_30mb.m3u8,
but I get a 403 on that link, even if I try with "Referer:" and
"Cookie:" headers. What a convoluted piece of JavasScript obfuscation
"sh*t" (sorry) - this is just to prevent the video to be seen in
anything else but the browser window?

In a Wireshark trace (thank you, obfuscation!), I can see that the m3u8
contains:

#EXTM3U
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:8.400000,
#EXT-X-BYTERANGE:1662108@0
SampleVideo_1280x720_30mb0.ts
#EXTINF:4.560000,
#EXT-X-BYTERANGE:383896@0
SampleVideo_1280x720_30mb1.ts

So I assume the issue with the stalling picture occurs in the first
segment named SampleVideo_1280x720_30mb0.ts? Can you just provide a
(downloadable!) link to this segment?



> I need to use '-hls_segment_size' to set a maximum size of segment files
> and use '-hls_time' to set the seconds for byte-ranges in the m3u8 file.

But that's not part of your issue, right? Are you assuming it is? You
provided so much information around this fact that it was hard to
understand your actual issue.

Thanks,
Moritz
_______________________________________________
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: RES: RES: HLS - command line hls_segment_size creates problems in segments

Moritz Barsnick
On Fri, Apr 05, 2019 at 11:36:29 +0000, Phantom Scripts wrote:
> I'm using this video:
> https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_30mb.mp4
[...]
> ffmpeg.exe -i SampleVideo_1280x720_30mb.mp4  -vcodec copy -acodec aac -hls_list_size 0 -hls_segment_size 2000000 -f hls SampleVideo_1280x720_30mb.m3u8
> - Console output:
> https://pastebin.com/B7tgTGp8

The only interesting bit here: One such message:

> [hls @ 00000155b4a9e280] Cannot use rename on non file protocol, this may lead to races and temporary partial files

> this time I used ffplay.exe, and this is the output of the console:
> https://pastebin.com/aSRnuyJF

The interesting bit here: A lot of errors when playing:
> [h264 @ 000001a348c3e1c0] error while decoding MB 6 23, bytestream -5
> [h264 @ 000001a348c3e1c0] concealing 1803 DC, 1803 AC, 1803 MV errors in P frame
and dozens others.

> sorry if I forgot to send you more details.

Thanks for all the details.

I can reproduce the encoding warning with 4.1, it's gone with relative
recent git master (probably fixed by commit c822d70).

I can reproduce the error log on decoding. So apparently, ffmpeg cannot
decode its own muxing successfully. Or it introduces errors while
muxing. This doesn't happen when muxing to mp4 or mpegts (for some
reason noticably slower than mp4).

We may need to open a bug ticket for this.

Thanks,
Moritz
_______________________________________________
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
|

RES: RES: RES: HLS - command line hls_segment_size creates problems in segments

Phantom Scripts
Hi, thanks for the reply again.

I did not quite understand your answer, the 'git builds' version was fix for this?

or do I have to open a bug ticket? (I tried to open a ticket, but the pages do not work)



De: Moritz Barsnick<mailto:[hidden email]>
Enviado:sexta-feira, 5 de abril de 2019 12:17
Para: FFmpeg user discussions<mailto:[hidden email]>
Assunto: Re: [FFmpeg-user] RES: RES: HLS - command line hls_segment_size creates problems in segments

On Fri, Apr 05, 2019 at 11:36:29 +0000, Phantom Scripts wrote:
> I'm using this video:
> https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_30mb.mp4
[...]
> ffmpeg.exe -i SampleVideo_1280x720_30mb.mp4  -vcodec copy -acodec aac -hls_list_size 0 -hls_segment_size 2000000 -f hls SampleVideo_1280x720_30mb.m3u8
> - Console output:
> https://pastebin.com/B7tgTGp8

The only interesting bit here: One such message:

> [hls @ 00000155b4a9e280] Cannot use rename on non file protocol, this may lead to races and temporary partial files

> this time I used ffplay.exe, and this is the output of the console:
> https://pastebin.com/aSRnuyJF

The interesting bit here: A lot of errors when playing:
> [h264 @ 000001a348c3e1c0] error while decoding MB 6 23, bytestream -5
> [h264 @ 000001a348c3e1c0] concealing 1803 DC, 1803 AC, 1803 MV errors in P frame
and dozens others.

> sorry if I forgot to send you more details.

Thanks for all the details.

I can reproduce the encoding warning with 4.1, it's gone with relative
recent git master (probably fixed by commit c822d70).

I can reproduce the error log on decoding. So apparently, ffmpeg cannot
decode its own muxing successfully. Or it introduces errors while
muxing. This doesn't happen when muxing to mp4 or mpegts (for some
reason noticably slower than mp4).

We may need to open a bug ticket for this.

Thanks,
Moritz
_______________________________________________
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
|

RES: HLS - command line hls_segment_size creates problems in segments

Phantom Scripts
Sorry, I'm sending another email, but I still have not got an answer that has a solution.



I downloaded the GIT version today, and tested it with the same video, same command line, but the problem still continues.



I did not understand your answer, do I have to open a bug ticket?

Am I using the command in the wrong way? I'm forgetting something?





thank you.





________________________________
De: ffmpeg-user <[hidden email]> em nome de Phantom Scripts <[hidden email]>
Enviado: Saturday, April 6, 2019 11:16:15 AM
Para: FFmpeg user questions
Assunto: [FFmpeg-user] RES: RES: RES: HLS - command line hls_segment_size creates problems in segments

Hi, thanks for the reply again.

I did not quite understand your answer, the 'git builds' version was fix for this?

or do I have to open a bug ticket? (I tried to open a ticket, but the pages do not work)



De: Moritz Barsnick<mailto:[hidden email]>
Enviado:sexta-feira, 5 de abril de 2019 12:17
Para: FFmpeg user discussions<mailto:[hidden email]>
Assunto: Re: [FFmpeg-user] RES: RES: HLS - command line hls_segment_size creates problems in segments

On Fri, Apr 05, 2019 at 11:36:29 +0000, Phantom Scripts wrote:
> I'm using this video:
> https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_30mb.mp4
[...]
> ffmpeg.exe -i SampleVideo_1280x720_30mb.mp4  -vcodec copy -acodec aac -hls_list_size 0 -hls_segment_size 2000000 -f hls SampleVideo_1280x720_30mb.m3u8
> - Console output:
> https://pastebin.com/B7tgTGp8

The only interesting bit here: One such message:

> [hls @ 00000155b4a9e280] Cannot use rename on non file protocol, this may lead to races and temporary partial files

> this time I used ffplay.exe, and this is the output of the console:
> https://pastebin.com/aSRnuyJF

The interesting bit here: A lot of errors when playing:
> [h264 @ 000001a348c3e1c0] error while decoding MB 6 23, bytestream -5
> [h264 @ 000001a348c3e1c0] concealing 1803 DC, 1803 AC, 1803 MV errors in P frame
and dozens others.

> sorry if I forgot to send you more details.

Thanks for all the details.

I can reproduce the encoding warning with 4.1, it's gone with relative
recent git master (probably fixed by commit c822d70).

I can reproduce the error log on decoding. So apparently, ffmpeg cannot
decode its own muxing successfully. Or it introduces errors while
muxing. This doesn't happen when muxing to mp4 or mpegts (for some
reason noticably slower than mp4).

We may need to open a bug ticket for this.

Thanks,
Moritz
_______________________________________________
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: RES: HLS - command line hls_segment_size creates problems in segments

Moritz Barsnick
On Sun, Apr 07, 2019 at 17:26:13 +0000, Phantom Scripts wrote:
> Sorry, I'm sending another email, but I still have not got an answer that has a solution.

I don't actually have a solution for you...

> I did not understand your answer, do I have to open a bug ticket?
>
> Am I using the command in the wrong way? I'm forgetting something?

As far as I can tell, you are using the command correctly. You may get
different results if you change the list size and segment size options.

I can open a ticket for you. I was already preparing to do so, but I'm
in weekend recreation mode. ;-) I tried to find a more simple recipe to
reproduce the issue, but got distracted by other peculiarities (the
issue sometimes not appearing, sometimes getting an empty initial
segment, ...). I you can wait a bit, I'll open the ticket for you.

That doesn't mean there will be a quick solution though, sorry.

Moritz
_______________________________________________
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 - command line hls_segment_size creates problems in segments

Moritz Barsnick
On Sun, Apr 07, 2019 at 20:11:52 +0200, Moritz Barsnick wrote:
> I can open a ticket for you. I was already preparing to do so, but I'm
> in weekend recreation mode. ;-)

I have opened a trac ticket:
https://trac.ffmpeg.org/ticket/7831

I can add you to Cc: on the ticket if you wish.

Perhaps someone can find a workaround for you, e.g. by using some muxer
flags, but I have no idea.

Thanks,
Moritz
_______________________________________________
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".