I guess this thread has spawned another issue. Let me close this and say
I
will look for some other project to work on. Honestly speaking I also do
not
support piracy and the file was just a dummy one for simulation purpose
and
not an actual movie file( Have changed the subject
also )
I would appreciate if we donât indulge in this topic of piracy or theft
of
movies as this is a Ruby forum.
Mayank
I guess this thread has spawned another issue. Let me close this and
say I will look for some other project to work on.
NOOOOO. Make it work.
I would appreciate if we donât indulge in this topic of piracy or
theft of movies as this is a Ruby forum.
Yes, Iâve seen the adverts and now I know that Piracy Funds Terrorism.
Clearly the IRA and Hamas really love sharing Hollywood films and pop
music with bittorrent.
To be frank Iâm appalled that the censors say this shit. It cheapens
an important problem. I think you should keep downloading things just
to piss them off. Whayyy.
On Thu, Jun 30, 2011 at 1:48 AM, Mayank K.
[email protected] wrote:
[snip]
Is there a pattern to the file names you are working with? The key is
to find a pattern and write code to work with that pattern.
If the pattern requires a lot of heuristics, then itâs going to be
more difficult to do, but not impossible.
For a example, with your previous example, how would you know when the
move name ends and the meta data begins? It might be possible to keep
an array (or a hash) of the meta data, split the file name on some
delimiter (such as a dot) and filter out items that are contained in
the array (or hash).
And read the API documentation that is the key how to deal with a new
language, that is my opinion.
2011/6/30 Jeremy H. [email protected]
Yes, the ruby team make this IRB that is very convenience. I never have
played it as like this way to learning a programming language.
2011/6/30 Jeremy H. [email protected]
On Thu, Jun 30, 2011 at 9:41 AM, coolesting [email protected]
wrote:
And read the API documentation that is the key how to deal with a new
language, that is my opinion.
Agreed.
Also, âinteractâ with the API with an IRB session open right next to
it. The best way to learn something long-term is to understand it and
then apply it.
Is there a pattern to the file names you are working with? The key is
to find a pattern and write code to work with that pattern.
You know the video file itself probably has meta data.
Inspecting that would be a harder than just regex matching on the
filename but the program is going to be much more robust in the face of
crappy input.
On Thu, Jun 30, 2011 at 10:55 AM, Johnny M.
[email protected]wrote:
Is there a pattern to the file names you are working with? The key is
to find a pattern and write code to work with that pattern.
You know the video file itself probably has meta data.
Inspecting that would be a harder than just regex matching on the
filename but the program is going to be much more robust in the face of
crappy input.
But requires a different set of assumptions: the files are videos (it is
called a âFileâ renamer, no longer a âMovieâ renamer), and theyâre all
the
same format or you have a tool that will let you access this format.
I did something like this with my music collection, CDâs that Iâd ripped
were MP3s and could be renamed nicely, but the ones Iâd bought off
iTunes
were m4aâs and didnât have this info. Some of the music Iâd ripped a
long
time ago didnât have all the same tags filled out, etc. In the end I had
a
tool that renamed maybe 90-95% of my music and the rest I had to do by
hand.
On Fri, Jul 01, 2011 at 12:55:37AM +0900, Johnny M. wrote:
Is there a pattern to the file names you are working with? The key is
to find a pattern and write code to work with that pattern.
You know the video file itself probably has meta data.
Inspecting that would be a harder than just regex matching on the
filename but the program is going to be much more robust in the face of
crappy input.
Do you have suggestions for Ruby libraries suitable to the task of
reading video file metadata?
You should be aware that meta data canât be trusted. Not only do people
not
know how to use fields properly they will also use different character
sets
like stuffing in Unicode when the tag claims to be ASCII.
Not to mention using online databases can be a real exercise in
frustration.
Again people seem incapable of using fields properly and there are
numerous
duplicates for items that shouldnât be there.
I think youâre getting dragged down into the implementation of a project
instead fo learning the core concepts of OO design. I would avoid the
whole
mess and do something more focused like working through the Ruby Koans:
Here are some other resources for learning OO design and the concepts
behind
it:
Berkeley - 61A - The Structure and Interpretation of Computer Programs
(includes iTunes links)
Videos:
http://webcast.berkeley.edu/playlist#c,d,Computer_Science,D7B8D6A4834C14C8
Course resources: CS 61A Home Page
Original videos and the book:
Structure and Interpretation of Computer Programs, Video Lectures
Stanford - 106B - Programming Abstractions
Videos:
http://171.64.93.201/ClassX/system/users/web/Subject.php?subject=CS106B_LECTURES_SPR2011
Course resources: CS106B Home
No SICP would be âthe concepts behind [Object Oriented programming]â
part of
that. For instance abstraction is a major component of OO design, SICP
covers that. When you go through SICP youâll see a lot of ideas youâll
recognize from OO languages and youâll have a better grasp of whatâs
going
on. Itâs like learning the parts of speech before trying to write the
next
great novel.
On Thu, Jun 30, 2011 at 5:15 PM, Johnny M.
[email protected]wrote:
On Fri, 1 Jul 2011 05:37:11 +0900
Mike B. [email protected] wrote:
You should be aware that meta data canât be trusted.
The file name cannot be trusted any more than the meta data.
I totally agree. Not only can people incorrectly name files but they can
use
h4x0r l33t15h in the file names thus totally obfuscating the real name.
Not
to mention how you will differentiate between the spam parts fo the file
name and the real name and the order in which they come.
I think the problem, while it sounds simple, is hugely complex. Itâs a
CS
Master or PhD Thesis level project, not a ânew to OOâ kind of thing.
On Thu, Jun 30, 2011 at 4:16 PM, Mike B. [email protected]
wrote:
Itâs like learning the parts of speech before trying to write the next
great novel.
Yeah, but isnât it kind of like learning them in Klingon?
On Fri, 1 Jul 2011 05:37:11 +0900
Mike B. [email protected] wrote:
You should be aware that meta data canât be trusted.
The file name cannot be trusted any more than the meta data.
To the other points, and those raised by Josh and Chad. Your points are
good and have virtue but this is the way I would do it! This is based
on experience with a pattern approach which suffered from inconsistent
naming.
I donât know what library you would use, never done this, but I
wouldnât repeat my previous mistake.
On Fri, Jul 01, 2011 at 06:37:58AM +0900, Mike B. wrote:
I think the problem, while it sounds simple, is hugely complex. Itâs
a CS Master or PhD Thesis level project, not a ânew to OOâ kind of
thing.
How sure are we that filenames provided by others, scraped from the
Internet, are even part of the real problem domain for this case? Maybe
the filenames can be trusted for the theoretical use case we face.
how would you know when the movie name ends and the meta data begins?
It might be possible to keep an array (or a hash) of the meta
data, split the file name on some delimiter (such as a dot) and
filter out items that are contained in the array (or hash).
Shouldnât it be possible to use something like FFMPeg [3] from within
Ruby, or via FFI bindings and retrieve every information about
Video Data one would like?
I looked around a bit but there does not seem to be a meta library for
Ruby to work for Video related tasks.
I myself would love to have anything like this though.
Back during my windows days, I was using Avisynth [1] + Virtualdub [2] a
lot to modify videos, like using delogo filters, and various other
filter tools.
Avisynth was a fun little language to use. I miss those days. Even
though Ruby is much cooler, I am also missing the days where I wrote a
little script to apply filters at will on video data ⌠
[1] Main Page - Avisynth
[2] http://www.virtualdub.org/
[3] http://www.ffmpeg.org/
Good point. OP would have to answer that question. The scope changes the
problem dramatically but I wonder if itâs not reasonable to assume the
files
will be named by humans. Once you put humans into the mix youâre going
to
have problems⌠all hail our computer overlords!
On Thu, Jun 30, 2011 at 5:41 PM, Josh C. [email protected]
wrote:
On Thu, Jun 30, 2011 at 4:16 PM, Mike B. [email protected] wrote:
Itâs like learning the parts of speech before trying to write the next
great novel.
Yeah, but isnât it kind of like learning them in Klingon?
LOL, no, no, no⌠itâs more like Esperanto with an Irish brogue.