Bin bin = Bin.launch("tee name=t t. ! queue ! videoconvert ! autovideosink "
+ "t. ! queue ! videoconvert ! videoscale ! capsfilter caps=video/x-raw,width=640,height=480 ! appsink name=appsink "
+ "t. ! queue ! videoconvert ! avenc_mpeg4 ! mp4mux ! filesink location=./farshids2.mp4 " , true);
I am currently updating the MultiSinkExample.java that came with the package.
I am trying to display and at the same time save the video by using the above "bin." I can display the source which is an IP camera.
I do get the farshid2.mp4 with some volume created. The file size is some where between 2 to 5 meg but then I cannot play it (via QuickTime). I tried on VLC as well, nothing.
Any idea?
Thanks,
Farshid
The first thing I can think of is that MP4 files can not be played without an moov atom, and you can't compute the moov atom until you have all of the video and audio samples (unless you are using moof fragments instead of moovs). Are you sure you closed all the streams and made them finish writing all the mp4 atoms? I'm not actually sure what API calls do this.
--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gstreamer-java+unsubscribe@googlegroups.com.
To post to this group, send email to gstreamer-java@googlegroups.com.
Visit this group at https://groups.google.com/group/gstreamer-java.
For more options, visit https://groups.google.com/d/optout.
When using get-launch the -e argument tells it to close the file on shutdown. This probably works with bin.launch too.
Stuart
Thanks for your response. I am not really tied up to any specific format (MP4 or else), I just want to save the video (any format, and the least amount of storage space should be fine). Meanwhile, I will look at the moovs and moof fragments. If you have ideas on saving with other format, I am all ears, and would like to hear your suggestions. Thanks, Farshid
On Mon, Apr 16, 2018 at 11:37 AM, Bob F <thot...@gmail.com> wrote:
The first thing I can think of is that MP4 files can not be played without an moov atom, and you can't compute the moov atom until you have all of the video and audio samples (unless you are using moof fragments instead of moovs). Are you sure you closed all the streams and made them finish writing all the mp4 atoms? I'm not actually sure what API calls do this.
--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gstreamer-java+unsubscribe@googlegroups.com.
To post to this group, send email to gstream...@googlegroups.com.
Visit this group at https://groups.google.com/group/gstreamer-java.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gstreamer-java+unsubscribe@googlegroups.com.
To post to this group, send email to gstreamer-java@googlegroups.com.
Visit this group at https://groups.google.com/group/gstreamer-java.
For more options, visit https://groups.google.com/d/optout.
Bin bin = Bin.launch("tee name=t t. ! queue ! videoconvert ! autovideosink "
+ "t. ! queue ! videoconvert ! videoscale ! capsfilter caps=video/x-raw,width=640,height=480 ! appsink name=appsink "
Tried to use the "-e" in the following bin :Bin bin = Bin.launch("tee name=t t. ! queue ! videoconvert ! autovideosink "
+ "t. ! queue ! videoconvert ! videoscale ! capsfilter caps=video/x-raw,width=640,height=480 ! appsink name=appsink "
+ "t. ! queue ! videoconvert ! avenc_mpeg4 ! mp4mux ! filesink location=./farshids2.mp4 " , true);I kept getting syntax error.Any suggestion on where I should introduce the "-e" on the bin object?
gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=50 ! queue ! x264enc ! mp4mux ! filesink location=video.mp4
WARNING: erroneous pipeline: no element "v4l2src"
Here is my result from executing teh following command line command :gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=50 ! queue ! x264enc ! mp4mux ! filesink location=video.mp4
WARNING: erroneous pipeline: no element "v4l2src"
I get teh error message "no element "v4l2src"
I issue the following, using, the gst-launch-1.0 and it worked fine with the "-e" flag. Note I used the gst-launch-1.0 one that is located in the "Library" folder (some where under there)
/Library/Frameworks/GStreamer.framework/Commands/gst-launch-1.0 -e autovideosrc num-buffers=50 ! queue ! x264enc ! mp4mux ! filesink location=video.mp4
It worked fine and I was able to play mp4 file.
Then I tried to the following:
sudo gst-launch-1.0 autovideosrc num-buffers=50 ! queue ! x264enc ! mp4mux ! filesink location=video.mp4
WARNING: erroneous pipeline: no element "x264enc"
Then I did "which gst-launch-1.0". it seams that the get-launch-1.0 is at different place
Farshid-MacBook-Pro:/ farshid$ which gst-launch-1.0
/usr/local/bin/gst-launch-1.0
Farshid- -MacBook-Pro:/ farshid$ ls -al /usr/local/bin/gst-launch-1.0
lrwxr-xr-x 1 farshid admin 47 Mar 21 15:55 /usr/local/bin/gst-launch-1.0 -> ../Cellar/gstreamer/1.14.0_1/bin/gst-launch-1.0
/usr/local/bin/gst-launch-1.0 --version
gst-launch-1.0 version 1.14.0
GStreamer 1.14.0
Unknown package origin
Is this normal? "Unknown Package Origin"
Thanks for your suggestions and support. I made some progress but something is not kosher on the Mac Installation of gstreamer.
...
/Library/Frameworks/GStreamer.framework/Commands/gst-launch-1.0 -e autovideosrc num-buffers=50 ! queue ! x264enc ! mp4mux ! filesink location=video.mp4
...
sudo gst-launch-1.0 autovideosrc num-buffers=50 ! queue ! x264enc ! mp4mux ! filesink location=video.mp4
...
Farshid-MacBook-Pro:/ farshid$ which gst-launch-1.0
/usr/local/bin/gst-launch-1.0
The reason being is that all the installed files have the "Admin" permission.
One more question, how can I add the "-e" flag/option to a pipeline as you suggested.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library: gstreamer
at org.freedesktop.gstreamer.lowlevel.GstNative.load(GstNative.java:56)
at org.freedesktop.gstreamer.lowlevel.GstNative.load(GstNative.java:46)
at org.freedesktop.gstreamer.lowlevel.GstAPI.<clinit>(GstAPI.java:36)
at org.freedesktop.gstreamer.Gst.init(Gst.java:295)
at org.freedesktop.gstreamer.Gst.init(Gst.java:262)
at org.freedesktop.gstreamer.examples.MultiSinkExample.main(MultiSinkExample.java:50)