I am building my first application with GStreamer, and my task is to get a stream from the internet, modify it (change pixels) with use of CUDA to compute frame in parallel, and output modified stream.
For simplicity, for now I use the MP4 video to read and write on disk and don't use CUDA.
I've found an example on this site:
https://fossies.org/linux/gst-plugins-base/tests/examples/app/appsink-src.c
to lay out the structure. Source and sink pipelines as arguments to gst_parse_launch():
"filesrc location=\"%s\" ! appsink name=testsink", input_filename
"appsrc name=testsource ! filesink location=\"%s\"", output_filename
The program works when no changes done to frames. But when I try to set the values in GstMapInfo.data, I can not open the video any more:
Windows Media Player cannot play the file. The Player might not support the file type or might not support the codec that was used to compress the file.
I was given a hint to use decoding, and I've found a decodebin element and added it to source pipeline without modifying sink:
"filesrc location=\"%s\" ! decodebin ! appsink name=testsink", input_filename
After that program works a lot longer and crashes with error:
(CudaGStreamer.exe:8428): GLib-ERROR **: gmem.c:100: failed to allocate 3110507 bytes
I've searched on google for the problem, but haven't found a solution yet, so I wondered maybe you can tell me what I am doing wrong.
Versions:
Windows 8.1 x64
Visual Studio 2015
gstreamer-1.0-devel-x86-1.12.3.msi
gstreamer-1.0-x86-1.12.3.msi
Both loaded from https://gstreamer.freedesktop.org
GTK+ 3.6.4 (patched)
GLib 2.34.3
GTK+ bundle loaded from http://www.tarnyko.net/repo/gtk3_build_system/gtk+-bundle_3.6.4-20130513_win32.zip