Log in

View Full Version : Converting N82 mobile footage to DVD


stooky
2nd November 2008, 12:05
Hi!
I have a problem: I want to convert footage taken by my N82 mobile device to mpeg2!
Therefore i need a good Avisynth-script that can be opened with HC Encoder.
I am new to Avisynth. I have played a bit with scripts, but I haven't received good results so far.

This is the script I load into HC Encoder so far:

DirectShowSource("C:\...\07102007001.avi",audio=false)
AssumeFPS(25) #the original footage don't has a constant framerate...
#Crop(20,0,-20,-0) #I'm not sure if I have to crop the original in order to get the correct aspect ratio
BicubicResize(720,576,0,0.5) #is there a resize method that provides better quality?
ConvertToYV12()

It is a pretty simple script, I know ;)

In the following thread there is a script that apperently produces videofiles with good quality (source is N95, original footage also provided in this thread). But I don't know how to adapt it to get good looking mpeg2 files...
http://forum.doom9.org/showthread.php?t=139600&highlight=n95

I'm sure there is the possibility to get out good results by applying the right filters... So far i have the feeling that my script produces mpeg2-videos that have a significant loss in sharpness and contrast. Perhaps there is a way to remove the compression artifacts in the original?

Thanks in advance!!

ps: I have another problem: AssumeFPS(25) makes the video stream DVD compliant but HC Encoder isn't capable of producing audio output... So what should I do to get audio which is synchron to the produced video (with AssumeFPS(25) applied)?

How can i transcode the aac-audiostream to DVD-compliant PCM losslessly?

Furthermore i need a free mpeg2 muxer... Do you know one?

stooky
7th November 2008, 14:30
Now I've used the following script:

DirectShowSource("07102007001.mp4",audio=true)
#AssumeFPS(25, sync_audio=true) #the original footage don't has a constant framerate...
ResampleAudio(48000)
#Crop(20,0,-20,-0) #I'm not sure if I have to crop the original in order to get the correct aspect ratio
BicubicResize(720,576,0,0.5)
ConvertToYV12()

Now the problem is, that the audio is pitch shifted. It sounds horrible!
Is there no way to convert the video file into DVD-Compliant PAL format with normal, synchronous audio?

Comatose
7th November 2008, 16:54
Doing what you did with AssumeFPS' sync_audio=true won't fix the variable FPS problem (it's still not going to be synced once the FPS changes).

What you need to do is something like this:
DirectShowSource("07102007001.mp4",convertfps=true,fps=25)
#AssumeFPS(25, sync_audio=true) #the original footage don't has a constant framerate...
ResampleAudio(48000)
BicubicResize(720,576,0,0.5)
ConvertToYV12()

As for anything else (including cropping), we'll need a sample :p

stooky
7th November 2008, 23:17
Thank you very much for your help!
Now with "DirectShowSource("07102007001.mp4",convertfps=true,fps=25)" i get synchronous audio that is not pitch-shifted!

Comatose
8th November 2008, 05:21
You're welcome :)

If you work with a better source later on, then you shouldn't do it this way as it might introduce choppyness (so you should come ask again :p)
I figured it doesn't matter in this case since cellphone video is usually very shaky and jumpy already.. :3

stooky
10th November 2008, 21:11
What do you exactly mean with "it might introduce choppyness"? So far I'm happy with the results. Now I can load the *.mp4 files directly into HC Encoder to resize and convert them into mpeg2! The only thing that still bothers me is that I have to save the audio stream as *.wav (out from virtualdub) and to convert it manually with BeLight... At the end I have to mux it with Mplex. --> This is not an efficient workflow :rolleyes:

By the way: Is there a way to "remove" the artifacts in the video which were produced due to the poor compression algorithm of the N82? The video could also be a bit sharper, as the sharpness suffers from resizing...

Comatose
12th November 2008, 13:58
changefps() duplicates or removes frames to reach the target fps, but it doesn't have any other logic.
Therefore, in smooth motion like pans you may end up with dupe frames in the middle of the pan - which will make the pan "jump" forward at that spot.
There are other methods to do it (none of which are perfect of course), but in this case this would be the "best" method because changefps() is a simple solution and cell phone videos are already jumpy and choppy, so you won't notice the dupes.

As for denoising, sharpening and so on, you'll have to upload a sample :P