jgcramer
Posts: 8
Joined: Tue Aug 19, 2014 1:22 pm

Raspberry pi play shor movie's (.Net/Mono/DotNet)

Tue Aug 19, 2014 1:58 pm

Hello,

I have a Raspberry pi what i use to show information on a screen with different screens (jpegs) on it for eatch specific customer.

But now i wanne show short movie's on the Pi, when a specific customer is in front of the screen.

I use .Net to program with Mono on the Pi.

Now my question:
What is the best way to play the movie, also becasuse of the limits of the Pi.

dotnet, mono, .net


User avatar
RaTTuS
Posts: 10412
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Raspberry pi play shor movie's (.Net/Mono/DotNet)

Thu Aug 21, 2014 1:46 pm

omxplayer file.h264
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

jgcramer
Posts: 8
Joined: Tue Aug 19, 2014 1:22 pm

Re: Raspberry pi play shor movie's (.Net/Mono/DotNet)

Thu Aug 21, 2014 1:53 pm

RaTTuS wrote:omxplayer file.h264
This application runs stable and fast on the pi with mono?

I have googled but diddent find some DotNet helping files.

ghans
Posts: 7871
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Raspberry pi play shor movie's (.Net/Mono/DotNet)

Thu Aug 21, 2014 7:30 pm

This is a native Linux program which has to be spawned from
within Mono with something like exec() (PHP) or subprocess.call()
(Python). No idea how that is called in C#.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

jgcramer
Posts: 8
Joined: Tue Aug 19, 2014 1:22 pm

Re: Raspberry pi play shor movie's (.Net/Mono/DotNet)

Fri Aug 22, 2014 7:11 am

Ok!

And if i want to split my screen? (Upper screen movie, lower screen picture. With DotNet within mono.

forenbenutzer
Posts: 148
Joined: Thu Aug 02, 2012 7:08 pm

Re: Raspberry pi play shor movie's (.Net/Mono/DotNet)

Fri Aug 22, 2014 7:17 am

You can pass parameters to omxplayer, like coordinates X and Y, aswell as width (X2 = X1 + width) and height (Y2 = Y1 + height):

Code: Select all

Usage: omxplayer [OPTIONS] [FILE]
Options :
         -h / --help                    print this help
         -n / --aidx  index             audio stream index    : e.g. 1
         -o / --adev  device            audio out device      : e.g. hdmi/local
         -i / --info                    dump stream format and exit
         -s / --stats                   pts and buffer stats
         -p / --passthrough             audio passthrough
         -d / --deinterlace             deinterlacing
         -w / --hw                      hw audio decoding
         -3 / --3d mode                 switch tv into 3d mode (e.g. SBS/TB)
         -y / --hdmiclocksync           adjust display refresh rate to match video (default)
         -z / --nohdmiclocksync         do not adjust display refresh rate to match video
         -t / --sid index               show subtitle with index
         -r / --refresh                 adjust framerate/resolution to video
         -g / --genlog                  generate log file
         -l / --pos n                   start position (in seconds)
              --boost-on-downmix        boost volume when downmixing
              --vol n                   Set initial volume in millibels (default 0)
              --subtitles path          external subtitles in UTF-8 srt format
              --font path               subtitle font
                                        (default: /usr/share/fonts/truetype/freefont/FreeSans.ttf)
              --font-size size          font size as thousandths of screen height
                                        (default: 55)
              --align left/center       subtitle alignment (default: left)
              --lines n                 number of lines to accommodate in the subtitle buffer
                                        (default: 3)
              --win "x1 y1 x2 y2"       Set position of video window
              --audio_fifo  n           Size of audio output fifo in seconds
              --video_fifo  n           Size of video output fifo in MB
              --audio_queue n           Size of audio input queue in MB
              --video_queue n           Size of video input queue in MB
For example upper half of full hd (1920x1080) screen:

Code: Select all

omxplayer --win "0 0 1920 540" myfile.mp4
Attention: omxplayer "overlays" your current application. If you create your user interface, be sure to not locate any interactive controls in the area you would like to have your video.

In c# mono it might be something like this:

Code: Select all

Process.Start(new ProcessStartInfo("/usr/bin/omxplayer", "--win \"0 0 1920 540\" myfile.mp4") { UseShellExecute = false });
Pitendo - Case And Emulator Project - http://edv-huber.com/index.php/problemloesungen/12-pitendo

jgcramer
Posts: 8
Joined: Tue Aug 19, 2014 1:22 pm

Re: Raspberry pi play shor movie's (.Net/Mono/DotNet)

Fri Aug 22, 2014 8:51 am

@forenbenutzer thank you, this must work!

Return to “General programming discussion”