meso-unimpressed / darknet-net

A fork of darknet that is able to send detection data out via osc and websockets.
http://meso.design
Other
7 stars 1 forks source link

Cannot rename the named pipe #3

Closed tdurand closed 6 years ago

tdurand commented 7 years ago

Hi there !

Seems there is a bug with the named pipe, when I run the darknet with a custom name for the pipe like:

./darknet detector demo cfg/voc.data cfg/yolo-voc.cfg yolo-voc.weights -c 1 -address "ws://192.168.1.3" -port 8080 -videoOut 1 -videoOutPath "/tmp/custompipe" -pipe 1

The process doesn't stop to wait a read and though doesn't seem to send anything to a named pipe.

But it works if we use the default name like that:

./darknet detector demo cfg/voc.data cfg/yolo-voc.cfg yolo-voc.weights -c 1 -address "ws://192.168.1.3" -port 8080 -videoOut 1 -pipe 1

Then we can read the default pipe with ffmpeg

ffmpeg -i "./output.avi" <DO SOMETHING WITH STREAM>

Thanks

timonsku commented 7 years ago

Thanks for the report, I will take a look.

timonsku commented 7 years ago

I don't have the Jetson TX2 anymore so I'm unable to test this in a running system myself atm. I did look at the code and couldn't find anything that would prevent this. Can you check if the log prints out the correct path when you add the flag? It should print that pretty early on when you run darknet. https://github.com/meso-unconstructed/darknet-net/blob/master/examples/detector.c#L683

tdurand commented 7 years ago

I had looked on the code as well and didn't find anything either.

Yep, it does print it correctly:

videoPath:/tmp/custompipe, namedPipe:1, writeVideo:1, showWindow:0

But then it ouputs an error (sorry didn't noticed last time), just after loading the weight when It is suppose to wait for someone hooking on the pipe.

Setting up video out.

(darknet:7396): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
OpenCV Error: Unsupported format or combination of formats (Gstreamer Opencv backend does not support this file type.) in CvVideoWriter_GStreamer::open, file /home/nvidia/Documents/opencv/modules/videoio/src/cap_gstreamer.cpp, line 1534
VIDEOIO(cvCreateVideoWriter_GStreamer (filename, fourcc, fps, frameSize, is_color)): raised OpenCV exception:

/home/nvidia/Documents/opencv/modules/videoio/src/cap_gstreamer.cpp:1534: error: (-210) Gstreamer Opencv backend does not support this file type. in function CvVideoWriter_GStreamer::open

BTW consider this very low priority, I don't really need to rename the named pipe

timonsku commented 7 years ago

Ah, yes I think I know whats up. Gstreamer looks at the file extension to check which container it should use. Maybe try /tmp/custompipe.avi

tdurand commented 6 years ago

Yep, this works with the file extension .avi