# Could ruby programming capture a media title?

**URL:** <https://www.ruby-forum.com/t/could-ruby-programming-capture-a-media-title/174926>\
**Category:** Ruby\
**Created:** [September 4, 2009, 8:47am UTC](https://www.ruby-forum.com/t/could-ruby-programming-capture-a-media-title/174926 "2009-09-04T08:47:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [September 4, 2009, 8:47am UTC](https://www.ruby-forum.com/t/could-ruby-programming-capture-a-media-title/174926/1 "2009-09-04T08:47:36Z")

</div>

I have a thought on if we could capture a media title when we watch a  
movies through mplayer.  
I’m afraid not… not for a specific programming like ruby, but I would  
really enjoy it if someone make it real in ruby.

---

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [September 4, 2009, 2:28pm UTC](https://www.ruby-forum.com/t/could-ruby-programming-capture-a-media-title/174926/2 "2009-09-04T14:28:00Z")

</div>

On Fri, Sep 4, 2009 at 2:47 AM, Zhenning G.[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I have a thought on if we could capture a media title when we watch a  
> movies through mplayer.  
> I’m afraid not… not for a specific programming like ruby, but I would  
> really enjoy it if someone make it real in ruby.

You might have some luck with FFMpeg ([http://ffmpeg.org](http://ffmpeg.org)).

Let us know when you’ve written the code. Media processing is an  
interest of mine.

Regards,  
Jason

---

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [September 4, 2009, 11:22pm UTC](https://www.ruby-forum.com/t/could-ruby-programming-capture-a-media-title/174926/3 "2009-09-04T23:22:34Z")

</div>

On Sep 3, 2009, at 23:47, Zhenning G. wrote:

> I have a thought on if we could capture a media title when we watch a  
> movies through mplayer.  
> I’m afraid not… not for a specific programming like ruby, but I would  
> really enjoy it if someone make it real in ruby.

I’m working on it:

$ ruby -Ilib sample/metadata.rb ~/Movies/A\ History\ Of\ Violence.mp4  
A History Of Violence.mp4 metadata:  
album: “”  
author: “”  
comment: “”  
copyright: “”  
filename: “/Users/drbrain/Movies/A History Of Violence.mp4”  
genre: “Drama”  
title: “A History Of Violence”

[https://github.com/drbrain/ffmpeg-rb/tree](https://github.com/drbrain/ffmpeg-rb/tree)

---

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [September 6, 2009, 6:42am UTC](https://www.ruby-forum.com/t/could-ruby-programming-capture-a-media-title/174926/4 "2009-09-06T06:42:51Z")

</div>

On Sat, 5 Sep 2009 06:18:24 +0900  
Eric H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [https://github.com/drbrain/ffmpeg-rb/tree](https://github.com/drbrain/ffmpeg-rb/tree)

Sweet! Nice work.

I did a bunch of shell scripting which had me tearing my hair out… I’d  
love to replace it with Ruby code using your library.

---

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [September 9, 2009, 1:41am UTC](https://www.ruby-forum.com/t/could-ruby-programming-capture-a-media-title/174926/5 "2009-09-09T01:41:48Z")

</div>

On Sep 5, 2009, at 21:40, spiralofhope wrote:

> On Sat, 5 Sep 2009 06:18:24 +0900  
> Eric H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > [https://github.com/drbrain/ffmpeg-rb/tree](https://github.com/drbrain/ffmpeg-rb/tree)
> 
> Sweet! Nice work.
> 
> I did a bunch of shell scripting which had me tearing my hair out…  
> I’d  
> love to replace it with Ruby code using your library.

For extracting it will work as-is. I recently got audio/video  
transcoding working, but only on a limited basis (same audio sampling  
rate, etc.). I’m not sure how to update metadata without transcoding,  
haven’t looked into it at all.
