Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken OGG Stream Created #549

Open
autonarcosis opened this issue May 4, 2018 · 10 comments
Open

Broken OGG Stream Created #549

autonarcosis opened this issue May 4, 2018 · 10 comments
Assignees

Comments

@autonarcosis
Copy link

autonarcosis commented May 4, 2018

Can other's reproduce this error? Compiled via opam. Current environment.

Linux hostname 4.16.4-200.fc27.x86_64 #1 SMP Tue Apr 24 23:19:54 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ liquidsoap --version Liquidsoap 1.3.3
$ gst-launch-1.0 --version gst-launch-1.0 version 1.12.4 GStreamer 1.12.4

Using any output method will produce these errors:

output.harbor(%ogg(%theora(quality=25,width=320,height=240),%vorbis),format="video/ogg",mount="/teste",mksafe(mainsource))

$ ffplay http://localhost:8000/teste

ffplay version 3.3.7 Copyright (c) 2003-2018 the FFmpeg developers
Input #0, ogg, from 'http://localhost:8000/teste':sq=    0B f=0/0   
  Metadata:
    StreamTitle     : Totally Not Porn I Swear
  Duration: N/A, start: 0.000000, bitrate: 112 kb/s
    Stream #0:0: Data: none
    Stream #0:1: Audio: vorbis, 44100 Hz, stereo, fltp, 112 kb/s
    Metadata:
      TITLE           : Totally Not Porn I Swear
      ENCODER         : Liquidsoap/1.3.3 (Unix; OCaml 4.05.0)
    Stream #0:2: Video: theora, yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
    Metadata:
      ENCODER         : ocaml-theora by the savonet team (http://savonet.sf.net/)
      TITLE           : Totally Not Porn I Swear
[ogg @ 0x7f0f04000b80] Broken file, keyframe not correctly marked.
[theora @ 0x7f0f0406ff20] vp3: first frame not a keyframe
[ogg @ 0x7f0f04000b80] Broken file, keyframe not correctly marked.  
[ogg @ 0x7f0f04000b80] Broken file, keyframe not correctly marked.  
[ogg @ 0x7f0f04000b80] Broken file, keyframe not correctly marked.
[ogg @ 0x7fa88c000b80] Broken file, non-keyframe not correctly marked.  

The video will play, however, ffplay will continuously output these errors. This will also occur in the output.icecast() as well. I haven't tested the other outputs as I am sure they are all affected. Because... If I encode using gst-launch-1.0 a using theoraenc, I will get the same results in the output.ogg file.

I am interested to know what other versions of Gstreamer are doing and if this can be reproduced.

@autonarcosis
Copy link
Author

I can reproduce this on Debian 9.4 using it's default Gstreamer v1.10 and compiling Gstreamer v1.14. This isn't a Liquidsoap issue. This is can be done by just encoding a file to theora through Gstreamer itself.

@toots
Copy link
Member

toots commented Jul 2, 2018

Thanks for reporting. I'll try to have a look at it.

@toots toots self-assigned this Jul 2, 2018
@autonarcosis
Copy link
Author

I am not entirely sure if the theora encoding is using gstreamer or it's own built in code. Because gstreamer also produces this error I just made assumption that LS is using gstreamer to create the stream.
Further testing resulted in the two major browsers Chrome and Firefox were not able to play the theora stream. The built in players will just produce a green blob for video. The only two players that would play the stream was ffplay and VLC. VLC will also spit out errors, which I believe are similar to what ffplay is producing when logging is turned on.
Since Gstreamer also produces the same results I couldn't use theora and had to switch to vp8/vorbis stream in a webm container with Gstreamer pushing directly to the icecast server. This worked well, in both players and browsers with considerable image quality improvement. Just at a heavy CPU cost.

@toots
Copy link
Member

toots commented Jul 2, 2018

Liquidsoap uses the theora library directly without the need for gstreamer. Considering that the same message occurs with streams created with gstreamer, which is prolly a totally different workflow, I'm tempted to assume that this is a bug with the decoder and not the encoder(s).

@autonarcosis
Copy link
Author

ffmpeg does not produce these errors and the video works for all clients.

@toots
Copy link
Member

toots commented Jul 2, 2018

Interesting. I'll have a look at their code.

@toots
Copy link
Member

toots commented Jul 2, 2018

Could you try with this:

output.harbor(%ogg(%theora(keyframe_frequency=2,quality=25,width=320,height=240),%vorbis),format="video/ogg",mount="/teste",mksafe(mainsource))

@autonarcosis
Copy link
Author

Firefox v60,0.2 will play the stream but only after pausing the stream and starting it again.

ffplay produces the same errors as above in initial report but will play the stream.

VLC produces no errors, plays the stream.

Chrome v67.0.3396.99 is the most troublesome on if it will play the stream or not. Pressing pause and play repeatedly and waiting up to a minute, it might play a minute of the stream then stop again.

Using the ffmpeg command below to stream to Icecast server produces no errors in ffplay, plays correctly in Chrome and Firefox and VLC.

$ffmpeg -re -i videofile -f ogg -content_type video/ogg -c:v libtheora -qscale:v 7 -c:a libvorbis -qscale:a 5 icecast://source:yourpasswordhere@localhost:8000/teste

@toots
Copy link
Member

toots commented Aug 15, 2018

I can reproduce now. Also shown in mplayer. Will try to have a look at it.

@toots
Copy link
Member

toots commented Aug 19, 2018

I've tried many different tweaks to no avail. I'm not sure what we're doing differently from ffmpeg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants