I use ros and sample .bag files. I try to create my own .bag file from my images or video data. How can I do it?
This guide says has a topic named "Recording and replaying bag files
" But it doesn't use images.
As mikkola said in his comment you need to publish your images to a topic. Once your images are being published, the rosbag record -O mybackfile.bag image-topic-name will record the images too.
If you are not publishing the images then you need to write an image publisher. In order to do that you must load each images with OpenCV, convert it to sensor_msgs::ImagePtr and send it via image_transport::Publisher. Here is a full example of an image publisher.
Related
If I have an image file that I want to save to a stream, I can do so by placing an TImage on the form and using it as a container, like so:
Image1.Bitmap.LoadFromFile('ExampleFile.png');
Image1.Bitmap.SaveToStream(mybytestream);
Is there an equivalent for audio content, some object I can place on the form to house an audio file? If not, how do I use SaveToStream with audio?
begin
var myaudio := TByteStream.Create;
myaudio.LoadFromFile( 'myaudiofile.mp3' );
// do something with myaudio data
myaudio.SaveToFile( 'myaudiofile2.mp3' );
myaudio.Free;
end;
Is this what you're looking for? The example you gave does not "house" the image loaded on the form, so it's hard to decipher your question vs. your example.
Audio files are usually VERY LARGE and you'd want to store a compressed version as a resource in the app. But you'd want to use an audio player that can play a compressed file in the specified format saved in a run-time buffer like a TStream.
Yes, you can use a TImageList to save small images to your form, and it's loaded up when the program starts executing. You could create something like that to hold short audio samples like dings and chimes, but I wouldn't do it for something like an audiobook.
(People often ask how to attach a video to a PDF file, and they don't really think about the fact that the resulting PDF file may easily end up being over a gigabyte in size!)
You're better off having a folder that contains the audio clips, then loading them into an array of streams when the program starts up. That would be the simplest analogy to a TImageList but without the files being saved in the app itself.
An alternative might be to put the audio files into a zip file. Then you could attach the zip file as a resource to the app and extract the files from it. That would make it easier to build the app since you could change the contents of the zip file without having to change your build process at all.
Just be careful of referring to audios by name that might not be there. (This is a common problem that affects the use of fonts that may be attached to an app, and referring to one that's not there.)
I am working on a ROS project and struggling with this problem.
Currently, I am using aruco_ros.
https://github.com/pal-robotics/aruco_ros
I have a bag file that contains raw images, and I want to get published topics from aruco_ros based on the file. So, I modified single.launch like below.
or
And then, I did this.
$ roslaunch aruco_ros single.launch
However, I could receive nothing from all published topics. From rviz, I recognized that image from aruco_ros is located at image/debug, so I modified the path to "/camera/color/image_raw" after writing a command
$ rosbag play -l my_bag.bag
At rviz, the image is well displayed, but the published topics are still emtpy.
I tried multiple attempts but I have no idea how this will work. Could you help me out?
After export images (after Preprocessing and Augmentation), didn't get all images. Roboflow generate 721 images and after export (in zip) only got 30 images.
Hi can you please invite help#roboflow.com to your public project and share the name of your workspace as a response here, so we may investigate further.
Would also be helpful to know what export format was selected
Sometimes it is useful to download a stream into our local machine.
Reasons could be
To make a manual modification to the manifest
For getting fast access to files of a server with poor networking.
If we try to use curl or wget to download the asset which is pointed by the URL for the stream, we end up downloading a small text file. It is surely not the video asset.
So how can we download the stream itself?
The actual script which does the download is given in the link at the bottom of my answer. But before we proceed to the how-to, let's first understand the steps for downloading a stream.
Without going into too much details, the URL pointing to the stream is typically named with the m3u8 extension. That file is called the manifest of the stream and is actually a text file containing, among other things, a list of pairs: a bitrate and a corresponding URL for the matching playlist file. Here is an excerpt from a manifest file:
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=380600,CODECS="avc1.4d00c,mp4a.40.2",RESOLUTION=320x180
http://f24hls-i.akamaihd.net/hls/live/221193-b/F24_EN_LO_HLS/master_250.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=655600,CODECS="avc1.77.30,mp4a.40.2",RESOLUTION=640x360
http://f24hls-i.akamaihd.net/hls/live/221193/F24_EN_LO_HLS/master_500.m3u8
A playlist file is another text file which tell the player which TS file is to be playing on each position of the playback head.
Here is the beginning of a typical playlist file:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:303165
#EXTINF:10.000,
20170216T114458/master_500/00151/master_500_01165.ts
#EXTINF:10.000,
20170216T114458/master_500/00151/master_500_01166.ts
So after downloading the playlist file for each of the bitrates, we can start downloading the TS files required to play the stream at each of the possible bitrates.
All this is done using a quite simple and self-explaining script which I was putting in GitHub: https://github.com/ishahak/HLS_Downloader
I hope it will be useful for others.
You can simply use ffmpeg. Like this:
fmpeg -i "http://somewhere.com/video.m3u8" -c copy -bsf:a aac_adtstoasc output.mp4
Is it possible to remove watermark placed with imagemagick library in past?
Thanks ;)
Update
I mean, I need to remove my logo from images. Can't find in official documentation, how to remove watermark from image.
Yes, if you restore the original file directory from a backup. I'm presuming that you've rendered a single-layered file, where IM composited/overlayed the watermark on the image. There is no reliable and practical way to remove such a mark generally manually, let alone via batch process. Exceptions might include if the watermark always rendered over a flat color, etc.
The logo can be removed easily using ffmpeg, by using its delogo filter. All you need to supply is the co-ordinates and dimensions of the logo present on the video.
This works on videos very swiftly, you can convert your image to a video and apply this filter, or even compile group of images to a video and later break it into frames to obtain clean images. All of this can be easily done using ffmpeg only.
eg for the filter syntax: ffmpeg -i (your video url) -f "delogo=x=0:y=0:w=100:h=77:band=10" -r (output file url)
Find the complete documentation here.