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 748947 - playout: New example for seamless audio/video playback
playout: New example for seamless audio/video playback
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 748946
Blocks:
 
 
Reported: 2015-05-05 12:53 UTC by Nirbheek Chauhan
Modified: 2015-06-12 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
playout: New example for seamless audio/video playback (40.81 KB, patch)
2015-05-05 12:53 UTC, Nirbheek Chauhan
none Details | Review
playout: New example for seamless audio/video playback (40.80 KB, patch)
2015-05-05 13:03 UTC, Nirbheek Chauhan
none Details | Review
playout: New example for seamless audio/video playback (40.80 KB, patch)
2015-05-08 14:06 UTC, Nirbheek Chauhan
none Details | Review
playout: New example for seamless audio/video playback (40.93 KB, patch)
2015-05-08 18:55 UTC, Nirbheek Chauhan
none Details | Review
playout: New example for seamless audio/video playback (41.42 KB, patch)
2015-05-08 20:13 UTC, Nirbheek Chauhan
committed Details | Review

Description Nirbheek Chauhan 2015-05-05 12:53:57 UTC
Created attachment 302922 [details] [review]
playout: New example for seamless audio/video playback

An example app that takes video URIs as command line arguments and switches
between them seamlessly one after the other using compositor and audiomixer.
Both audio-video and video-only media files are valid inputs, but mixing files
of both types in a single invocation is cumbersome to support, and hence does
not work. The example attempts to keep the audio stream moving along perfectly,
and duplicates video frames where necessary to cover gaps in the video
timestamps using the 'aggregate-eos' videoaggregator pad property.

Ensuring seamless (and mostly-glitch-free) switching is harder than it sounds,
and hence the example contains plenty of pad probes and running time
calculations to make things work.

The GPtrArray play_queue contains items that are being played back, have been
prepared for playback, and will be played back in the future. The queue itself
is mutable besides the first two items (playing and prepared). The item that has
been prepared should not be edited or removed since it has been prepared in
advance to be activated immediately on the current item's EOS.

The example also has support for switching to the next item in the queue
prematurely; see the --switch-after/-s flag to the application.

Note: the output video is hard-coded at 1280x720, and input video is scaled as
needed to fit this size. Set OUTPUT_VIDEO_WIDTH/HEIGHT to change this.
Comment 1 Nirbheek Chauhan 2015-05-05 13:03:49 UTC
Created attachment 302925 [details] [review]
playout: New example for seamless audio/video playback

Fix copyright notice (wrong year)
Comment 2 Nirbheek Chauhan 2015-05-08 14:06:01 UTC
Created attachment 303081 [details] [review]
playout: New example for seamless audio/video playback

"aggregate-eos" was renamed to "ignore-eos"
Comment 3 Nirbheek Chauhan 2015-05-08 18:55:48 UTC
Created attachment 303098 [details] [review]
playout: New example for seamless audio/video playback

Add a check to fail while activating an item if there's no available pads on it.
Comment 4 Nirbheek Chauhan 2015-05-08 20:13:01 UTC
Created attachment 303103 [details] [review]
playout: New example for seamless audio/video playback

Fix incorrect last item freeing when the last pad in that item is an audio pad. The last pad is usually the video pad due to buffering in the audio sink. Also rename a function, remove redundant parameters in other, similar functions, etc.
Comment 5 Tim-Philipp Müller 2015-06-12 19:49:54 UTC
Cool, pushed:

commit 5da10b4f57f5f1a9490873f4f13302c03ece3e09
Author: Nirbheek Chauhan <nirbheek@centricular.com>
Date:   Thu Jan 29 00:56:26 2015 +0000

    playout: New example for seamless audio/video playback
    
    An example app that takes video URIs as command line arguments and switches
    between them seamlessly one after the other using compositor and audiomixer.
    Both audio-video and video-only media files are valid inputs, but mixing files
    of both types in a single invocation is cumbersome to support, and hence does
    not work. The example attempts to keep the audio stream moving along perfectly,
    and duplicates video frames where necessary to cover gaps in the video
    timestamps using the 'ignore-eos' videoaggregator pad property.
    
    Ensuring seamless (and mostly-glitch-free) switching is harder than it sounds,
    and hence the example contains plenty of pad probes and running time
    calculations to make things work.
    
    The GPtrArray play_queue contains items that are being played back, have been
    prepared for playback, and will be played back in the future. The queue itself
    is mutable besides the first two items (playing and prepared). The item that has
    been prepared should not be edited or removed since it has been prepared in
    advance to be activated immediately on the current item's EOS.
    
    The example also has support for switching to the next item in the queue
    prematurely; see the --switch-after/-s flag to the application.
    
    Note: the output video is hard-coded at 1280x720, and input video is scaled as
    needed to fit this size. Set OUTPUT_VIDEO_WIDTH/HEIGHT to change this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748947