Gstreamer 1.0 image/video player. Which way to implement? - c

I have a list of files (videos and images) I would like to show on the screen using gstreamer 1.0, means iterating over the elements (file paths) in the list and "play" them sequentially in the c application with "delays" e. I tried different examples which partly work, but I cannot get the whole picture together to implement.
So what is the conceptual solution for this? Should I use one "dynamic" pipeline or two (one for images - because I think here is imagefreeze before videoconvert necessary and one for video)? And how can I use decodebin to detect the format of the media automatically? decodebin works from the command line, but with errors like no video decoder found for 'jpeg' in c application?

Try to make universal pipeline (or two for videos and images). i.e. you put to input any file from your list and get output video or image. This pipeline(s) should works from gst-launch. After that try to implement this pipeline in to C code, or write pipeline here.
My way:
Take file from list. If image -> create image decode pipeline, if video -> create video decode pipeline. Delete pipeline. Delay. Go to next file.

Related

How can I detect visual blocks in a PDF?

I'm trying to OCR resumes. My first problem is, before OCR, to get the main blocks of a document.
Since all the resumes have "visual blocks" (referring to professional experience, skills, languages, hobbies, whatever ...), I wonder if there's any open source solution to "split" into "blocks" a document, obviously no matter the layout design (that's where some kind of AI will work, I assume)
Thank you
First decompress your pdf using zlib.
you will then be able to see the pdf in a readable format - https://web.archive.org/web/20141010035745/http://gnupdf.org/Introduction_to_PDF#A_first_example
The pdf format is kind of similar to postscript.
also try converting your pdf to postscript to see how contents are arranged.
you can decompress the pdf using pdf-parser https://blog.didierstevens.com/2008/10/30/pdf-parserpy/
try this as well - https://gist.github.com/averagesecurityguy/ba8d9ed3c59c1deffbd1390dafa5a3c2
Once you can see how your data is presented => you can then start applying alogorithms to extract more meaning.

Avoid open video file after playblast

I'm finishing a script that playblasts several pieces of animation into different movie files. It works fine but I'd like it to NOT open all the video files once it is done playblasting them.
Can't find that option even inside maya playblast options itself... Any light on that?
You need to pass the viewer flag to false, are you doing playblast via code ? if so check this doc

WPF M3U8 STREAMING

ive got link like this "http://trwamtv.live.e96-jw.insyscd.net/trwamtv.smil/playlist.m3u8" and I would like to stream it inside mediaelement ? is there anyone who knows how to do it ?
The MediaElement doesn't support M3U files inherently. M3Us are playlists, not media files (http://en.wikipedia.org/wiki/M3U). It may be possible to drill down through the playlist files until you get to actual media files, queue these, then have MediaElement play them.
The playlist file you've provided contains three separate links to different resolution versions of the same video clip:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=950000,RESOLUTION=960x540
chunklist_b950000.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=500000,RESOLUTION=640x360
chunklist_b500000.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=250000,RESOLUTION=320x180
chunklist_b250000.m3u8
Notice that each of the 'chunklist' references are to further M3U playlists. Replacing 'playlist.m3u8' in your link with 'chunklist_b950000.m3u8' provides a further playlist file which contains references to 3 MPEG_TS files:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:12
#EXT-X-MEDIA-SEQUENCE:21565
#EXTINF:10.0,
media-urj3zh3ic_b500000_21565.ts
#EXTINF:10.0,
media-urj3zh3ic_b500000_21566.ts
#EXTINF:10.0,
media-urj3zh3ic_b500000_21567.ts
The WPF MediaElement doesn't support Transport Stream (.ts) files. Unfortunately you'll need to look elsewhere for a solution. I'd recommend looking into Vlc.Dotnet, the WPF MediaKit, MPlayer.Net, or some other third party media control.

Advanced Merge File Content

I am under Windows and I am using Sublime2 Text Editor (i can download and use any other software) or PHP script.
Now, I am searching for solution to advance merge two files (or lines at one file, no matter). KEY - is the same part of two files
sourcefileone.txt:
KEY|CCC
sortcefiletwo.txt
KEY|BBB
Need to merge and receive this:
KEY|BBB|CCC
Any Solution? thanks
seems there is no ready solution. To solve the problem I already wrote php code that load to files in array, than explode them and merge in the new format at new array.

simple C graphic library for demo a matrix

I have been asked to display a pretty big matrix like 200*300. It's kind ugly when i output this to console..
The matrix is changing during an iteration, I have to show this as well.
I wonder if there is a simple tool I can use to display this matrix?
hopefully, I can call it in my C program.
I don't have any graphic programming experience.
Thanks!
Try GNUPlot:
OSX Installation:
http://www.miscdebris.net/blog/2009/09/16/install-gnuplot-on-mac-os-x/
Project Homepage:
http://www.gnuplot.info/download.html
I have used it in numerous projects. It is very easy to generate plots. In your case, you could just create a scatter plot, and export it to JPEG in a few simple steps.
If you don't want to have to build and integrate it into your application, you can just send commands via the "system" function to a prebuilt GNUPlot application.
http://www.cplusplus.com/reference/clibrary/cstdlib/system/
You could use SDL (libsdl.org) to make a display window and output each character as a pixel on the window.
Here is a test app so you can take a look at how it works:
http://friedspace.com/SDLTest.c
I really don't think you want to go into a graphics library for this. Instead, I would suggest dumping the data to an output file, and handling it from there.
For one, you could just format it to fixed-width fields, and view the text file with a text editor:
000 001 002
099 098 097
...
Or, you could consider dumping it as CSV, and importing it into something like Excel.

Resources