Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://813031]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (1)
As of 2021-08-05 00:17 GMT
Find Nodes?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)

    Results (44 votes). Check out past polls.