Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Convert videos for my iPhone

by kyle (Abbot)
on Dec 16, 2009 at 16:18 UTC ( #813031=note: print w/replies, xml ) Need Help??

in reply to Convert videos for my iPhone

I was asked privately whether this could be used to convert RealVideo to mp4 without losing resolution. Rather than try to fit my answer into a private /msg, I'm posting here.

Whether this converts RealVideo at all depends on the mencoder tool that it uses to do the conversion. I see .rm is a supported extension, so I'm guessing it does, but YMMV.

If it will do the conversion, it will try to reduce the resolution to that of an iPhone. If you want to change that, look in sub convert, which composes a big command line and executes it with system. In the snippet below, I've bolded the (hard coded) resolution constraints.

    my $cmd = join q{ },
        qq{mencoder $src_file_quoted -o $new_file_quoted},
        qq{-vf dsize=480:320:0,scale=0:0,expand -noautoexpand},
        qq{-oac faac -faacopts mpeg=4:object=2:raw:br=$OPT{abits}},

I've since forgotten exactly what that all does or exactly how to change it to keep the original resolution, but I found the mencoder documentation good enough to figure it out. What I remember is that the code, as written, fits the input video into the constraints given while retaining the aspect ratio (so a tall image will fit into the screen with black boxes at the sides instead of being stretched into a too-wide image).

The whole program could be seen as a really overblown wrapper around that one big command line. Changing what it does with videos you hand it depends on changing the command that it builds.

I hope this helps.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://813031]
[Tanktalus]: He might see me here... :D
[Discipulus]: it's me? ;=)
[marioroy]: Lady_Aleena could it be a quoting issue? I just tried find with -exec on the command line. find . -name "*.pl" -exec ls -l {} \;
[Tanktalus]: No, I know who he is, nice try. But if you're hiring, let me know :)
[Tanktalus]: Lady_Aleena: yeah, I can reproduce your issue, it's confusing alright :)
[Tanktalus]: I'm sure it'll make perfect sense once we figure it out :)
[Lady_Aleena]: marioroy, not a quoting error. I can't run it on the command line. It is when I put it in qx() where it falls apart.
Discipulus hired to use Perl in Eataly? haired maybe
[choroba]: We're hiring
[Discipulus]: wow praha!

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2017-04-23 20:04 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (432 votes). Check out past polls.