Single-image slideshow

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

Single-image slideshow

Andy Robinson
I feel a bit stupid asking this question but I've googled around and
experimented and can't find the answer.

I have a single jpeg image and an mp3 audio file.

I want to use gst-launch to put them together into a video which simply
displays the image while the audio is playing.

I'm sure it must be trivially simple but if someone could point me in
the right direction I'd be grateful.

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Single-image slideshow

Arjen Veenhuizen
Out the top of my mind you can try something like this (untested):
gst-launch-1.0 mp4mux name=mux ! queue ! filesink location=test.mp4 filesrc location=image.jpg ! jpegdec ! imagefreeze ! x264enc ! mux. filesrc location=audio.mp3 ! mux.
Reply | Threaded
Open this post in threaded view
|

Re: Single-image slideshow

Andy Robinson
On 29/07/16 17:12, Arjen Veenhuizen wrote:

> Out the top of my mind you can try something like this (untested):
>
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Single-image-slideshow-tp4678902p4678903.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>

Er, there is no example code here ???

I seem to remember someone saying that nabble is broken?

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Single-image slideshow

Andy Robinson
In reply to this post by Arjen Veenhuizen
On 29/07/16 17:12, Arjen Veenhuizen wrote:
> Out the top of my mind you can try something like this (untested):
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Single-image-slideshow-tp4678902p4678903.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.

Thanks for this - I found the example by clicking on the http link
above, of course, which for the benefit of anyone else was:

gst-launch-1.0 mp4mux name=mux ! queue ! filesink location=test.mp4
filesrc location=image.jpg ! jpegdec ! imagefreeze ! x264enc ! mux.
filesrc location=audio.mp3 ! mux.

I was unaware of imagefreeze and it looks very relevant.

I had to add a couple of elements to make it link and run, and added
some small tweaks, giving this which does run:

gst-launch-1.0 mp4mux name=mux ! queue ! filesink
location=BringThatThing.mp4 filesrc location=IMG_2226.JPG ! jpegdec !
imagefreeze ! video/x-raw,framerate=1/10 ! x264enc ! mux. filesrc
location=btt.mp3 ! decodebin ! voaacenc bitrate=256000 ! mux.

However it appears to run forever, generating an ever growing output
file. I don't know what is in there because if I stop it with ctrl-C the
op file won't play.

Any idea what it is doing, and how to stop it doing it?

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Single-image slideshow

Arjen Veenhuizen
You can add -e to gst-launch-1.0 to make the pipeline emit an EOS just before shutting it down using control+c (which is required when using mp4mux), e.g.:

gst-launch-1.0 -e mp4mux name=mux ! queue ! filesink
location=BringThatThing.mp4 filesrc location=IMG_2226.JPG ! jpegdec !
imagefreeze ! video/x-raw,framerate=1/10 ! x264enc ! mux. filesrc
location=btt.mp3 ! decodebin ! voaacenc bitrate=256000 ! mux.

The problem is that the video source will run indefinitely. Not sure how you can make it stop after a specific number of frames or duration (see also http://gstreamer-devel.966125.n4.nabble.com/Stopping-command-line-gst-launch-after-processing-certain-no-of-frames-td3919867.html) I think you will have to write some code to get that kind of functionality.
Reply | Threaded
Open this post in threaded view
|

Re: Single-image slideshow

Andy Robinson
On 31/07/16 13:55, Arjen Veenhuizen wrote:

> You can add -e to gst-launch-1.0 to make the pipeline emit an EOS just before
> shutting it down using control+c (which is required when using mp4mux),
> e.g.:
>
> gst-launch-1.0 -e mp4mux name=mux ! queue ! filesink
> location=BringThatThing.mp4 filesrc location=IMG_2226.JPG ! jpegdec !
> imagefreeze ! video/x-raw,framerate=1/10 ! x264enc ! mux. filesrc
> location=btt.mp3 ! decodebin ! voaacenc bitrate=256000 ! mux.
>
> The problem is that the video source will run indefinitely. Not sure how you
> can make it stop after a specific number of frames or duration (see also
> http://gstreamer-devel.966125.n4.nabble.com/Stopping-command-line-gst-launch-after-processing-certain-no-of-frames-td3919867.html)
> I think you will have to write some code to get that kind of functionality.


I've added the -e

andy@ubuntu:~/Temp0$ gst-launch-1.0 -e mp4mux name=mux ! queue !
filesink location=BringThatThing.mp4 filesrc location=IMG_2226.JPG !
jpegdec ! imagefreeze ! video/x-raw,framerate=1/10 ! x264enc ! mux.
filesrc location=btt.mp3 ! decodebin ! voaacenc bitrate=256000 ! mux.
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Interrupt while waiting for EOS - stopping pipeline...
Execution ended after 0:00:15.623976289
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
andy@ubuntu:~/Temp0$

The first time I hit ctrl-C it says "Waiting for EOS..." but the op file
continues growing rapidly. The second time I hit ctrl-C it stops but the
op file is again unplayable.

I don't really want to have to specify a time for it to stop, I just
want it to stop when the source audio file is finished. But it seems
that even if I did specify the length in seconds, there is still no way
to do it with gst-launch. Oh well, never mind. Thanks for the help.

There are any number of videos on YouTube consisting of a static image
while the music plays, which is the kind of video I wanted to be able to
generate.

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel