Discussion:
[FFmpeg-user] m3u8 live stream will not play in google chrome
Anthony Griffiths
2018-07-24 11:14:45 UTC
Permalink
I use ffmpeg on a centos 6 machine to create a live stream that goes
to a centos 6 vps server running nginx. This is the command:

ffmpeg -y -f mpegts -i /dev/dvb/adapter0/dvr0 -f flv \
-codec:v libx264 -preset slow -s 320x180 -qscale:v 20 -maxrate 600k
-bufsize 1000k -vf scale=-1:240 -threads 0 \
-vsync cfr -framerate 25 -c:a aac -b:a 64k -af aformat=s16:44100
rtmp://nginx-server/mobile

nginx delivers the video as http://198.91.92.112:90/mobile/index.m3u8

the command works and the video plays on a mobile phone and in MS Edge
but it won't play in google chrome on a windows desktop.
The stream can be viewed here: http://198.91.92.112/edge.html.
Ironically it will play in chrome on an android device.
I'm fairly certain the 'f -flv' bit in the command is the culprit
however ffmpeg won't run without it. Can anyone help in correcting
this command so the stream will play in google chrome?
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subject "unsubscrib
Micael Silva
2018-07-24 17:53:26 UTC
Permalink
Post by Anthony Griffiths
I use ffmpeg on a centos 6 machine to create a live stream that goes
ffmpeg -y -f mpegts -i /dev/dvb/adapter0/dvr0 -f flv \
-codec:v libx264 -preset slow -s 320x180 -qscale:v 20 -maxrate 600k
-bufsize 1000k -vf scale=-1:240 -threads 0 \
-vsync cfr -framerate 25 -c:a aac -b:a 64k -af aformat=s16:44100
rtmp://nginx-server/mobile
nginx delivers the video as http://198.91.92.112:90/mobile/index.m3u8
the command works and the video plays on a mobile phone and in MS Edge
but it won't play in google chrome on a windows desktop.
The stream can be viewed here: http://198.91.92.112/edge.html.
Ironically it will play in chrome on an android device.
I'm fairly certain the 'f -flv' bit in the command is the culprit
however ffmpeg won't run without it. Can anyone help in correcting
this command so the stream will play in google chrome?
Probably there is some wrong packaging occurring because of the order of
the arguments. Everything that comes after -f says about the muxer and
-codec should come before that. Try using "ffmpeg -y -f mpegts -i
/dev/dvb/adapter0/dvr0 -codec:v libx264 (...) -c:a aac (...) -f
flv rtmp://nginx-server/mobile"
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org
Carl Eugen Hoyos
2018-07-24 18:12:54 UTC
Permalink
Post by Micael Silva
Post by Anthony Griffiths
I use ffmpeg on a centos 6 machine to create a live stream that goes
ffmpeg -y -f mpegts -i /dev/dvb/adapter0/dvr0 -f flv \
-codec:v libx264 -preset slow -s 320x180 -qscale:v 20 -maxrate 600k
-bufsize 1000k -vf scale=-1:240 -threads 0 \
-vsync cfr -framerate 25 -c:a aac -b:a 64k -af aformat=s16:44100
rtmp://nginx-server/mobile
Complete, uncut console output missing.
-f mpegts should be removed, -s and -vf scale is undefined
behaviour imo, I suspect -qscale has no effect on x264,
threads 0 is superfluous
Post by Micael Silva
Post by Anthony Griffiths
nginx delivers the video as http://198.91.92.112:90/mobile/index.m3u8
the command works and the video plays on a mobile phone and in MS Edge
but it won't play in google chrome on a windows desktop.
The stream can be viewed here: http://198.91.92.112/edge.html.
Ironically it will play in chrome on an android device.
I'm fairly certain the 'f -flv' bit in the command is the culprit
however ffmpeg won't run without it. Can anyone help in correcting
this command so the stream will play in google chrome?
Why aren't you asking the Chrome people what is wrong with
the stream?
Post by Micael Silva
Probably there is some wrong packaging occurring because of the order of
the arguments.
Everything that comes after -f says about the muxer and
-codec should come before that.
This sounds wrong to me.

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

To unsubscribe, visit link above, or email
ffmp
hans gerte
2018-07-25 05:14:34 UTC
Permalink
Hi , you have to enable the flash plugin in chrome for it to work. as
chrome by default is blocking flash..
Post by Carl Eugen Hoyos
Post by Micael Silva
Post by Anthony Griffiths
I use ffmpeg on a centos 6 machine to create a live stream that goes
ffmpeg -y -f mpegts -i /dev/dvb/adapter0/dvr0 -f flv \
-codec:v libx264 -preset slow -s 320x180 -qscale:v 20 -maxrate 600k
-bufsize 1000k -vf scale=-1:240 -threads 0 \
-vsync cfr -framerate 25 -c:a aac -b:a 64k -af aformat=s16:44100
rtmp://nginx-server/mobile
Complete, uncut console output missing.
-f mpegts should be removed, -s and -vf scale is undefined
behaviour imo, I suspect -qscale has no effect on x264,
threads 0 is superfluous
Post by Micael Silva
Post by Anthony Griffiths
nginx delivers the video as http://198.91.92.112:90/mobile/index.m3u8
the command works and the video plays on a mobile phone and in MS Edge
but it won't play in google chrome on a windows desktop.
The stream can be viewed here: http://198.91.92.112/edge.html.
Ironically it will play in chrome on an android device.
I'm fairly certain the 'f -flv' bit in the command is the culprit
however ffmpeg won't run without it. Can anyone help in correcting
this command so the stream will play in google chrome?
Why aren't you asking the Chrome people what is wrong with
the stream?
Post by Micael Silva
Probably there is some wrong packaging occurring because of the order of
the arguments.
Everything that comes after -f says about the muxer and
-codec should come before that.
This sounds wrong to me.
Carl Eugen
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-
Anthony Griffiths
2018-07-25 07:26:59 UTC
Permalink
thanks but I've seen other sites that stream m3u8 in google chrome and
there's no need to do anything with the flash plugin. I need this to
just work without any inconvienience to the viewer.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-request@
Karim SLIMANI
2018-07-25 08:26:06 UTC
Permalink
I am not sure that Chrome desktop can natively play HLS stream.
I suggest you try to play video using a playback library, for example,
HLS.JS (just google it).
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subject "unsubsc
Anthony Griffiths
2018-07-25 10:25:57 UTC
Permalink
Post by Karim SLIMANI
I am not sure that Chrome desktop can natively play HLS stream.
I suggest you try to play video using a playback library, for example,
HLS.JS (just google it).
thankyou but its my ffmpeg command that's at fault here. There's a
demo page for hls streaming here:

https://video-dev.github.io/hls.js/demo/

if I try to play my own m3u8 stream there it fails to play, which
circles me back to my original ffmpeg command.
Here's the url for my m3u8 stream:
http://198.91.92.112:90/mobile/index.m3u8
this url works in ms edge and vlc but not in google chrome.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.or
Moritz Barsnick
2018-07-25 12:36:29 UTC
Permalink
Post by Anthony Griffiths
https://video-dev.github.io/hls.js/demo/
Where's the m3u8 link in there?

(I'm retrieving the page with Opera, which uses Chromium's render, but
possibly other stuff around it... Sigh.)
Post by Anthony Griffiths
if I try to play my own m3u8 stream there it fails to play, which
circles me back to my original ffmpeg command.
http://198.91.92.112:90/mobile/index.m3u8
this url works in ms edge and vlc but not in google chrome.
Have you tried using other mime types?

Someone here:
https://stackoverflow.com/q/6438680/3974309
uses this:

AddType application/x-mpegURL .m3u8
AddType video/MP2T .ts

While you use
application/vnd.apple.mpegurl
application/octet-stream

Chrome may be picky about that - as hinted in the SO posting.
Especially the latter may be a showstopper.

Moritz.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpe
Anthony Griffiths
2018-07-26 08:46:20 UTC
Permalink
Post by Moritz Barsnick
Post by Anthony Griffiths
https://video-dev.github.io/hls.js/demo/
Where's the m3u8 link in there?
theres a think blue horizontal line with the text 'Select a test stream....'
immediately under that there's an url which plays a big buck bunny
cartoon. You can delete the url and substitute another. (mine)
Post by Moritz Barsnick
Have you tried using other mime types?
https://stackoverflow.com/q/6438680/3974309
AddType application/x-mpegURL .m3u8
AddType video/MP2T .ts
While you use
application/vnd.apple.mpegurl
application/octet-stream
thanks I tried
AddType application/x-mpegURL .m3u8
Post by Moritz Barsnick
AddType video/MP2T .ts
but it made no difference, the video still will not play in google chrome.
I'm convinced the problem is with google chrome and flash player. My
ffmpeg command incorporates 'f -flv' and google chrome doesn't like
this. I've also tried 'f -mpegts' and 'f -mpeg', the command runs ok
but there's video in anything. I need to substitute 'f -flv' with
something else but i don't know what.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmp

Anthony Griffiths
2018-07-25 07:24:38 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Anthony Griffiths
I use ffmpeg on a centos 6 machine to create a live stream that goes
ffmpeg -y -f mpegts -i /dev/dvb/adapter0/dvr0 -f flv \
-codec:v libx264 -preset slow -s 320x180 -qscale:v 20 -maxrate 600k
-bufsize 1000k -vf scale=-1:240 -threads 0 \
-vsync cfr -framerate 25 -c:a aac -b:a 64k -af aformat=s16:44100
rtmp://nginx-server/mobile
Complete, uncut console output missing.
-f mpegts should be removed, -s and -vf scale is undefined
behaviour imo, I suspect -qscale has no effect on x264,
threads 0 is superfluous
thankyou and yes I realised afterwards - here is the ffmpeg console
output from my command:

-------------------------------------
ffmpeg version 4.0.2-static https://johnvansickle.com/ffmpeg/
Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=g$
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
[mpeg2video @ 0x6c24a80] Invalid frame dimensions 0x0.
Last message repeated 7 times
Input #0, mpegts, from '/dev/dvb/adapter0/dvr0':
Duration: N/A, start: 63189.112022, bitrate: N/A
Stream #0:0[0x5dd]: Video: mpeg2video (Main), yuv420p(tv,
progressive), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn,
50 tbc
Stream #0:1[0x5de]: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (mp2 (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x6c90380] -qscale is ignored, -crf is recommended.
[libx264 @ 0x6c90380] using SAR=1/1
[libx264 @ 0x6c90380] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x6c90380] profile High, level 1.3
[libx264 @ 0x6c90380] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html -
options: caba$
Output #0, flv, to 'rtmp://198.91.92.112/mobile':
Metadata:
encoder : Lavf58.12.100
Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007),
yuv420p, 320x180 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 1k tbn, 25 tbc
Metadata:
encoder : Lavc58.18.100 libx264
Side data:
cpb: bitrate max/min/avg: 600000/0/0 buffer size: 1000000 vbv_delay: -1
Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz,
stereo, fltp, 64 kb/s
Metadata:
encoder : Lavc58.18.100 aac
frame= 114 fps=0.0 q=28.0 size= 66kB time=00:00:03.78 bitrate=
143.0kbits/s dup=20 drop=0 speed=7.57x ^Mframe= 187 fps=182 q=28.0
size=
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffm
Anthony Griffiths
2018-07-25 07:21:05 UTC
Permalink
thankyou for your response micael, I tried what you said but google
chrome still gives a black player screen with 'flash: Video file not
found'. I think I need something else rather that -flv but I don't
know what.
Post by Micael Silva
Post by Anthony Griffiths
I use ffmpeg on a centos 6 machine to create a live stream that goes
ffmpeg -y -f mpegts -i /dev/dvb/adapter0/dvr0 -f flv \
-codec:v libx264 -preset slow -s 320x180 -qscale:v 20 -maxrate 600k
-bufsize 1000k -vf scale=-1:240 -threads 0 \
-vsync cfr -framerate 25 -c:a aac -b:a 64k -af aformat=s16:44100
rtmp://nginx-server/mobile
nginx delivers the video as http://198.91.92.112:90/mobile/index.m3u8
the command works and the video plays on a mobile phone and in MS Edge
but it won't play in google chrome on a windows desktop.
The stream can be viewed here: http://198.91.92.112/edge.html.
Ironically it will play in chrome on an android device.
I'm fairly certain the 'f -flv' bit in the command is the culprit
however ffmpeg won't run without it. Can anyone help in correcting
this command so the stream will play in google chrome?
Probably there is some wrong packaging occurring because of the order of
the arguments. Everything that comes after -f says about the muxer and
-codec should come before that. Try using "ffmpeg -y -f mpegts -i
/dev/dvb/adapter0/dvr0 -codec:v libx264 (...) -c:a aac (...) -f
flv rtmp://nginx-server/mobile"
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-r
Loading...