Log in

View Full Version : MPEG-4 reencoding


msureshkr
30th June 2008, 21:57
Hi,
I have mp4 video files and I would like to re-encode them into 30 seconds clips with lower bitrate and fade-in/fade-out. Can anybody point me what tool to use? If there is any C++ library or command line tool I can use, it would be great.
thanks
Suresh M

LoRd_MuldeR
30th June 2008, 22:03
x264 (http://x264.nl/) + Avisynth (http://avisynth.org/mediawiki/Main_Page) should be able to do what you want :)

Blue_MiSfit
30th June 2008, 22:52
+1.

AviSynth is easy to setup for simple NLE tasks, like trimming a region and fading in / out.

For reference, you will need to get the MP4s into AviSynth somehow - I would suggest demuxing them with YAMB. Depending on the type of MPEG-4 (ASP or AVC) you will have to use different tools.

For ASP, I would remux to AVI, and load into AviSynth with AVISource().

For AVC, I would demux to elementary .264 files, index with DGAVCIndex, and load into AviSynth with AVCSource()

~MiSfit

msureshkr
1st July 2008, 00:17
Thanks. Sounds like we cannot automate this process right? Is there any libraries open source/commercially available to do that?

LoRd_MuldeR
1st July 2008, 00:22
Thanks. Sounds like we cannot automate this process right? Is there any libraries open source/commercially available to do that?

I pretty sure you can automate that process! Avisynth is script based and you use it as a library. x264 can be used as CLI encoder or as library.
Both, Avisynth and x264, are OpenSource software released under the GPL :)

msureshkr
1st July 2008, 00:30
Thanks. What I was looking for is some COM dll's. Mine is an intranet app and does the encoding on demand basis. I am not sure whether running command line scripts from IIS is a good idea. Anyway I will try with avisynth and x264. thanks again

LoRd_MuldeR
1st July 2008, 00:40
Thanks. What I was looking for is some COM dll's. Mine is an intranet app and does the encoding on demand basis. I am not sure whether running command line scripts from IIS is a good idea. Anyway I will try with avisynth and x264. thanks again

Again: Both, Avisynth and x264, can be called by your application as libraries (DLL files).
Also it should be no problem at all to create your Avisynth script "on the fly". I think you even won't need to save it as textfile.
Look at tools like MeGUI, Avidemux, ffdshow and so on...