tags:

views:

414

answers:

3

I'm processing user videos with differing aspect ratios. It seems FFMPEG only allows you to specify a fixed resolution. I want the output res to be appropriate for the input res. Similarly, I'd like FFMPEG to intelligently set the output bitrate based on the input video: obviously it shouldn't be any bigger than the input.

I can get the properties of a video with,

ffmpeg -i example.flv

But this requires some ugly parsing of the output, so I'm wondering if FFMPEG or some other tool has a more direct facility.

Basically, I have the Youtube problem: crap comes in, reasonably uniform quality should come out.

+1  A: 

ffmpeg has an library interface - I know nothing about it, but maybe you could use that to get the information directly into your code?

http://www.inb.uni-luebeck.de/~boehme/using%5Flibavcodec.html

Douglas Leeder
+1  A: 

Someone named ahaslam may have already written a short bash script that addresses your problem.

DaveParillo
A: 

Using a script seems like the right answer to the question I asked, but I should have mentioned that I'm using PandaStream. I was concerned because PandaStream has you specify a fixed output res, but apparently it has logic such that the input video gets bounded to this resolution, e.g. for the output res 480x270, a 4:3 video will be encoded at 360x270.

This seems like a good compromise. Just set Panda to output a 16:9 res and then 16:10 and 4:3 vids will come out fine for most purposes.

Jegschemesch
You could have added this info as "half" a comment on DaveParillo's answer and "half" an edit thus fixing your question. Unless this actually is answering your question (since I don't quite follow you here), to which I'd still advise doing the two previous action, and keeping this answer, fixing it according to the new question, and accepting it.
Cawas