# How to play .avi and view jpg?

**URL:** <https://www.ruby-forum.com/t/how-to-play-avi-and-view-jpg/110449>\
**Category:** Ruby\
**Created:** [July 26, 2007, 1:45pm UTC](https://www.ruby-forum.com/t/how-to-play-avi-and-view-jpg/110449 "2007-07-26T13:45:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@arun](https://www.ruby-forum.com/u/arun)\
**Post date:** [July 26, 2007, 1:45pm UTC](https://www.ruby-forum.com/t/how-to-play-avi-and-view-jpg/110449/1 "2007-07-26T13:45:43Z")

</div>

I’m trying to write some client software that can play .avi videos,  
either in a window or full screen, as well as display photos. What is  
the best way to do this in Ruby? A library that works across platforms  
would be perfect, failing which, either Windows or Linux would do.

Thanks,  
Arun

---

<div class="post-metadata">

**Author:** ![arun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@arun](https://www.ruby-forum.com/u/arun)\
**Post date:** [July 26, 2007, 2:17pm UTC](https://www.ruby-forum.com/t/how-to-play-avi-and-view-jpg/110449/2 "2007-07-26T14:17:09Z")

</div>

On Jul 26, 7:40 am, arun [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m trying to write some client software that can play .avi videos,  
> either in a window or full screen, as well as display photos. What is  
> the best way to do this in Ruby? A library that works across platforms  
> would be perfect, failing which, either Windows or Linux would do.
> 
> Thanks,  
> Arun

The simplest thing you could do if you are targeting Windows platforms  
is look into the command line options for Windows Media Player and the  
Microsoft Pain apps. I have done some scripting that opens up Windows  
Media Player to play a selected media file and automatically close  
when done. I don’t have code handy right now, but googling Microsoft’s  
Knowledgebase should show you the proper command line options (http://  
[support.microsoft.com/KB/241422](http://support.microsoft.com/KB/241422)). Plus if you just pass the proper  
graphic file to Microsoft Paint as a command line argument that should  
achive something similar. Basically invoking Ruby’s system() method  
will facilitate this. Of course you could try all of the win32ole  
stuff, but this would seemingly complicate matters beyond what’s  
needed. Just my $0.02 US…

---

<div class="post-metadata">

**Author:** ![arun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@arun](https://www.ruby-forum.com/u/arun)\
**Post date:** [July 26, 2007, 4:01pm UTC](https://www.ruby-forum.com/t/how-to-play-avi-and-view-jpg/110449/3 "2007-07-26T16:01:44Z")

</div>

unsubscribe

---

<div class="post-metadata">

**Author:** ![arun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@arun](https://www.ruby-forum.com/u/arun)\
**Post date:** [July 26, 2007, 2:27pm UTC](https://www.ruby-forum.com/t/how-to-play-avi-and-view-jpg/110449/4 "2007-07-26T14:27:01Z")

</div>

Greg Kujawa wrote:

> The simplest thing you could do if you are targeting Windows platforms  
> is look into the command line options for Windows Media Player and the  
> Microsoft Pain apps. I have done some scripting that opens up Windows  
> Media Player to play a selected media file and automatically close  
> when done.  
> You could do something similar using mplayer, which would allow you to  
> target both windows and linux (and mplayer has lots and lots of command  
> line options available).

If you want to write your own mediaplayer then using the ruby/gstreamer  
bindings is probably the easiest way, although that would be linux  
specific.

Edwin

---

<div class="post-metadata">

**Author:** ![arun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@arun](https://www.ruby-forum.com/u/arun)\
**Post date:** [July 27, 2007, 3:16am UTC](https://www.ruby-forum.com/t/how-to-play-avi-and-view-jpg/110449/5 "2007-07-27T03:16:55Z")

</div>

On Jul 26, 2007, at 6:45 AM, arun wrote:

> I’m trying to write some client software that can play .avi videos,  
> either in a window or full screen, as well as display photos. What is  
> the best way to do this in Ruby? A library that works across platforms  
> would be perfect, failing which, either Windows or Linux would do.
> 
> Thanks,  
> Arun

You want cross platform?  
You should use VLC player for the .avi files, nothing is more cross  
platform than that. It’s a full blown app already with GUI hooks for  
many platforms. Open source, so you can use it and abuse it.  
Displaying photos? It can probably do that too.
