PrisonPlanet Forum
June 19, 2013, 07:59:45 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Converting files  (Read 8774 times)
Femacamper
Member
*****
Offline Offline

Posts: 9,959


LIVE FREE OR DIE!


WWW
« on: June 29, 2008, 10:10:36 PM »

Is it necessary to convert audio files to .wav first before reencoding it, in order to preserve quality?

Also, is it necessary to convert video files to raw .avi first before reencoding, in order to preserve quality?
Logged

JTCoyoté
Guest
« Reply #1 on: June 29, 2008, 10:39:29 PM »

 Fema,

Okay, this is all well and good... but you are talking to some folks here, who have no idea what these terms mean, or what .wav, or .avi is let alone how they function with the computer... so it might be a good idea to start at the beginning...

--Oldyoti

"The most important element of a free society,
where individual rights are held in the highest esteem,
is the rejection of the initiation of violence."

~Ron Paul
Logged
iks83
Member
*****
Offline Offline

Posts: 2,521


« Reply #2 on: June 30, 2008, 05:10:03 AM »

ok thats going to be a long one...

For clarification, .wav and .avi are just container formats that can contain different types of encoded material. You can create a wav file that contains a mp3 encoded audio stream. But today when refered to .wav files it usually means uncompressed audio. Since uncompressed is lossless there wont be any data lost when you lets say convert mp3 to wav. When converting from wav to mp3 again you will of course lose some quality, if you dont change the audio and use the same settings it should stay the same quality. But converting to wave before you reencode the audio from one format to the other shouldnt make an difference as long you dont edit it. If you change volume, add effects, cut, etc its always better to do that with uncompressed audio. But that will be used anyways. CoolEdit is always loading the audio as uncompressed wave, now if you edit it and save it to disk to continue the next they you should save it in a lossless format. Reencoding will always lower the quality. You can improve it with different kind of filters though, but you cant take a 32 kbit mp3, save it as 192 kbit mp3 and expect a better audio quality.

Here an example... recordings of classical music usually arent done very well... at least older records and so the mp3s arent so good either. So the volume is quite low and the source is 128 kbit mp3. I then would load it into CoolEdit, do a dynamic range compression to get a better volume and maybe do some tweaking with the equalizer. Then save it as 192 kbit mp3. That way you can improve quality rather then conserve.

Now for video I'm not sure what you mean with raw .avi. Uncompressed video will take a huuuuuuge amount of space like 1800 MB per minute for PAL DVD, so you probably dont mean that. There are some lossless codecs out there though like huffyuv and I think the x264 codec (for MPEG4/AVC aka h.264 usually used for mp4 files) has also a lossless function. Those will preserve quality at a much lower filesize but it will still be huge.

Now if you mean like downloading a FLV file and want to convert it to mpeg, and to do that convert the FLV to avi first... bad idea. Always keep the encoding at a minimum. But I need more information about what you wanna do to tell you anything.

http://forum.doom9.org/  is one of the best sources (I think) for video converting, encoding, etc but its kinda tough to find the right stuff if you dont know the language... seriously there are some threads that seem to be written in english but I have absolutely no idea what they are talking about.

Avisynth is a very powerful tool in the scene. If you have a program that can load .avs files you can load any kind of video format that is out there. You can do some basic editing there like cutting, cropping, resize, deinterlacing, fade in, fade out, load subtitles, load filters for sharpening, smoothing, denoising and so on. But it will take some time to understand how it works if you arent familiar with that kind of... computer stuff.

http://www.doom9.org/ also has alot of tools available on the site for download. Also some guides but they are mostly for very specific tasks using tools that do most stuff automaticly. I prefer the kinda oldschool way since you have the most control over all the steps.

Like the project im working on at the moment.

1st step: get a good source of the video, found one, avi file, xvid encoded, audio mp3
2nd step: using virtualdubmod to cut out the clips I need then merging the clips together to one video again. no encoding needed
3rd step: load the audio into cooledit, edit it so the volume is good then save as m4a file (aac audio codec, the successor of mp3)
4th step: loading the video into aegisub and creating the subtitle, saved as .ass file (they really need to find a better file extension... but it creates some funny conversations... "ok when i got the files i will look at the first ass and tell you what i think"
5th step: write an .avs file that is loading the video, resizing it and adds the subtitle
6th step: load the avs into meGUI (a user interface for the x264 codec), make all the settings and encode it to a mp4 file.
7th step: open YAMB (user interface for mp4box), load the audio and video stream and put it all into one mp4 file.

done... see how easy it is? -_-
Logged
Femacamper
Member
*****
Offline Offline

Posts: 9,959


LIVE FREE OR DIE!


WWW
« Reply #3 on: July 01, 2008, 12:48:29 AM »

I generally decompress the video to raw .avi before editing it because I'm concerned about loss of quality, and I want to reencode it in another format (ie. something for YouTube). I know it takes a lot of space, but the question I have is...can I directly transcode it from say, flv to divx without a loss of quality, or should I always go flv to raw to divx?
Logged

iks83
Member
*****
Offline Offline

Posts: 2,521


« Reply #4 on: July 01, 2008, 01:32:30 AM »

Well what do you mean with raw .avi? I doubt you really decompress it and save as uncompressed avi. Thats a total waste of resources. Divx is also avi. Like I said, avi is just a container format which can contain anything. Its always better to use the source file and encode it into the new format but you will always lose quality exept you save in a lossless format. Now like I said, when your editing program supports avisynth then you just can load your flv through that, edit it and then encode to divx. Thats the most efficient way. But lets say you just want to add a subtitle that is not hard encoded on the frames you just can mux (merge) audio, video and subtitle into one mkv, ogm or mp4 file. There are so many ways.

But to answer the question. Yes you can directly transcode from flv or whatever the source will be to divx, xvid, x264. But you will always have a loss of quality depending on what encoding settings you use. Decompressing it to raw avi (whatever that means) would be the same so its a unnessesary step.

The anime music video I made was done with Adobe Premiere and also through avs. So I loaded the DVD video direcly into Premiere and edit it there, then exported it to divx avi. Always better to work on the source instead of changing it into another format, edit and then encode it again.

Avisynth basicly is decompressing it into raw. Its a frameserver that is using the codecs installed on your system to decode the video and then provide the frames to any application.
Logged
TheGoodFight1984
Guest
« Reply #5 on: July 01, 2008, 01:36:58 AM »

if you're converting a 192kbps mp3 to wav audio the quality will never be better than 192kbps, so unless you have the original audo file in high quality to start with then re-encoding is a big waste of time. if your software can handle mp3 then just use that, you won't lose any quality as long as the audio settings are the same as the original file. hope that helps. Smiley
Logged
JTCoyoté
Guest
« Reply #6 on: July 01, 2008, 12:42:40 PM »

So basically what you're saying is that the closer to an uncompressed format you get with your original, before you begin "streamlining, or shrinking" the file for the Web, the better your end product will be?

If that is the case, let's say I'm using a three-inch DVD disc format recorded from a camcorder... how would I go about uploading a segment from this, to youtube or some such...?

JTCoyoté

"Recent events have proved that the paper-money system of this country
may be used as an engine to undermine your free institutions, and that
those who desire to engross all power in the hands of the few and to
govern by corruption or force are aware of its power and prepared
to employ it. "
  ~Andrew Jackson - Farewell Address, 3/4/1837
Logged
Femacamper
Member
*****
Offline Offline

Posts: 9,959


LIVE FREE OR DIE!


WWW
« Reply #7 on: July 01, 2008, 05:47:38 PM »

Is it digital or analog?
Logged

JTCoyoté
Guest
« Reply #8 on: July 01, 2008, 08:16:28 PM »

Is it digital or analog?

The recorder has two settings for formatting... there is VR, which will not play directly on the DVD camcorder, and then a video setting, which will play directly when finalized on any DVD recorder...

So when you say is it digital or analog I will assume that VR is digital, and the video setting, is analog... in any case I have files of both varieties... and along with the camera, came a disk for importing the files into the computer. It is called ImageMixer3 for the Macintosh... which I have yet to load onto my computer or even attempt to use.

JTCoyoté

''...on every question of construction [of the Constitution], [let us] carry ourselves back
to the time when the Constitution was adopted, recollect the spirit manifested in the
Debates, & instead of trying what meaning may be squeezed out of the text, or invented
against it, conform to the probable one in which it was passed.''

~THOMAS JEFFERSON
Logged
iks83
Member
*****
Offline Offline

Posts: 2,521


« Reply #9 on: July 02, 2008, 01:15:48 AM »

I have not much experience with camcorders but when it records on DVD its always digital. VR Mode is this I think: http://en.wikipedia.org/wiki/VR_Mode
and only plays back in DVD players that support it. In what format your camcorder is recording can be probably be found in the manual. If I have to guess probably DV. http://en.wikipedia.org/wiki/DV

Which means mpeg2 basicly. You should be able to copy the videofiles to harddisk and then load it into the editing program of your choice, do the editing and then save as divx avi at a resolution of 640x480 or 512x384 and a bitrate of 1200 kbit. Audio mp3 at 128 kbit and load the final file up to youtube. Quality should be quite good then. Thats the simplest way if you dont want to spend much time on it or dont need a high quality video.

I would use avisynth again since the video is probably interlaced. So I would try to deinterlace it the best way possible, which means trying to create progressive (full) frames out of meshed together half frames. Most of Alex Videos on the site have been converted without deinterlacing which is just unprofessional and pisses me off. Interlaced material on TV looks fine, on computer it looks awful and needs alot of bitrate to maintain quality.

Its really hard to give good advice since there are so many variables. Maybe you could upload a short sample of video from your camcorder so I can check it out. And then maybe what you want to edit it. But honestly there are many many guides out there who explain everything very well. www.doom9.org is a good start... kinda started there too. But you need some time and interest but it will get easier with every video you encode.
Logged
EchelonMonitor
Member
*****
Offline Offline

Posts: 2,925



WWW
« Reply #10 on: July 08, 2008, 08:02:42 AM »

I generally decompress the video to raw .avi before editing it because I'm concerned about loss of quality, and I want to reencode it in another format (ie. something for YouTube). I know it takes a lot of space, but the question I have is...can I directly transcode it from say, flv to divx without a loss of quality, or should I always go flv to raw to divx?

For flv to avi for posting at YouTube and elsewhere, I use Super and H264AVC video with mp3 audio.  You can do divx, but it's slightly lower quality.

Editing the H264 would be better quality than editing a divx, but depends on whether your editor can handle the H264.  For editing, you're always safe using the uncompressed avi if you have the disk space, but I wouldn't bother if your editor can handle the H264.

I wouldn't worry about the audio--I doubt even an audiophile could tell if mp3 audio had been edited as uncompressed wav or mp3.
Logged
Femacamper
Member
*****
Offline Offline

Posts: 9,959


LIVE FREE OR DIE!


WWW
« Reply #11 on: July 08, 2008, 08:50:42 AM »

Another good freeware program for converting is WinFF - it's a graphical frontend for FFMpeg...and works with a ton of video and audio formats. (Windows and Linux versions available)
Logged

chakra71
Member
***
Offline Offline

Posts: 232



WWW
« Reply #12 on: July 08, 2008, 10:00:51 PM »

Good info here... here's my process for video:

I always try to start with the highest quality version i can.  DVD9 or HD DVD if I can find it. 

I then almost always encode to MP4 using Handbrake.  I use the iPhone/iPod preset because it gives great quality, is iPod compatible, and also looks great on the traditional screen.

If I can only get an encoded version but I want to change it to iPod format I usually use SUPER.  It works, but it isn't the fastest since it doesn't support multi-threading.  Another huge advantage is that it will decode/encode to/from just about anything.  As long as you have the directshow codecs installed it will decode it. 

If, for some reason, SUPER won't work (usually it fails on me when the input video is in an odd dimension, ie, not evenly divisible by 16) then I'll encode it to DVD9 using ConvertXtoDVD and then encode with Handbrake.  I've not noticed any major loss of quality in doing this 2 step encoding though it does take a while to process.

There are so many little things to watch out for, here's a few that i've learned first hand... i've not studied this too long but i've messed up enough times to learn this much!  Please correct me if I'm wrong on any of this!

Pitfalls:
Interlacing:  Some DVD sources are interlaced (not progressive scan) and if you do not de-interlace then you'll see some really annoying lines in the movement.  I use MEDIAINFO.exe (found in the k-lite codec pack) to scan all media sources before I begin encoding.

Bit Rates:  You can never increase the quality of your original source.  Low bit rate source encoding with a higher bit rate just gives you a larger file with equal or worse quality of the original.  That said, some codecs are better at compressing and you can get equal quality with a lower bitrate.  Converting from an AVI to an MP4 using the latest H.264 codec is a good example of this.  Generally h.264 is about 20% more efficient than your typical encoding.

Frame Rates:  You can run into audio/video sync issues if you do not pay attention to the frame rates.  If the original is 29 frames per second (FPS) and the audio is 48 KHZ and you encode it to 25 FPS but keep the 48 KHZ audio you will get sync issues bad.  Try to keep the same FPS and audio frequency as the input file to avoid sync issues.

Aspect Ratio:  You would think this would be easy... if you start with a 4:3 aspect ratio and you encode it to 16:9 without some major cropping then everyone is going to look fat!  Keep the same aspect ratio or let the program figure that part out for you!

I'm sure there's much more that i don't know... but that's what the community is for!
Logged
iks83
Member
*****
Offline Offline

Posts: 2,521


« Reply #13 on: July 09, 2008, 01:17:38 AM »

Quote
Bit Rates:  You can never increase the quality of your original source.  Low bit rate source encoding with a higher bit rate just gives you a larger file with equal or worse quality of the original.  That said, some codecs are better at compressing and you can get equal quality with a lower bitrate.  Converting from an AVI to an MP4 using the latest H.264 codec is a good example of this.  Generally h.264 is about 20% more efficient than your typical encoding.

It depends. If the codec is efficient you wont get larger files if you chose a higher bitrate than the original. And you should always use at least 2-pass encoding. I sometimes got less bits than I set up since it already is at maximum quality possible at the lower bitrate.

Quote
Interlacing:  Some DVD sources are interlaced (not progressive scan) and if you do not de-interlace then you'll see some really annoying lines in the movement.  I use MEDIAINFO.exe (found in the k-lite codec pack) to scan all media sources before I begin encoding.

Thats very important especially since NTSC DVDs are probably always interlaced. Never saw one that isnt. Best thing to do is to make a inverse telecine deinterlacing. It basicly changes 30 fps interlaced to 24 progressive but only works with movies telecining was used on. No need to change any audio.

Quote
Frame Rates:  You can run into audio/video sync issues if you do not pay attention to the frame rates.  If the original is 29 frames per second (FPS) and the audio is 48 KHZ and you encode it to 25 FPS but keep the 48 KHZ audio you will get sync issues bad.  Try to keep the same FPS and audio frequency as the input file to avoid sync issues.

Now why would you want to encode 30 fps to 25? It shouldnt effect the sync if you dont change the speed of the video, frame drops should be ok. But if you want to do it right, lets say change a movie from NTSC 30 interlaced to PAL 25 progressive you have to do inverse telecine on the NTSC source to get 24 fps, then speed it up to 25 fps and stretch the audio accordingly. Thats how its done professionally and thats why movies in PAL have a shorter duration than the NTSC version.
Logged
username
Member
****
Offline Offline

Posts: 369


A distorted reality is now a necessity to be free


« Reply #14 on: July 24, 2008, 03:07:35 AM »

I love this stuff

For .wav/flac/anything lossless to .mp3 use EAC (exact audio copy) with Lame mp3 codec

ALways go lossless to lossy - never go from mp3 to ANYTHING

Here's a Great Guide on how to set up  your drive with EAC
http://jiggafellz.isa-geek.net/?page_id=106

About quality loss, Same goes for video i.e. flv to anything will be BAD as you always go from high Q to Low Q

avi and divx are the same thing, and fairly easy to encode.

Here are some encoding guides i have found really helpfull

For HighDef stuff http://hdbits.org/wiki/index.php?title=X264_encoding_guide

Here's a text file on how to encode DVD to avi with minimum quality loss- HIGHLY RECOMMENDED http://dodownload.filefront.com/11196397//1aced43f616532f8f3d8a78ed0cfcc1239c8dde3fbedd3c29b854e1da36510ae4072ebfb91551c4f

iks83 - I agree with everything you said except the bitrate issue, while you can increase the bitrate, it won't affect the quality - i.e i could record the AJ show which runs at 56 kbps at 700 kbps - but the recorded audio will only be at 56 k/hence making an unnecessarily large file.


Basically fema - you would neverwant to convert ANYTHING to wave, as wave IS the RAW audio the comes off a cd and that your cd player reads - once it's been transcoded to another formay i.e. mp3, ogg, wma etc - it will always only be as good as that encoding.

Also, once you have converted the raw video( for dvd this would be .vob, hd stuff may be .mkv) to avi, you won't want to re-encode it to anything.  If you wanted it in say flv, you would want to go back to the dvd and go .vob to flv.

But yeah,
everyone should have dvd decrypter, EAC, avisynth and other tools mentioned installed.  They really are the best stuff available, and they're freeware/opensource!
Logged

"The observer who has thoroughly understood one link in a series of incidents, should be able accurately to state all the other ones, both before and after." Sherlock Holmes in "The Five Orange Pips" - Sir Arthur Conan Doyle
Femacamper
Member
*****
Offline Offline

Posts: 9,959


LIVE FREE OR DIE!


WWW
« Reply #15 on: July 24, 2008, 04:33:54 AM »

Quote
Basically fema - you would neverwant to convert ANYTHING to wave, as wave IS the RAW audio the comes off a cd and that your cd player reads - once it's been transcoded to another formay i.e. mp3, ogg, wma etc - it will always only be as good as that encoding.

If I'm gonna chop it up, normalize or set the levels, or do any modification I always convert from .mp3 to .wav first, do the modifications, then re-encode to the original bitrate in order to preserve quality and maximize compression.
Logged

iks83
Member
*****
Offline Offline

Posts: 2,521


« Reply #16 on: July 24, 2008, 05:29:43 AM »

but usually the program you are loading your mp3 into is automaticly loading it as uncompressed wave to work with it. if you want to store it between editing sessions then yes, save uncompressed or in a lossless format but if you just wanna edit a 10 minute audio then just load it and edit and save.
Logged
Femacamper
Member
*****
Offline Offline

Posts: 9,959


LIVE FREE OR DIE!


WWW
« Reply #17 on: July 26, 2008, 05:11:19 AM »

I tend to use multiple programs, so this is handier for me.

For example, the levelator does a kick-ass job of setting the proper levels for mp3s, but I need to have a .wav for that program.
Logged

iks83
Member
*****
Offline Offline

Posts: 2,521


« Reply #18 on: July 26, 2008, 08:43:16 AM »

well in that case it would be better to convert to wave first but if you only use one program then you wont need to do that.
Logged
wvoutlaw2002
Guest
« Reply #19 on: October 25, 2008, 05:34:35 PM »


Pitfalls:
Interlacing:  Some DVD sources are interlaced (not progressive scan) and if you do not de-interlace then you'll see some really annoying lines in the movement.  I use MEDIAINFO.exe (found in the k-lite codec pack) to scan all media sources before I begin encoding.


Ah. So no wonder I see those annoying lines when I play a DVD on Xubuntu with Totem and VLC and Xine.
Logged
Femacamper
Member
*****
Offline Offline

Posts: 9,959


LIVE FREE OR DIE!


WWW
« Reply #20 on: October 25, 2008, 06:33:38 PM »

You should be able to select a deinterlace filter in the settings.
Logged

Femacamper
Member
*****
Offline Offline

Posts: 9,959


LIVE FREE OR DIE!


WWW
« Reply #21 on: October 29, 2008, 08:27:55 PM »

So if I "enhance" a .wav (originally a 64 kbps .mp3) with various filters, should I re-encode it at a higher quality to preserve the enhanced audio?

I love using The Levelator, as a lot of the interviewees on the show speak quieter than Alex, so it's better to have balanced levels.

I'm not sure if I would do much else in terms of "enhancing," but I might cut out parts, and since I split the file into hours, would it be more prudent to re-encode?
Logged

chakra71
Member
***
Offline Offline

Posts: 232



WWW
« Reply #22 on: October 30, 2008, 05:35:18 AM »

since the levelator has to have a .wav file you'll have to encode to .wav then encode back to mp3.  I've found that it's best to encode slightly higher than the original bitrate to avoid additional loss of quality when in a tight situation, such as the 32k files I work with (or less on other shows).  Since you are working with a 64k original I would probably leave it at 64k.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.17 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!