VideoHelp Forum
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. Member
    Join Date
    Mar 2015
    Location
    United States
    Search Comp PM
    I was looking for a MKV to Mp4 converter that doesn't reformat the video file but only changes the container. I think that's how you say it. I've been using MkvToMp4 and love it, but unfortunately it doesn't seem to handle x265. I also need an AVI (w/Xvid) to Mp4 (x264 or x265) converter that essentially does the same thing. It's my understanding that it has to be reformatted, but I was hoping to find a program that would do batches and automatically detect and use the settings from the AVI in the conversion. I want the size to stay in the same ballpark, but I'm more concerned with keeping the frame rate, bit rate, and resolution the same as the original file. Thanks for any suggestions.
    Quote Quote  
  2. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    Originally Posted by DiSaSseMbLeDmNd View Post
    I also need an AVI (w/Xvid) to Mp4 (x264 or x265) converter that essentially does the same thing.
    What would be the point of that?

    And it would not do the same thing, it would transcode XVID to H.26x

    What kid of source do you currently have encoded in H.265 in MKV?
    Quote Quote  
  3. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Originally Posted by newpball View Post
    What would be the point of that?
    Hmm. I thought this place was VideoHelp, not VideoInquisition.

    I am a big FFmpeg fan. It does just about everything Disa wants, and it makes pretty good guesses when you don't spec all the params. The downside, of course, is that it's a command line tool and you have to be comfy with that and writing batch scripts.
    Quote Quote  
  4. Member
    Join Date
    Mar 2015
    Location
    United States
    Search Comp PM
    My apologies newpball for not wording what I was looking for in an AVI converter so as not to leave any doubt what I needed it to do. Actually I take that back. The reason I posted this in the Newbie section versus the Video Conversion section is because I recognize that as a newbie I was bound to make a newbie mistake, and guess what....I did. Go figure.

    Re-worded request for program suggestions: I'm looking for an AVI to Mp4 converter that will automatically detect the media info in the original file and use it to transcode the video from Xvid to x264 (or x265) without dramatically increasing the overall size.

    Thanks for the suggestion JVRaines. I've read a little about ffmpeg and would love to learn how to use it. It's just so daunting when you are just starting out and you are teaching yourself. I did go to the tutorial page and was able to convert one of my AVI files using ffmpeg . Of course I just copy/pasted the command and I have no idea what any of it meant . Spring break is coming up so maybe i'll spend some of it trying to decipher all that chicken-scratch looking code.
    Quote Quote  
  5. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    Originally Posted by DiSaSseMbLeDmNd View Post
    I'm looking for an AVI to Mp4 converter that will automatically detect the media info in the original file and use it to transcode the video from Xvid to x264 (or x265) without dramatically increasing the overall size.
    Well, since we are here to help I say that unless you have a streaming bottleneck and have no alternative it does not make any sense to transcode Xvid. You get the best possible quality if you leave it the way it is, any new transcode will only make things worse or the same but that you would definitely increase the size.

    Makes sense?

    Last edited by newpball; 23rd Mar 2015 at 08:15.
    Quote Quote  
  6. Originally Posted by newpball View Post
    Originally Posted by DiSaSseMbLeDmNd View Post
    I'm looking for an AVI to Mp4 converter that will automatically detect the media info in the original file and use it to transcode the video from Xvid to x264 (or x265) without dramatically increasing the overall size.
    Well, since we are here to help I say that unless you have a streaming bottleneck and have no alternative it does not make any sense to transcode Xvid. You get the best possible quality if you leave it the way it is, any new transcode will only make things worse or the same but that you would definitely increase the size.

    Makes sense?
    So when you take a source compressed with an older codec such as Xvid and re-encode it with a more efficient encoder such as x264 or x265 you'd always expect the file size to increase? Why is that?
    Generally if I'm converting Xvid to h264 it's in order to clean it up a bit in the process, and that makes it a bit easier to compress, but at a CRF value of 18 or 19 the average file size would usually decrease a little. Sometimes quite a lot.

    Originally Posted by DiSaSseMbLeDmNd View Post
    Re-worded request for program suggestions: I'm looking for an AVI to Mp4 converter that will automatically detect the media info in the original file and use it to transcode the video from Xvid to x264 (or x265) without dramatically increasing the overall size.
    I'm not exactly sure what you mean by "automatically detect the media info" but there's plenty of GUIs that'll re-encode AVIs as MP4 with the x264 encoder. If you don't want anything to change as such, you'd keep cropping and resizing disabled. Many GUI's will let you copy the existing audio rather than re-encode it (assuming it's compatible with the output container).
    Maybe try Vidcoder or Handbrake. Generally you'd pick a quality (RF value) and for the same RF value the output files will be pretty much the same quality relative to the original each time. The file sizes will usually vary quite a bit but after a few encodes you'll probably settle on a RF value that gives you an average file size you're happy with along with a quality you're happy with.
    Quote Quote  
  7. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    Originally Posted by hello_hello View Post
    So when you take a source compressed with an older codec such as Xvid and re-encode it with a more efficient encoder such as x264 or x265 you'd always expect the file size to increase? Why is that?
    For the same or very close quality the file size would obviously have to increase.

    The reason is simple: the new encoder has to start with a full size H x V x (3/color compression) uncompressed source. Certainly it could take advantage of blocks that look already compressed but compression schemes are different and blocks may not overlap. A CRF of 18 or 19 is not against the now lost original but against the already degraded Xvid source.

    The question is really why anyone would want to do this. Lossy transcoding obviously never makes things any better, you can't recreate details that are lost during lossy compression.

    Imagine you have a crappy picture then taking a photograph with an $8000 Canon EOS-1D of that picture will not improve things at all. If you have 1000 Xvid sources, saying "let me just transcode them all into H.264" is not going to improve anything, in fact it will make things worse.

    Of course of you want to edit a source you have to transcode anyway so then it is better to use a more efficient codec.
    Last edited by newpball; 26th Mar 2015 at 11:10.
    Quote Quote  
  8. Originally Posted by newpball View Post
    Originally Posted by hello_hello View Post
    So when you take a source compressed with an older codec such as Xvid and re-encode it with a more efficient encoder such as x264 or x265 you'd always expect the file size to increase? Why is that?
    For the same or very close quality the file size would obviously have to increase.

    The reason is simple: the new encoder has to start with a full size H x V x (3/color compression) uncompressed source. Certainly it could take advantage of blocks that look already compressed but compression schemes are different and blocks may not overlap.
    I'm curious. Have you ever encoded a video before?
    I can take a DVD video (mpeg2) and re-encode it with the x264 encoder and dramatically reduce the file size. Every time. Take the last three episodes of a TV series I encoded today as an example. Only one audio stream, which I copied. Source vob file total sizes 2.5GB, 1.8GB and 1.8GB. Input resolution 720x576. Output file sizes, CRF18, 832MB, 634MB and 608MB. Output resolution, 960x540, so the pixel count increased a little. I'd probably need to encode those at something like CRF14 to have a chance of not reducing the file size. Not only didn't the blocks overlap, but I changed their shape, yet taking video compressed with a less efficient codec and re-encoding it with a more efficient one reduced the file size. Is there a special Xvid property with stops the same principle from ever applying?

    I've re-encoded Xvid with Xvid in the past and at a high quality setting still reduced the file size due to it being "lossy" while visually the encoded version and the source weren't very different at all. Sure, sometimes the file size needs to increase, depending on the quality of the source and how hard it is to compress etc, but I've re-encoded enough Xvid video with the x264 encoder to know you have to be encoding at a pretty transparent (high) quality to try to match the original file size most of the time.

    Originally Posted by newpball View Post
    The question is really why anyone would want to do this. Lossy transcoding obviously never makes things any better, you can recreate details that are lost during lossy compression.
    I know exactly what you mean. And not only can't you recreate details, every time you reduce the resolution that destroys the picture detail too.

    Original DVD video:
    Click image for larger version

Name:	before 1.jpg
Views:	1921
Size:	84.8 KB
ID:	30871

    Re-encoded version at one third the file size:
    Click image for larger version

Name:	after 1.jpg
Views:	1911
Size:	81.8 KB
ID:	30872

    This one's a bit harder to pick but close examination should show the re-encoded version looks a tad better.

    AVI:
    Click image for larger version

Name:	before 2.jpg
Views:	483
Size:	45.6 KB
ID:	30873

    Re-encoded version at a slightly higher resolution for a 50MB file size reduction (even though I resized those blocks again):
    Click image for larger version

Name:	after 2.jpg
Views:	498
Size:	46.6 KB
ID:	30874

    Originally Posted by newpball View Post
    Imagine you have a crappy picture then taking a photograph with an $8000 Canon EOS-1D of that picture will not improve things at all. If you have 1000 Xvid sources, saying "let me just transcode them all into H.264" is not going to improve anything, in fact it will make things worse.
    No, simply re-encoding won't improve things a such, and not everyone always applies filtering to try to improve the quality, but there's no doubt it can be done, however re-encoding won't necessarily increase the file size dramatically, chances are a more efficient encoder will reduce it and when you're re-encoding something like Xvid with x264, chances are most "theoretical" quality loss won't be visible because Xvid throws so much detail away to begin with.

    Originally Posted by newpball View Post
    Of course of you want to edit a source you have to transcode anyway so then it is better to use a more efficient codec.
    Do the rules change or does the file size still increase when you edit and re-encode?
    Last edited by hello_hello; 26th Mar 2015 at 12:48.
    Quote Quote  
  9. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    Originally Posted by hello_hello View Post
    I can take a DVD video (mpeg2) and re-encode it with the x264 encoder and dramatically reduce the file size.
    Of course you can, and the quality can be reasonably close to the original mpeg2. But there is obviously a loss every time you transcode. So then again I ask the question why? Why not leave those Xvids alone if you do not want to edit them? To save a couple of bytes? Why? After all, we are no longer storing things on floppies!

    Originally Posted by hello_hello View Post
    Take the last three episodes of a TV series I encoded today as an example. Only one audio stream, which I copied. Source vob file total sizes 2.5GB, 1.8GB and 1.8GB. Input resolution 720x576. Output file sizes, CRF18, 832MB, 634MB and 608MB. Output resolution, 960x540, so the pixel count increased a little.
    Let me ask you this: did you convert it to progressive 60fps or did you discard half of the information by 'magically merging' 2 fields taken at a different point in time into 1 single frame?

    Originally Posted by hello_hello View Post
    ...filtering to try to improve the quality.....
    You implicitly bring up a very good question, does filtering improve the quality of a source? Something that warrants a separate topic. Unfortunately I fear that a rational discussion cannot be held on this, I see images of folks foaming at the mouth and throwing ad hominems at those who dare to even pose this question.

    In a nutshell it is a complicated question and mostly depends on what you mean by quality. If quality is equal or at least proportional to fidelity then most filtering will certainly not improve quality. Some of it does however, filtering that attempts for reconstruct the original, e.g. some deinterlacing filters, super resolution filters, perhaps some statistical noise filtering, perhaps filtering that 'repairs' things but that becomes questionable. But other filters mostly obscure things.

    Don['t get me wrong, that's not a bad thing, but those filters do not improve fidelity.

    Quality in video is a controversial issue. Some people think an over sharpened video is better quality others think a semi-cartoonized video is a sign of better quality. Some perhaps think crushed blacks improve quality because you no longer see dark artifacts. I suppose it all depends where one is coming from.

    Originally Posted by hello_hello View Post
    Do the rules change or does the file size still increase when you edit and re-encode?
    Well, if you want to edit for whatever reason then except for the simplest cases you would obviously need to transcode.

    Quote Quote  
  10. Originally Posted by newpball View Post
    Originally Posted by hello_hello View Post
    I can take a DVD video (mpeg2) and re-encode it with the x264 encoder and dramatically reduce the file size.
    Of course you can, and the quality can be reasonably close to the original mpeg2. But there is obviously a loss every time you transcode. So then again I ask the question why? Why not leave those Xvids alone if you do not want to edit them? To save a couple of bytes? Why? After all, we are no longer storing things on floppies!
    If I re-encode AVIs, I generally do so to tidy them up. Maybe to reduce the noise, or reduce the encoder blocking a little. Or to clean up Xvid's attempt at encoding noise. We're all familiar with how that looks. Sometimes to fix aspect ratio problems. Sometimes to repair crappy de-interlacing a little. I've re-encoded to apply decimation and remove repeated fames. Sometimes I re-encode to crop a bit more cleanly, especially if they're 4:3 and likley to be displayed on a 16:9 screen. Logo removal is sometimes a reason I re-encode. If an AVI is already reasonable quality and doesn't require any of that, I probably wouldn't re-encode it. That's quite a few reasons for re-encoding I'd consider valid, but maybe someone might want to re-encode for other reasons. I remember a time you could post here for advice on re-encoding and you'd be offered help instead of being given the third degree and told not to do it, given this is a forum with a whole sub-forum dedicated to video conversion.

    Originally Posted by newpball View Post
    Originally Posted by hello_hello View Post
    Take the last three episodes of a TV series I encoded today as an example. Only one audio stream, which I copied. Source vob file total sizes 2.5GB, 1.8GB and 1.8GB. Input resolution 720x576. Output file sizes, CRF18, 832MB, 634MB and 608MB. Output resolution, 960x540, so the pixel count increased a little.
    Let me ask you this: did you convert it to progressive 60fps or did you discard half of the information by 'magically merging' 2 fields taken at a different point in time into 1 single frame?
    No, I didn't de-interlace the PAL video to progressive 60fps. I didn't de-interlace it at all. It was already progressive. Does it look as though I discarded half the information? Please tick the appropriate answer.

    Does the re-encoded version
    A: Look less detailed.
    B: Look more detailed.
    C: Look as though it has the same amount of detail.
    D: I'm ignoring the question because the answer doesn't suit me.

    Can you see a quality reduction in the screenshot of my AVI to MKV conversion? I was hoping you'd point out where you can see the quality loss.

    Originally Posted by newpball View Post
    Originally Posted by hello_hello View Post
    ...filtering to try to improve the quality.....
    You implicitly bring up a very good question, does filtering improve the quality of a source? Something that warrants a separate topic. Unfortunately I fear that a rational discussion cannot be held on this, I see images of folks foaming at the mouth and throwing ad hominems at those who dare to even pose this question.
    Fortunately I don't have to worry about any of that. Virtually every AVI I re-encode looks better than the original. If re-encoding reduced the visual quality and/or increased the file size dramatically I wouldn't do it. Yet I do. Quite frequently.

    Anyway, lets not argue theory because we'll just go around in circles. Attached are an AVI sample, a re-encoded version and a filtered/re-encoded version. Despite the lack of dramatic file size increase, and despite the fact there was no filtering involved at all, the re-encoded version looks better than the original to me. Why? Well for want of a better description, the lossy x264 encoder seems to have kindly thrown away some of the unwanted Xvid "noise". Ten seconds ago I'd have agreed that re-encoding on it's own couldn't possibly improve the quality. Who'd have guessed.....
    And of course the filtered version looks better than the source despite the file size reduction. Without knowing which was which in advance, I'd bet my last dollar most people would assume the filtered sample is the original and the AVI is the re-encode (aside from the logo removal giving it away). I'm not referring to those people who think crushed blacks improve the quality, because I'm fairly certain they're imaginary, but real people would think so.
    Image Attached Files
    Last edited by hello_hello; 27th Mar 2015 at 00:18.
    Quote Quote  
  11. Member
    Join Date
    Mar 2015
    Location
    United States
    Search Comp PM
    Thank you for the suggestions Hello. In some ways I'm looking for a converter that does the opposite of what Handbrake does. My goal is to one day be knowledgeable enough to understand and take advantage of all the options offered with Handbrake or with a command line tool like Ffmpeg. However, right now, and for the videos I'm looking to convert, I wanted a program that took the options out of my hands and made them for me by mimicking the source file's attributes. Essentially the aspect, bitrate, framerate and resolution. I'm assuming (and yes I know about ASSuming) that for the most part if it uses the same values as the original the resulting size and quality will be comparable enough for me. The reason I posted here was because I wanted to get suggestions from people familiar with the different choices. The programs I have tried all seem to leave out one variable or another. Take newpball's suggestion of VideoToVideo. It doesn't mimic the framerate; it forces you to use one of several preset values. This isn't a huge deal, but a lot of my videos have different values for different attributes and I'd like to find something where I don't have to worry about that. And of course efficiency is a concern. Someone with experience might be able to suggest a program that doesn't take forever and sap my CPU. At least that was my hope.

    I am glad this thread has sparked such a lively discussion. There is value to be had with the exchange of ideas, even when you don't agree with the other person's views. I know both of your posts have inspired me to want to increase my knowledge. Despite the type of program I am looking for with this forum request, I don't always want to just be a button pusher. One more thing that may help explain why I'm looking for a converter. I know it's a silly reason, but I'm rather OCD about my media collections, and since most of my videos are Mp4, I wanted them all to be that format .
    Quote Quote  
  12. Originally Posted by DiSaSseMbLeDmNd View Post
    In some ways I'm looking for a converter that does the opposite of what Handbrake does.
    I don't know what you mean by "the opposite". But Handbrake uses x264 just like all the other free (and many of the commercial) h.264 encoders. So they're all going to deliver the same quality at the same settings.
    Quote Quote  
  13. Originally Posted by DiSaSseMbLeDmNd View Post
    However, right now, and for the videos I'm looking to convert, I wanted a program that took the options out of my hands and made them for me by mimicking the source file's attributes. Essentially the aspect, bitrate, framerate and resolution. I'm assuming (and yes I know about ASSuming) that for the most part if it uses the same values as the original the resulting size and quality will be comparable enough for me. The reason I posted here was because I wanted to get suggestions from people familiar with the different choices. The programs I have tried all seem to leave out one variable or another.
    AVIs generally contain video with square pixels, so there's no aspect ratio to worry about. The resolution is also the aspect ratio. ie 640/480=1.33333 or 4:3 etc. So that part should be easy. If you disable cropping and resizing then what goes in should always match what comes out, in respect to resolution/aspect ratio. Handbrake should be able to set an aspect ratio automatically if need be though.

    Encoder GUIs usually default to outputting the same frame rate as the source. Handbrake can output variable frame rate, but you can set it to output a constant frame rate and "same as source", and that's what it'll do. 25fps in, 25fps out etc.

    I don't know of any encoder GUI that'll automatically match the source bitrate as it's not something you'd normally do. I don't use Handbrake myself and I can't check the latest version (it won't run on XP) but it should let you specify either a bitrate or file size. If it's the latter, it'll work out the appropriate birate for you. If the AVIs aren't the same size, you'll need to set a file size/bitrate for each one manually if you want them to match, but it's not the best method. I'd pick a quality and the bitrate will be whatever it needs to be. Depending on the source video and the quality you choose, some might end up larger than the original, some might end up smaller, but they'll all be around the same quality relative to the source. The bitrate will vary according to how hard the video is to compress. A quality setting of CRF18 might be a good place to start. Higher CRF values decrease the quality and the bitrate, and lower CRF values increase the quality. You'll probably find, after a few encodes, a CRF value that'll give you file sizes similar to the source AVIs..... on average. Between CRF18 and CRF22 should look pretty good.

    When you set a bitrate you're effectively pre-determining the quality, only you don't know what it'll be. Do you have AVIs of identical resolution and bitrate but some look really nice while others, not so much? That'd probably be because some of the video within was easier to compress than other video and the quality was therefore different for the same bitrate. Matching the encoder bitrate doesn't match the original quality. Unfortunately, it doesn't work that way.
    For example if your source AVI was overly compressed with lots of compression artefacts, the encoder has to try to re-encode those along with the video and that'll increase the bitrate for a specific quality. If the source is nice and clean, you might be able to re-encode it at a much lower bitrate as it's easier to compress, even if the two AVIs have exactly the same bitrates themselves.

    Originally Posted by DiSaSseMbLeDmNd View Post
    Take newpball's suggestion of VideoToVideo. It doesn't mimic the framerate
    Selecting "auto" for the frame rate should give you the same as the original each time. Probably likewise for the resolution.
    I don't think Video To Video Converter has a quality based encoding option though.

    Originally Posted by DiSaSseMbLeDmNd View Post
    And of course efficiency is a concern. Someone with experience might be able to suggest a program that doesn't take forever and sap my CPU. At least that was my hope.
    Generally the idea is to run the CPU as close to maximum as possible. Depending on the version of Windows and/or the encoder GUI, you should be able to set a low priority for the encoder. That way you should still be able to do other things and the encoding won't slow you down. The harder the encoder works the CPU, the faster it can encode. I'm currently running two simultaneous encodes with a four core CPU and CPU usage is a fairly constant 100%. I can still use the computer as I normally would. If not for the CPU fan working harder I wouldn't know it was encoding.

    Originally Posted by DiSaSseMbLeDmNd View Post
    One more thing that may help explain why I'm looking for a converter. I know it's a silly reason, but I'm rather OCD about my media collections, and since most of my videos are Mp4, I wanted them all to be that format.
    I'm also somewhat OCD. If it's standard definition Xvid, it's an AVI. Everything else is MKV. The first thing I do when I come across an MP4 is open it with MKVMergeGUI and remux it as an MKV, because MP4 is such a painful container format to work with compared to MKV. If you need MP4 because a device requires it, I guess you've got no choice, but MKVMergeGUI makes working with MKVs fairly easy.
    Having said that, I'm not aware of any GUIs capable of x264 encoding that can't output an MP4.

    And having said all that, I assume putting the existing AVI video and audio into an MP4 container isn't an option? It needs to be re-encoded?
    Last edited by hello_hello; 27th Mar 2015 at 00:28.
    Quote Quote  
  14. Member
    Join Date
    Mar 2015
    Location
    United States
    Search Comp PM
    [QUOTE=hello_hello;2382324]
    Originally Posted by DiSaSseMbLeDmNd View Post
    And having said all that, I assume putting the existing AVI video and audio into an MP4 container isn't an option? It needs to be re-encoded?
    I didn't know it was possible to switch containers between AVI and MP4. That is actually exactly what I want to do. I thought you had to re-code or transcode or whatever it's called. When I said I wanted to mimic the original source file (the AVI), that's because I essentially wanted the same audio and video, just in the M4 format. That's what MkvToMp4 use to do for me for my MKV videos, just switched the container. Unfortunately it doesn't work with x265 (only x264), and it never worked with the AVI format (at least that I know of).
    Quote Quote  
  15. Try Video To Video Converter. When you add the AVIs for "conversion" it'll open up a window with a list of conversion presets. The one you want is "Direct Stream Copy". It's the last preset under the Video tab. After you've selected it, change the output container on the right hand side to MP4 and click okay.
    Once that's done, just click "Convert". It won't actually be converting, as no doubt you'll be able to tell from the speed at which it runs.

    If Video To Video Converter works, which it should, you can load all the AVIs together, choose Direct Stream Copy etc and it'll batch remux them all for you. If for some reason that's not successful, try My MP4Box GUI. If memory serves me correctly when you open an AVI with My MP4Box GUI it only shows the video in the AVI, but I'm pretty sure when you remux the audio will still be included.

    What playback device will you be using to play the MP4s? It definitely supports the existing audio and video formats? It might pay to test a file or two before getting too carried away.
    Last edited by hello_hello; 27th Mar 2015 at 17:39.
    Quote Quote  
  16. Member
    Join Date
    Mar 2015
    Location
    United States
    Search Comp PM
    Thanks for the suggestion hello. The Direct Stream Copy option in Video To Video Converter seems to work. The output file has pretty much the same settings as the original, although MediaInfo says the Format settings, Matrix is x263 and the writing library says XviD 1.0.3. It's an MP4 and it plays though. I'm thinking this will work for the videos that start out crappy, but for the others I'd better wait until I learn how to use Handbrake and all it's settings.

    I use a combination of MPC and VLC. MPC only plays the audio on videos encoded with x265, but VLC doesn't play the audio on all my FLV files. I haven't used my Samsung Tab 3 to watch many videos yet, but MX Player seems to play everything I've thrown at it so far.

    Thanks again for all your help and advice.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!