Discussion:
[MEncoder-users] Change framerates with mencoder
Sergio
2006-02-22 14:43:38 UTC
Permalink
Hi all:

I'm working in creating video DVDs with Mencoder, and have a problem:
how to change the framerate of a video file when it's different to the
desired (example: I have a 25fps video and want to burn a NTSC disc).

The most common values for files are 24, 25 and 30 fps, and I need to
convert all of them to 25 or 30. Currently I have the recipe for:

24 to 30:
mencoder -fps 30000/1001 -ofps 30000/1001 -vf telecine,harddup

30 to 25:
mencoder -fps 30 -ofps 25 -vf filmdint=io=6:5,harddup

But I need a way to convert from 24 to 25, and from 25 to 30. Is there
a filter that allows to repeat one frame after X? The idea is to repeat
one frame each 24, converting 24 to 25 fps, or repeat one each 5,
converting from 25 to 30.

I've read all the mencoder documentation but hadn't find something that
could be used. Can somebody help me?

Thanks.

- --
Nos leemos
RASTER (Linux user #228804)
***@rastersoft.com http://www.rastersoft.com
Nico Sabbi
2006-02-22 14:56:17 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
how to change the framerate of a video file when it's different to the
desired (example: I have a 25fps video and want to burn a NTSC disc).
The most common values for files are 24, 25 and 30 fps, and I need to
mencoder -fps 30000/1001 -ofps 30000/1001 -vf telecine,harddup
mencoder -fps 30 -ofps 25 -vf filmdint=io=6:5,harddup
But I need a way to convert from 24 to 25, and from 25 to 30. Is there
a filter that allows to repeat one frame after X? The idea is to repeat
one frame each 24, converting 24 to 25 fps, or repeat one each 5,
converting from 25 to 30.
I've read all the mencoder documentation but hadn't find something that
could be used. Can somebody help me?
Thanks.
fine, someone who will finally test the new soft-telecine code:)
You need mencoder from cvs; the commands are:

for 24->25 and 23.976->25:

$ mencoder -of mpeg -mpegopts format=dvd:film2pal

for 24->30 and for 23.976->29.97:
$ mencoder -of mpeg -mpegopts format=dvd:telecine

this way no framerate conversion will take place.
If the source isn't strictly progressive the telecining process will abort.

Please, let me know if/how it works.

Nico


--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Cassine di Pietra: vini veneti di qualità subito a casa Sua
* da un’azienda famigliare al servizio di clienti selezionati
*
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3919&d=22-2
Jan Knutar
2006-02-22 15:10:00 UTC
Permalink
Yes ignore what I said, didn't know of mpeg could do soft telecines like that
now :)
Sergio
2006-02-23 14:10:09 UTC
Permalink
Hi again!

I need to know the final length of a file after being converted by
Mencoder. Currently I do it using the formula:

(audio_rate+video_rate)*length

with AUDIO_RATE and VIDEO_RATE expressed as bytes/second and LENGTH as
seconds. Unfortunately, the size is overestimated in about a 35% (i.e.
when the estimation says 4.4 GBytes, the true final size is about 3
GBytes).

Is there a way of better estimate the final length?

Thanks in advance.

- --
Nos leemos
RASTER (Linux user #228804)
***@rastersoft.com http://www.rastersoft.com
Jan Knutar
2006-02-23 14:17:46 UTC
Permalink
Post by Sergio
(audio_rate+video_rate)*length
with AUDIO_RATE and VIDEO_RATE expressed as bytes/second and LENGTH as
Are you aware that 128kbit/second for audio really means 128000 bits/second?
Dito for video.

1kbit = 1000bit.

Doesn't really explain why your calculation are off by 35%, though... What does
mencoder final lines of output say?
Kasper Kristoffersen
2006-02-23 14:26:58 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi again!
I need to know the final length of a file after being converted by
(audio_rate+video_rate)*length
with AUDIO_RATE and VIDEO_RATE expressed as bytes/second and LENGTH as
normally, the bitrates are in (k)bit/sec, not bytes, but I'm guessing
you have converted to bytes/sec yourself.
seconds. Unfortunately, the size is overestimated in about a 35% (i.e.
when the estimation says 4.4 GBytes, the true final size is about 3
GBytes).
Is there a way of better estimate the final length?
I'm not pro at this, but my guess would be, that some frames aren't
using full bitrate (like a pure black-frame not using e.g. 4Mbit of data).

--
Kasper Kristoffersen
Jan Knutar
2006-02-22 14:58:55 UTC
Permalink
Post by Sergio
to repeat one frame after X? The idea is to repeat
one frame each 24, converting 24 to 25 fps, or repeat one each 5,
-ofps 25 -vf harddup
RC
2006-02-22 17:06:02 UTC
Permalink
On Wed, 22 Feb 2006 15:43:38 +0100
Post by Sergio
how to change the framerate of a video file when it's different to the
desired (example: I have a 25fps video and want to burn a NTSC disc).
The easy way is to speed it up/slow it down.

The new mpeg telecine methods seem quite interesting.
Post by Sergio
Is there a filter that allows to repeat one frame after X?
No filter needed, that's the job -ofps does...
Sergio
2006-02-23 14:03:57 UTC
Permalink
Hi again, all!

First, thanks for all the replies. Unfortunately none of them helped. I
can't use the first answer (use the new film2pal filter) because I want
to use it in a program that I wrote
(http://www.rastersoft.com/programas/devede.html), designed to easily
create video DVDs. I can't force people to use CVS version of Mencoder :(

About the second answer (put -ofps with the desired frames per second,
and harddup), it doesn't work. It seems that -ofps only sets the
reproduction speed, but doesn't duplicate or remove any frame, so the
result is that the video is played faster (or slower), but not the
audio, so it gets quickly desincronized.

Has someone another idea of how to do it?

Thanks.

- --
Nos leemos
RASTER (Linux user #228804)
***@rastersoft.com http://www.rastersoft.com
Guillaume POIRIER
2006-02-23 14:21:04 UTC
Permalink
Hi,
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi again, all!
First, thanks for all the replies. Unfortunately none of them helped. I
can't use the first answer (use the new film2pal filter) because I want
(http://www.rastersoft.com/programas/devede.html), designed to easily
create video DVDs. I can't force people to use CVS version of Mencoder :(
Just ask them to use -pre8 then! :P
About the second answer (put -ofps with the desired frames per second,
and harddup), it doesn't work. It seems that -ofps only sets the
reproduction speed, but doesn't duplicate or remove any frame, so the
result is that the video is played faster (or slower), but not the
audio, so it gets quickly desincronized.
Has someone another idea of how to do it?
I guess you need to conver the sourd too. I wouldn't be surprised if
Audacity could do that for you.

Guillaume
--
Reinventing the wheel certainly is annoying, but as long as all other
wheels are square...

Reimar Döffinger
RC
2006-02-23 14:09:57 UTC
Permalink
On Thu, 23 Feb 2006 15:03:57 +0100
It seems that -ofps only sets the reproduction speed, but doesn't
duplicate or remove any frame, so the result is that the video is
played faster (or slower), but not the audio, so it gets quickly
desincronized.
NO! That's not how -ofps works. That's how -fps works, but not -ofps
(unless you're doing something nonsensical like using -noskip at the
same time).
Sergio
2006-02-23 23:20:39 UTC
Permalink
Post by RC
NO! That's not how -ofps works. That's how -fps works, but not -ofps
(unless you're doing something nonsensical like using -noskip at the
same time).
Ops... O:)

Yes, that was the problem, I put a -noskip...

Sorry, and thanks O:)

- --
Nos leemos
RASTER (Linux user #228804)
***@rastersoft.com http://www.rastersoft.com
Rich Felker
2006-02-26 04:18:17 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi again, all!
First, thanks for all the replies. Unfortunately none of them helped. I
can't use the first answer (use the new film2pal filter) because I want
(http://www.rastersoft.com/programas/devede.html), designed to easily
create video DVDs. I can't force people to use CVS version of Mencoder :(
About the second answer (put -ofps with the desired frames per second,
and harddup), it doesn't work. It seems that -ofps only sets the
reproduction speed, but doesn't duplicate or remove any frame, so the
result is that the video is played faster (or slower), but not the
audio, so it gets quickly desincronized.
No, you're just omitting -vf harddup. -ofps definitely does what you
want here. However, for minor speed changes, using -speed might be
better than duplicating frames (duplication makes for choppy video).
Try something like -speed 25025/24000 to go from NTSC FILM (24000/1001
fps) to PAL, and of course you can make similar conversions for
others. Be aware tho that changing framerate more than slightly with
-speed will make things look and sound very weird. :)

Rich

Continue reading on narkive:
Loading...