After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 707242 - qtmux: streamable and faststart property have no effect
qtmux: streamable and faststart property have no effect
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.x
Other Linux
: Normal blocker
: 1.2.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-01 20:12 UTC by Nicola
Modified: 2013-09-20 08:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
qtmux: deprecate the streamable property for non-fragmented MP4 (2.27 KB, patch)
2013-09-17 10:26 UTC, Andoni Morales
needs-work Details | Review
qtmux: make "streamable" TRUE as default (1.16 KB, patch)
2013-09-17 10:26 UTC, Andoni Morales
needs-work Details | Review
qtmux: handle issues correctly when downstream is not seekable (2.22 KB, patch)
2013-09-17 10:26 UTC, Andoni Morales
accepted-commit_now Details | Review
qtmux: make "streamable" TRUE as default (2.71 KB, patch)
2013-09-19 16:41 UTC, Andoni Morales
none Details | Review
qtmux: make "streamable" TRUE as default (2.71 KB, patch)
2013-09-19 16:44 UTC, Andoni Morales
accepted-commit_now Details | Review
qtmux: deprecate the streamable property for non-fragmented MP4 (2.82 KB, patch)
2013-09-19 17:51 UTC, Andoni Morales
committed Details | Review
qtmux: make "streamable" TRUE as default (2.28 KB, patch)
2013-09-19 17:51 UTC, Andoni Morales
committed Details | Review
qtmux: handle issues correctly when downstream is not seekable (2.22 KB, patch)
2013-09-19 17:51 UTC, Andoni Morales
none Details | Review
qtmux: handle issues correctly when downstream is not seekable (2.57 KB, patch)
2013-09-19 17:53 UTC, Andoni Morales
committed Details | Review

Description Nicola 2013-09-01 20:12:39 UTC
please try this pipeline:

gst-launch-1.0 -e videotestsrc num-buffers=1000 ! jpegenc ! qtmux streamable=1 ! filesink location=/tmp/test.mov

the file test.mov is not playable until I stop the pipeline, if I change qtmux with matroskamux, the file is playable without waiting for the pipeline to finish (CTRL+C).

Additionally the following pipeline produce two identical files:

gst-launch-1.0 videotestsrc ! jpegenc ! qtmux streamable=true ! filesink location=/tmp/test1.mov

gst-launch-1.0 videotestsrc ! jpegenc ! qtmux streamable=false ! filesink location=/tmp/test.mov

so streamable property make no difference, using matroskamux instead of qtmux produce, as expected, file with different sizes, setting streamable=true produce a smaller file (no index) and the file is playable while the pipeline is still writing to the file. 

I don't know if this is a isomp4 limitation, if so streamable property should be removed from qtmux
Comment 1 Sebastian Dröge (slomo) 2013-09-02 08:54:50 UTC
Confirmed with git master, it seems like streamable does not cause the correct headers to be generated anymore.
Comment 2 Thiago Sousa Santos 2013-09-02 12:56:44 UTC
What are you trying to achieve with qtmux? The streamable property seems to only make sense to be used when fragmented output is enabled.
Comment 3 Nicola 2013-09-02 13:01:55 UTC
for example use qtmux to write to a socket (that is not seekable), matroskamux support this use case properly
Comment 4 Thiago Sousa Santos 2013-09-03 11:34:56 UTC
Are you streaming it 'live'?

isomedia (qt / mp4 / ...) aren't suitable for live streaming unless you are using the fragmented version.

It can be streamable, but not live, if you enable the fast-start mode. In this mode it will write the headers first (at the cost of writing data to a temp file and pushing it all at the end) and the resulting file can be played as it is downloaded. Without fast-start, the file has the headers in the end, making players only able to start playback when they reach the end of the file.
Comment 5 Nicola 2013-09-03 11:51:05 UTC
yes I'm streaming live, I'll stay with mkv, however streamable property seems useless for qtmux, maybe could be removed,


Nicola
Comment 6 Sebastian Dröge (slomo) 2013-09-03 15:32:38 UTC
Does it work for you if you use faststart=true?
Comment 7 Nicola 2013-09-03 15:44:01 UTC
no:

gst-launch-1.0 -e videotestsrc ! jpegenc ! qtmux streamable=true faststart=true ! filesink location=/tmp/test.mov

test.mov is not playable until I hit CTRL+C
Comment 8 Sebastian Dröge (slomo) 2013-09-03 16:00:34 UTC
Without streamable, ignore that.

gst-launch-1.0 -e videotestsrc ! jpegenc ! qtmux faststart=true ! decodebin ! xvimagesink

works fine here.
Comment 9 Nicola 2013-09-03 16:08:12 UTC
this does't work for me:

gst-launch-1.0 -e videotestsrc ! jpegenc ! qtmux faststart=true ! filesink location=/tmp/test.mov

gst-launch-1.0 playbin uri=file:///tmp/test.mov 
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind: Stream contains no data.
Additional debug info:
gsttypefindelement.c(1038): gst_type_find_element_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind:
Can't typefind empty stream
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

if you try the same with matroskamux streamable=true it will work fine and you'll be able to write a streamable mkv file over a network socket
Comment 10 Sebastian Dröge (slomo) 2013-09-04 08:28:24 UTC
Confirmed, it only worked for me because at EOS (num-buffers=1000 above) the complete file is pushed downstream. Apparently the faststart=true property on qtmux still lets it write to a temporary file and only on EOS push everything downstream. No data is pushed out of qtmux before EOS. This is a regression from 0.10 at least.
Comment 11 Andoni Morales 2013-09-04 11:17:00 UTC
The mp4 spec doesn't not support streaming at all, it's only supported for fragmented mp4 and using a protocol like DASH or Smooth Streaming, therefore it should only be available for mp4dashmux and ismlmux.
I propose deprecate the streamable property and make it only available for mp4dashmux and ismlmux.
The muxer also queries if downstream is seekable, setting streamable=FALSE, which is not correct either.
If it's regular mp4 and downstream is not seekable, the only option is to use faststart=TRUE becuase we can't rewrite the headers.
For ffmp4, if dowsntream is not seekable and faststart=FALSE than the only option is to use streamable=TRUE.
For ffmp4 I would set by default streamable=TRUE, because it's the regular scenario for DASH and Smooth Streaming. streamable=FALSe is only used to create ffmp4 files that can be used with manifest/playlist, including the moof's index box.
Comment 12 Andoni Morales 2013-09-04 11:18:10 UTC
(In reply to comment #11)
> ffmp4 files that can be used with manifest/playlist, including the moof's index
> box.

That can be used *without* manifest/playlist
Comment 13 Andoni Morales 2013-09-04 11:21:50 UTC
(In reply to comment #11)
> The muxer also queries if downstream is seekable, setting streamable=FALSE,
setting streamable=TRUE
Comment 14 Thiago Sousa Santos 2013-09-04 11:30:56 UTC
I was mid writing, but Andoni was faster and I agree with his suggestions.

Just for clarification:

fast-start makes qtmux create a 'fast start' file, making it put the headers at the beginning instead of putting them at the end. To be able to do this it saves all media data to a temporary file and only pushes everything downstream on EOS. That's when qtmux is able to generate headers with the full information about the samples.

The only option to stream isomedia live is to use fragmented versions, as Andoni pointed out.
Comment 15 Andoni Morales 2013-09-17 10:26:14 UTC
Created attachment 255084 [details] [review]
qtmux: deprecate the streamable property for non-fragmented MP4

The streamable property only makes sense for fragmented MP4.
Comment 16 Andoni Morales 2013-09-17 10:26:19 UTC
Created attachment 255085 [details] [review]
qtmux: make "streamable" TRUE as default

The most common use case for fragmented MP4 (Dash and Smooth Streaming)
is producing streamable content (even for VOD). streamable=FALSE would only
be used to generate fragmented MP4 with and index of MOOF's that could
be reproduced without a playlist/manifest
Comment 17 Andoni Morales 2013-09-17 10:26:23 UTC
Created attachment 255086 [details] [review]
qtmux: handle issues correctly when downstream is not seekable

The streamable property only make sense for fragmented formats.
For regular MP4, when downstream is not seekable we can't rewrite
the headers, so qtmux can only work with fast-start=TRUE, where
the headers are written finishing the file.
For fragmented MP4, when streamable is not seekable and the streamable
property is FALSE, we must enforce streamable=TRUE warning the user
about this change
Comment 18 Sebastian Dröge (slomo) 2013-09-19 16:33:50 UTC
Comment on attachment 255084 [details] [review]
qtmux: deprecate the streamable property for non-fragmented MP4

Additionally set_property should probably not do anything for the deprecated case. Can you add that?
Comment 19 Sebastian Dröge (slomo) 2013-09-19 16:35:38 UTC
Comment on attachment 255085 [details] [review]
qtmux: make "streamable" TRUE as default

Should only be TRUE for the fragmented formats by default, right?
Comment 20 Andoni Morales 2013-09-19 16:41:18 UTC
Created attachment 255314 [details] [review]
qtmux: make "streamable" TRUE as default

The most common use case for fragmented MP4 (Dash and Smooth Streaming)
is producing streamable content (even for VOD). streamable=FALSE would only
be used to generate fragmented MP4 with and index of MOOF's that could
be reproduced without a playlist/manifest
Comment 21 Andoni Morales 2013-09-19 16:44:12 UTC
Created attachment 255316 [details] [review]
qtmux: make "streamable" TRUE as default

The most common use case for fragmented MP4 (Dash and Smooth Streaming)
is producing streamable content (even for VOD). streamable=FALSE would only
be used to generate fragmented MP4 with and index of MOOF's that could
be reproduced without a playlist/manifest
Comment 22 Andoni Morales 2013-09-19 16:48:35 UTC
That won't apply in current master, let me rebase them first
Comment 23 Andoni Morales 2013-09-19 17:51:21 UTC
Created attachment 255324 [details] [review]
qtmux: deprecate the streamable property for non-fragmented MP4

The streamable property only makes sense for fragmented MP4.
Comment 24 Andoni Morales 2013-09-19 17:51:26 UTC
Created attachment 255325 [details] [review]
qtmux: make "streamable" TRUE as default

The most common use case for fragmented MP4 (Dash and Smooth Streaming)
is producing streamable content (even for VOD). streamable=FALSE would only
be used to generate fragmented MP4 with and index of MOOF's that could
be reproduced without a playlist/manifest
Comment 25 Andoni Morales 2013-09-19 17:51:31 UTC
Created attachment 255326 [details] [review]
qtmux: handle issues correctly when downstream is not seekable

The streamable property only make sense for fragmented formats.
For regular MP4, when downstream is not seekable we can't rewrite
the headers, so qtmux can only work with fast-start=TRUE, where
the headers are written finishing the file.
For fragmented MP4, when streamable is not seekable and the streamable
property is FALSE, we must enforce streamable=TRUE warning the user
about this change
Comment 26 Andoni Morales 2013-09-19 17:53:06 UTC
Created attachment 255327 [details] [review]
qtmux: handle issues correctly when downstream is not seekable

The streamable property only make sense for fragmented formats.
For regular MP4, when downstream is not seekable we can't rewrite
the headers, so qtmux can only work with fast-start=TRUE, where
the headers are written finishing the file.
For fragmented MP4, when streamable is not seekable and the streamable
property is FALSE, we must enforce streamable=TRUE warning the user
about this change
Comment 27 Sebastian Dröge (slomo) 2013-09-20 08:00:29 UTC
Still doesn't fix the original bug though, there's something wrong with the fast-start handling.

This never prerolls:
gst-launch-1.0 -e videotestsrc ! jpegenc ! qtmux faststart=true ! decodebin ! xvimagesink

with num-buffers=100 it prerolls after the 100 buffers are encoded.


Thiago?
Comment 28 Sebastian Dröge (slomo) 2013-09-20 08:04:19 UTC
Nevermind, missed Thiago's explanations. It's all good now :)