VideoHelp Forum
+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 67
Thread
  1. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    I fancy to convert an avi file to dvd format to watch it on my dvd player ... without reading the 100 pages of manuals and tutorials.

    I wanted to use ffmpeg which makes sense to me and I successfully used to convert some audio file. No readily available guides on google, so I thought I should use transcode, tcextract, mplex and dvdauthor, as instructed here: http://www.linuxquestions.org/linux/answers/Applications_GUI_Multimedia/AVI_to_DVD.
    Fortunately, I found mencoder: http://mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html#menc-feat-vcd-dvd-all-pal-dvd, which needs one line only, at least to get the mpeg.

    I chose NTSC (I have no idea why), and I got messages that one frame is duplicate every .1s. The image was distorted and I had horizontal lines on fast motion. Also, the size of the file more than doubled, but it still fits on a DVD. Using google, I added a black border to solve the distortion (not sure that two 16:9 options is cool) and I deinterlaced to lose the horizontal lines on fast motion. Still one frame is duplicate every .1s and now the image is blurred. Google did not help me on this last issue, the blur. So you have the chance to push the limits for people who just want to convert one avi to DVD without reading the 100 pages manuals and tutorials.

    Technical data:
    Input file:
    Code:
    $ ffmpeg -i file.avi
    FFmpeg version SVN-r0.5.9-4:0.5.9-0ubuntu0.10.04.1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
      configuration: --extra-version=4:0.5.9-0ubuntu0.10.04.1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
      libavutil     49.15. 0 / 49.15. 0
      libavcodec    52.20. 1 / 52.20. 1
      libavformat   52.31. 0 / 52.31. 0
      libavdevice   52. 1. 0 / 52. 1. 0
      libavfilter    0. 4. 0 /  0. 4. 0
      libswscale     0. 7. 1 /  0. 7. 1
      libpostproc   51. 2. 0 / 51. 2. 0
      built on Jun 12 2012 16:27:34, gcc: 4.4.3
    Input #0, avi, from 'file.avi':
      Duration: 00:49:50.00, start: 0.000000, bitrate: 1631 kb/s
        Stream #0.0: Video: msmpeg4, yuv420p, 544x256, 25 tbr, 25 tbn, 25 tbc
        Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
    At least one output file must be specified
    Last used command:
    Code:
    mencoder -ss 420 -endpos 5 -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf   -vf yadif,expand=aspect=16/9,scale=720:480,harddup -srate 48000 -af lavcresample=48000   -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001 -o file.mpg file.avi
    Here yadif,expand=aspect=16/9 and -ss 420 -endpos 5 are added by myself.

    Output file:
    Code:
    $ ffmpeg -i file.mpg 
    Seems stream 0 codec frame rate differs from container frame rate: 59.94 (60000/1001) -> 29.97 (30000/1001)
    Input #0, mpeg, from 'file.mpg':
      Duration: 00:00:04.80, start: 0.233367, bitrate: 3423 kb/s
        Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9800 kb/s, 29.97 tbr, 90k tbn, 59.94 tbc
        Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    At least one output file must be specified
    Last edited by Baldrick; 27th Aug 2012 at 06:07. Reason: titles format
    Quote Quote  
  2. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    It's been a while since I've done any DVD authoring, but as nobody else has suggested anything...

    A few points:
    - the source is 25fps (don't change the framerate to NTSC rates unless you have to). Your location isn't in your profile (it'd really help if you added it). TVs in the States don't generally play framerates like 25p, but TVs in other parts of the world are often multi-standard.
    - looking at the info you posted, there's no aspect ratio flag to specify something other than square pixels, which suggests the source might have a display AR of roughly 2.1:1. Is the source a movie?

    I'm sure this can be done with mencoder (which I've used in the past), but I'm more familiar with ffmpeg these days:

    (assuming your TV can display 'PAL' video):
    Code:
    ffmpeg -i file.avi -vf scale=702:482,pad=720:576:"(out_w-in_w)/2":"(out_h-in_h)/2" -target pal-dvd -c:a ac3 -b:a 384k -aspect 16:9 output.mpg
    you also might want to try this which gives better quality output:
    Code:
    ffmpeg -i input.avi -vf scale=702:482,pad=720:576:"(out_w-in_w)/2":"(out_h-in_h)/2" -target pal-dvd -c:a ac3 -b:a 384k -mbd rd -trellis 2 -cmp rd -subcmp rd -qscale 2.0 -aspect 16:9 output_hq.mpg
    *no promises that the last example will give DVD compliant output
    - if the bitrate(quality) is too high change the value of qscale: 1.0 = high quality, 4.0 = lower quality

    Both the examples above should generate video that is directly compatible with dvdauthor

    If you need to convert to NTSC, you'll obviously have to change the res and framerate - changing the res is easy, but I don't know the best way to change the framerate.
    Quote Quote  
  3. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    - Sorry, I forgot to cover the interlacing issue in the last post:

    I don't know why you're seeing interlacing artefacts on the source.

    The vertical resolution is 256px - and it's rather uncommon to find interlaced videos at non-standard resolutions like this.

    But if it *is* indeed interlaced, you'll obviously need to do an interlaced aware scale at the beginning of ffmpeg's filter chain.

    EDIT: The '-target' option stops the video filters working properly. If the source is genuinely interlaced, this will be a problem.
    Last edited by intracube; 24th Aug 2012 at 11:15. Reason: removed example that doesn't work as expected
    Quote Quote  
  4. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Thank you for your answer.
    I am in Romania, my TV can display PAL.
    It is a movie.

    Code:
    ffmpeg -i file.avi -vf scale=702:482,pad=720:576:"(out_w-in_w)/2":"(out_h-in_h)/2" -target pal-dvd -c:a ac3 -b:a 384k -aspect 16:9 output.mpg
    -vf, scale, pad, out_w, in_w, out_h, in_h, pad-dvd and -c do not exist in ffmpeg man. There are some scales and pads, -target accepts dvd and pal-vcd, -acodec ac3, and -ab sets the audio bit rate.
    Error message: "ffmpeg: unrecognized option '-vf'".

    If you sort out scale and pad, the rest should be easy to fix?
    Last edited by doru001; 24th Aug 2012 at 10:36. Reason: -ba --> -ab
    Quote Quote  
  5. Member
    Join Date
    Mar 2011
    Location
    Nova Scotia, Canada
    Search Comp PM
    I'm confused about a couple of things. First, if you're in Romania it should, frankly, be fairly obvious you want PAL dvd format.

    Second, you say you don't want to read hundreds of pages of manuals but you're using command line ffmpeg? There are a number of more understandable dvd encoders/authors for linux. Check out the tools section.
    Quote Quote  
  6. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by doru001 View Post
    -vf, scale, pad, out_w, in_w, out_h, in_h, pad-dvd and -c do not exist in ffmpeg man. There are some scales and pads, -target accepts dvd and pal-vcd, -acodec ac3, and -ab sets the audio bit rate.
    Error message: "ffmpeg: unrecognized option '-vf'".
    It sounds like you've got an old version of ffmpeg. You should use the latest version (0.11.1) to use those options.

    If you sort out scale and pad, the rest should be easy to fix?
    Unfortunately there's another problem...

    I regularly use the scale, pad, yadif filters, but I use them when encoding to other formats (h264/mpeg4/etc) - not when converting to DVD-Video.

    Unfortunately, for some reason the '-target' option stops the video filters working properly, so you might end up with bad interlacing artefacts. Do you know if the source video is actually interlaced? If it isn't interlaced, then you can use one of the examples in post #2. If it is interlaced, I don't know of a workaround right now.

    I don't know if there's another way to get ffmpeg to encode DVD compliant video without using the '-target' option.

    Sorry, this is my fault - I should have tested the example I posted and not assume it would just work.
    Quote Quote  
  7. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Originally Posted by intracube View Post
    - Sorry, I forgot to cover the interlacing issue in the last post:

    I don't know why you're seeing interlacing artefacts on the source.

    The vertical resolution is 256px - and it's rather uncommon to find interlaced videos at non-standard resolutions like this.

    But if it *is* indeed interlaced, you'll obviously need to do an interlaced aware scale at the beginning of ffmpeg's filter chain.

    EDIT: The '-target' option stops the video filters working properly. If the source is genuinely interlaced, this will be a problem.
    I believe that the avi is interlaced because I saw those horizontal lines during fast motion in the converted file and they disappeared after I applied the yadif filter in mencoder. If you know how can I find out whether the avi is interlaced or not, please let me know. ffmpeg is supposed to show this somehow, I think.
    Quote Quote  
  8. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Originally Posted by Hoser Rob View Post
    I'm confused about a couple of things. First, if you're in Romania it should, frankly, be fairly obvious you want PAL dvd format.
    It is fairly obvious if you know something about video formats. Now I begin to understand. I had no idea that my avi's fps is closer to PAL and that PAL is used in most places outside US.

    Originally Posted by Hoser Rob View Post
    Second, you say you don't want to read hundreds of pages of manuals but you're using command line ffmpeg? There are a number of more understandable dvd encoders/authors for linux. Check out the tools section.
    My system is extremely slow especially on GUI. It is a unicore without mmx circuits or something like that. Also, I am learning linux anyway, and command line is not as bad as it looks like. After you find out the few options you actually need, it is better than GUI for a number of reasons: speed, easy automatization, easier to note it in a text file, rarely changes between versions, easy to use remotely, offers you a better understanding of underlying software (standards, api). However, I have never seen something as complicated as video processing, I give that to you.

    What I really miss here is an understanding of video formats and terminology. This is difficult to put together because there are no good integrated presentations on the Internet on the issue (Internet is very fragmented by its nature), and the ffmpeg manual alone is uncomprehensible for me.
    Last edited by doru001; 25th Aug 2012 at 03:40. Reason: more explanations
    Quote Quote  
  9. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Originally Posted by intracube View Post
    It sounds like you've got an old version of ffmpeg. You should use the latest version (0.11.1) to use those options.

    If you sort out scale and pad, the rest should be easy to fix?
    Unfortunately there's another problem...

    I regularly use the scale, pad, yadif filters, but I use them when encoding to other formats (h264/mpeg4/etc) - not when converting to DVD-Video.

    Unfortunately, for some reason the '-target' option stops the video filters working properly, so you might end up with bad interlacing artefacts. Do you know if the source video is actually interlaced? If it isn't interlaced, then you can use one of the examples in post #2. If it is interlaced, I don't know of a workaround right now.

    I don't know if there's another way to get ffmpeg to encode DVD compliant video without using the '-target' option.

    Sorry, this is my fault - I should have tested the example I posted and not assume it would just work.
    Thank you for your answer. Updating ffmpeg would be quite difficult, and it is not worth it if it won't solve my problem. I can't be sure that my video is interlaced or not, and the problem you describe with -target on the last version of ffmpeg looks to me like a new version's bug, or unfinished work.

    Ridiculously enough, I did install the last version of ffmpeg on my system a few months ago. To do it again, I would have to remove current ffmpeg repositories, dowload, compile, create a number of packages and install them. Compilation alone takes more than 4 hours, as I remember. I might do it, if I know that it works. The new syntax, I must say, looks great and clear.

    A solution that I have in mind right now would be to use the old version of ffmpeg. However, I can't find these scaling options. The rest looks fine, padding and all. Maybe they changed the terminology, can you help me with this? This looks very much like my manual: http://linux.die.net/man/1/ffmpeg. If you can find there some scaling, that should put me on the right track.

    Thank you again.

    PS. If you know of any good presentation on video formats on the internet, please post the link. By good I mean more detailed than just containers and streams, but still readable and not going into the smallest details.
    Last edited by doru001; 25th Aug 2012 at 03:49. Reason: PS
    Quote Quote  
  10. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    The sad fact is that ffmpeg makes horrible looking MPEG-2 DVD videos. It always uses way too little bitrate (regardless of what you tell it). It's worthless for MPEG-2 encoding if you ask me (at least if you care about quality).

    When I used Linux heavily (I don't much anymore) but when I did ... I always used HCenc for MPEG-2 encoding. It works in Linux if you have WINE installed. It's a very good MPEG-2 DVD compliant encoder.

    ffmpeg is good for a lot of stuff but not, ironically, for MPEG-2 DVD encoding.
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  11. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Originally Posted by FulciLives View Post
    The sad fact is that ffmpeg makes horrible looking MPEG-2 DVD videos. It always uses way too little bitrate (regardless of what you tell it). It's worthless for MPEG-2 encoding if you ask me (at least if you care about quality).

    When I used Linux heavily (I don't much anymore) but when I did ... I always used HCenc for MPEG-2 encoding. It works in Linux if you have WINE installed. It's a very good MPEG-2 DVD compliant encoder.

    ffmpeg is good for a lot of stuff but not, ironically, for MPEG-2 DVD encoding.
    It simply can't be that bad ... . So this HCenc is freely available and you ran it without having Windows on the system? I'm asking this because I believe that wine is using sometimes libraries from a windows partition, even if you are running linux at the time of the command.
    Quote Quote  
  12. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    WINE doesn't use anything from a Windows partition. All you need is Linux and WINE and nothing else Windows related. Although HCenc needs AviSynth for input but AviSynth for Windows also works under WINE

    Both HCenc and AviSynth are very simple so they ran fine under WINE on Linux and this was stuff I did probably a good 3 years ago so obviously Linux and WINE today are even better.

    Should run fine for you.
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  13. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Originally Posted by FulciLives View Post
    WINE doesn't use anything from a Windows partition. All you need is Linux and WINE and nothing else Windows related. Although HCenc needs AviSynth for input but AviSynth for Windows also works under WINE

    Both HCenc and AviSynth are very simple so they ran fine under WINE on Linux and this was stuff I did probably a good 3 years ago so obviously Linux and WINE today are even better.

    Should run fine for you.
    Thank you for the info. Indeed, ffmpeg is well documented on the net, but there is nothing about using it to make dvd's.

    About wine, indeed, now I remember that I used it to run applications on a mounted Windows partition. When I copied the executables on the linux partition, it could not find the libraries, but this is not the case with the two applications which you recommended to me. They and wine work perfectly.

    The only problem is that I can't open the input.avi file because HCenc only knows about *.d2v and *.avs. What can you tell me about this?
    Quote Quote  
  14. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by doru001 View Post
    I believe that the avi is interlaced because I saw those horizontal lines during fast motion in the converted file and they disappeared after I applied the yadif filter in mencoder.
    Yep, sounds like the source is interlaced.

    Originally Posted by doru001 View Post
    If you know how can I find out whether the avi is interlaced or not, please let me know. ffmpeg is supposed to show this somehow, I think.
    If an interlaced video has been properly encoded, there should be an embedded flag to say that it's interlaced. But it's quite common to see videos that *are* interlaced, but don't have this flag set - like your source video.

    The opposite is also possible - progressive video but flagged as interlace. This won't cause such obvious problems though.

    I don't fully understand the info returned by ffmpeg's '-i' option in your first post - but "25 tbr, 25 tbn, 25 tbc" seems to be saying the source is wrongly flagged progressive (or not at all), whereas your test output "29.97 tbr, 90k tbn, 59.94 tbc" is correctly flagged as interlaced (although it's the wrong framerate).

    mediainfo is useful for giving detailed info.

    Originally Posted by doru001 View Post
    the problem you describe with -target on the last version of ffmpeg looks to me like a new version's bug, or unfinished work.
    Yes. If I have time, I'll submit a bug report and see what the ffmpeg developers say about this.

    Ridiculously enough, I did install the last version of ffmpeg on my system a few months ago. To do it again, I would have to remove current ffmpeg repositories, dowload, compile, create a number of packages and install them. Compilation alone takes more than 4 hours, as I remember. I might do it, if I know that it works.
    You can almost certainly get an up to date version of ffmpeg by adding an additional repository to you linux distro. I don't use Ubuntu - so you'll need to search for this info or ask in their forums.

    If you know of any good presentation on video formats on the internet, please post the link. By good I mean more detailed than just containers and streams, but still readable and not going into the smallest details.
    Wikipedia is a good place to start.

    A solution that I have in mind right now would be to use the old version of ffmpeg. However, I can't find these scaling options. The rest looks fine, padding and all. Maybe they changed the terminology, can you help me with this? This looks very much like my manual: http://linux.die.net/man/1/ffmpeg. If you can find there some scaling, that should put me on the right track.
    I can't test this as my version of ffmpeg no longer supports this syntax:
    ffmpeg -i file.avi -deinterlace -s 702x482 -padtop 46 -padright 9 -padbottom 48 -padleft 9 -target pal-dvd -acodec ac3 -ab 229376 -mbd 2 -qscale 2.0 -aspect 16:9 output.mpg
    Quote Quote  
  15. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by FulciLives View Post
    The sad fact is that ffmpeg makes horrible looking MPEG-2 DVD videos. It always uses way too little bitrate (regardless of what you tell it).
    Yes, ffmpeg does a good job of ignoring the specified bitrate when encoding mpeg2 so the bitrate setting alone can't be used to control the quality. The quality can be controlled using other parameters, like -qscale, which will set a fixed quantization.

    There are quite a few options that can be set to improve the quality - but I never fully understood what they did, and it's been ages since I've done mpeg2 encoding. The little I picked up has faded from my mind

    "every time I learn something new, it pushes some old stuff out of my brain"
    -- Homer Simpson
    Quote Quote  
  16. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Originally Posted by intracube View Post
    mediainfo is useful for giving detailed info.
    I visited it, it looks really great. Who would have thought that ffmpeg is not up to this task. Probably lots of guessing is required.
    Originally Posted by intracube View Post
    Yes. If I have time, I'll submit a bug report and see what the ffmpeg developers say about this.
    You may post the link to the bug report here.
    Originally Posted by intracube View Post
    You can almost certainly get an up to date version of ffmpeg by adding an additional repository to you linux distro. I don't use Ubuntu - so you'll need to search for this info or ask in their forums.
    You are right, I avoided doing this for security reasons and to get the very latest version, but now it looks like a good solution. This version would cover my old installed version automatically, so no problem.
    Originally Posted by intracube View Post
    Wikipedia is a good place to start.
    If you say that it is comprehensible ...
    Originally Posted by intracube View Post
    Code:
    ffmpeg -i file.avi -deinterlace -s 702x482 -padtop 46 -padright 9 -padbottom 48 -padleft 9 -target pal-dvd -acodec ac3 -ab 229376 -mbd 2 -qscale 2.0 -aspect 16:9 output.mpg
    I had to change a few things:
    Code:
    ffmpeg -ss 420 -t 30 -i file.avi -deinterlace -s 702x482 -padtop 46 -padright 8 -padbottom 48 -padleft 8 -target pal-dvd -acodec ac3 -ab 448000 -mbd 2 -qscale 2.0 -aspect 16:9 file.mpg
    padright and padleft must be even. -ab is computed with 1000, not 1025, because it is a serially transmitted data. I deleted it because of some unclear message error and the output file had this rate, so I used it in the command.

    The video is blurred. It seems a bit distorted, but the distortion correction clearly works, it is not distorted as it was first time, so I can improve it. The sound seems good. So this is great, I have a command for ffmpeg. Where should I look further, to improve the video quality? Size can increase, there is room on the DVD.

    Thank you for your help. Of course it is not pleasant to remember outdated syntax.

    PS: no more duplicate frames or any other ugly messages.
    Last edited by doru001; 25th Aug 2012 at 12:39. Reason: PS
    Quote Quote  
  17. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    You need to create a D2V project file from the DVD using a simple program called DGIndex. Sorry I forgot to mention that part!

    Here's a guide: CLICK HERE

    That guide is on another website but it's nice and simple and does the trick. I'm sure we have guides on this site as well if you look.

    Anyway DGIndex makes the D2V file which you referrence in you AviSynth script. DGIndex will also demux all your audio tracks from the DVD.
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  18. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by doru001 View Post
    You may post the link to the bug report here.
    https://ffmpeg.org/trac/ffmpeg/ticket/1682

    padright and padleft must be even.
    In that case, you should change the scale option to 704x482 as 702 + 8 + 8 doesn't give 720 and ffmpeg is quite possibly scaling the video again to get it to 720px wide (softening the image further).

    The video is blurred. It seems a bit distorted, but the distortion correction clearly works, it is not distorted as it was first time, so I can improve it. The sound seems good. So this is great, I have a command for ffmpeg. Where should I look further, to improve the video quality?
    Try changing the qscale value to somewhere between 1.0 and 2.0 - 1.0 will give higher quality. Unfortunately your version of ffmpeg has no sharpening filters, so not much can be done there. I'd have to see a still or short video sample to give any suggestions on fixing the distortion.

    I might be able to find some mencoder DVD encoding examples I wrote a while back if you want to try that also. ISTR I had a/v sync problems at the time, but I can't remember the details.
    Quote Quote  
  19. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    Sorry I dunno where my head is today LOL

    I mentioned using DGIndex but you only have to do that when your source is a DVD Rip (in other words you ripped a DVD to your HDD without doing any processing to it ... other than ripping it).

    When you have an AVI file you need to make an AVS script. Even with DGIndex you still need to make an AVS scrip. An AVS script is why I mentioned installing AviSynth.

    The best way to do that is to install a simple program called FitCD and then you load your AVI file into that. FitCD will allow you to adjust (resize) the file accordingly and give you a working AviSynth script that you can save and then open into HCenc.

    So basically anything you want to do to the file in terms of resizing it or doing any filters (to clean up the image etc.) are done in the AviSynth AVS script and HCenc is just for MPEG-2 encoding (and setting the parameters JUST for MPEG-2 encoding).

    As I have mentioned before ... I have done all this in Linux but not in some time. I happen to have Ubuntu 12.04 LTS 32-Bit installed in VirtualBox so I can access it from Windows. For all intents and purposes this is the same as if I had a full install.

    So I went ahead and installed everything (which I got from VideoHelp using the TOOLS section here). I installed the following:

    HCenc
    AviSynth
    DGIndex aka DGMPGDec
    FitCD
    DVDFab HD Decrypter (which I tested by ripping a DVD and it seems to work fine)

    So you want to convert an AVI to MPEG-2 DVD spec. The first thing you need to do is fire up FitCD. Here is what FitCD looks like with an AVI file loaded into it:



    Now allow me to explain. It looks daunting but it's very simple.
    See where it says "MPEG Resizing" on the left hand side in RED text and under that there is a "Source" button. Well you simply click on that and it will allow you to browse to your AVI file. Once the file is loaded you can change the resolution of it. The source info is on the left and the destination info is on the right.

    Now see where it says Desintation: 720 x 480 DVD 720 (with a drop down box)
    I had to change that from the default but basically that is the setting you want (on the drop down box it is simply called, "DVD 720")

    Now in my example I have an AVI file made from an NTSC source. I know this because MediaInfo reports a frame rate of 23.976fps so I need to make sure the PAL checkmark boxes are NOT marked. Now if you tick the PAL checkmark box on the RIGHT side you'll see the Destination change from 720x480 to 720x576 (it will still read "DVD 720" next to that). If the original is PAL (MediaInfo will report 25fps) then you also need to checkmark the PAL box on the left hand side. But I have a NTSC source so I don't checkmark the PAL box on the left and while I could resize it to make a PAL DVD (and check PAL on the RIGHT) that will cause issues with audio sync SO it's best to make a NTSC DVD from a NTSC source and a PAL DVD from a PAL source and let your DVD player sort it out. Almost all DVD players in Europe play not only PAL DVD discs but also NTSC DVD discs.

    Now in my case the AVI is 720x400 and is a 1:1 resolution (1:1 resolution is standard for DivX/XviD AVI files). However I want to make it 16x9 anamorphic so I check that box on the RIGHT (that's Destination remember).

    You see on the RIGHT it is going to resize to 720x480 but let us say you have a very widescreen movie ... the numbers would be different and it would add black above/below the image to pad it out (just like a very widescreen DVD does). I'm talking for example a movie with an aspect ratio of 2.25:1 but that's not the case here.

    There are other things you can play with but that's the basics of using FitCD.

    Anyway it shows the AVS script in the bottom and all you have to do is hit the SAVE SCRIPT icon in the bottom RIGHT and save it as filename.avs

    You now open the AVS into HCenc and you are ready to encode (once you set your settings in that program).

    Here's what my AVS script looks like:
    Code:
    # -= AviSynth v2.5.8.5 script by FitCD v1.2.8 =-
    AVISource("Z:\home\fulcilives\Videos\Monster (Humanoids From The Deep) XviD DVDRip (Uncut)\Monster (Humanoids From The Deep).avi")
    BicubicResize(720,480,0,0.6,0,2,720,396)
    #Trim(0,115231).FadeOut(150)
    One problem though ... when I tried to load the AVS into HCenc I got an error msg saying "AviSynth.dll NOT loaded"

    After poking around on the 'net some I found this topic: CLICK HERE

    I did that winetricks command line/prompt thing and it seemed to do something but didn't solve my problem. Still getting the "AviSynth.dll NOT loaded" msg in the GUI for HCenc.

    I'm sure it's something simple so I'll have to try to find a solution.
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  20. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    I tried installing a bunch of stuff but I think this is what finally worked:

    http://support.microsoft.com/kb/259403

    Go there and click on the link that says, "Download the VC6RedistSetup_deu.exe package now" and then open that with WINE under Linux and you get some foreign language LOL just click the button next to the empty box and browse to any folder in your HOME folder and it extracts a file called "Vcredist.exe" which should give you all the dependencies to make AviSynth work correctly. Jeez it wasn't that hard in the past as I recall LOL

    Oh and then you may get an error about the XviD FOURCC (I got this error) then do what it says on this page: CLICK HERE

    Should work now LOL

    *** EDIT ***

    HCenc working now in Ubuntu 12.04 LTS

    Last edited by FulciLives; 25th Aug 2012 at 21:46.
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  21. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Originally Posted by intracube View Post
    In that case, you should change the scale option to 704x482 as 702 + 8 + 8 doesn't give 720 and ffmpeg is quite possibly scaling the video again to get it to 720px wide (softening the image further).

    The video is blurred. It seems a bit distorted, but the distortion correction clearly works, it is not distorted as it was first time, so I can improve it. The sound seems good. So this is great, I have a command for ffmpeg. Where should I look further, to improve the video quality?
    Try changing the qscale value to somewhere between 1.0 and 2.0 - 1.0 will give higher quality. Unfortunately your version of ffmpeg has no sharpening filters, so not much can be done there. I'd have to see a still or short video sample to give any suggestions on fixing the distortion.
    I did that and the video is still blurred. The original is just good, but the result is too blurred to watch. I am very sorry about this after so much effort. I can't understand why would this happen, even for the best quality output. How is this possible? A sharpening filter should not be required, and it also could not match the quality of the original information.

    In mencoder, when I did not do yadif I had a clear video with horizontal lines on fast motion. Here in the old ffmpeg, when I delete -deinterlace I still get the same blurred picture! This is just unfair.

    Maybe I should use two passes, maybe ffmpeg is unable to process all well in 1 pass?
    I can see no difference for qscale 1.0 and qscale 4.0 or 2.0. Something is wrong.
    Last edited by doru001; 26th Aug 2012 at 07:36. Reason: passes and qscale
    Quote Quote  
  22. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    ffmpeg blows for MPEG-2 encoding.

    That's why I've been covering how to do it with HCenc and AviSynth. It works well under WINE and produces great MPEG-2 video.
    Last edited by FulciLives; 26th Aug 2012 at 07:26.
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  23. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Originally Posted by FulciLives View Post
    ffmpeg blows for MPEG-2 encoding.

    That's why I've been covering how to do it with HCenc and AviSynth. It works well under WINE and produces great MPEG-2 video.
    I will look at that. It is more complicated than a command line, is it not?
    Quote Quote  
  24. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    Well other than the issues I had in getting the stupid thing to work properly ... not really. I mean I've worked with AviSynth for years now but basically it is a command line in a text document. However FitCD is a nice GUI for making sure you get it resized correctly so in a sense it is easier that way. However if you need to do any kind of deinterlacing etc. then yeah it's a bit trickier but an AVI source that is XviD or DivX should already be progressive so it's not that hard really.

    Once you get it working and loading into HCenc without errors you should read a guide on HCenc on how to set it up properly. You can ask here as well and I'll do my best to help.

    Probably not going to be around for most of today though.
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  25. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    I made a short XviD AVI with AC-3 audio. It's a fun short clip from a movie that runs about 1 minute, maybe less. You could use it to test this process and trying out different encoding settings on HCenc.

    Please note it comes from a progressive 23.976fps NTSC source.

    http://www.sendspace.com/file/blj63i

    Have fun!

    - John "FulciLives" Coleman
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  26. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Originally Posted by intracube View Post
    Try changing the qscale value to somewhere between 1.0 and 2.0 - 1.0 will give higher quality. Unfortunately your version of ffmpeg has no sharpening filters, so not much can be done there. I'd have to see a still or short video sample to give any suggestions on fixing the distortion.
    I viewed again the original and the converted file and now it all looks perfect. I was wrong probably because I was comparing fast moving pictures from the converted file to still pictures in the original. I also had to make it full screen in order to compare the correct size of the two versions. The used command:

    Code:
    ffmpeg -i file.avi -s 720x464 -padtop 46 -padright 0 -padbottom 66 -padleft 0 -target pal-dvd -acodec ac3 -ab 448000 -mbd 2 -qscale 1.0 -aspect 16:9 file.mpg
    As you see, there is no deinterlace. I don't know why did I have to use it in mencoder but not here. Also, no error messages.

    Thank you all and sorry for the unnecessary trouble which I caused.
    I am very happy that I used ffmpeg, it looks like a complete utility, powerful and easy to use in command line.
    Last edited by doru001; 26th Aug 2012 at 09:48.
    Quote Quote  
  27. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    I have installed mediainfo:

    Input file:
    General
    Complete name : file.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    File size : 582 MiB
    Duration : 49mn 50s
    Overall bit rate : 1 632 Kbps

    Video
    ID : 0
    Format : MPEG-4 Visual
    Codec ID : DIV3
    Codec ID/Hint : DivX 3 Low
    Duration : 49mn 50s
    Bit rate : 1 174 Kbps
    Width : 544 pixels
    Height : 256 pixels
    Display aspect ratio : 2.125
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 0.337
    Stream size : 418 MiB (72%)
    Title : file.avi Video #1

    Audio
    ID : 1
    Format : AC-3
    Format/Info : Audio Coding 3
    Mode extension : CM (complete main)
    Format settings, Endianness : Big
    Codec ID : 2000
    Duration : 49mn 50s
    Bit rate mode : Constant
    Bit rate : 448 Kbps
    Channel(s) : 6 channels
    Channel positions : Front: L C R, Side: L R, LFE
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Compression mode : Lossy
    Stream size : 160 MiB (27%)
    Alignment : Split accross interleaves
    Interleave, duration : 40 ms (1.00 video frame)
    Title : file.avi Audio #1

    Output file:
    General
    Complete name : file.mpg
    Format : MPEG-PS
    File size : 4.57 MiB
    Duration : 15s 40ms
    Overall bit rate mode : Variable
    Overall bit rate : 2 550 Kbps

    Video
    ID : 224 (0xE0)
    Format : MPEG Video
    Format version : Version 2
    Format profile : Main@High 1440
    Format settings, BVOP : No
    Format settings, Matrix : Default
    Format settings, GOP : M=1, N=12
    Duration : 15s 40ms
    Bit rate mode : Variable
    Bit rate : 2 051 Kbps
    Maximum bit rate : 9 000 Kbps
    Width : 720 pixels
    Height : 688 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 0.166
    Stream size : 3.68 MiB (80%)

    Audio
    ID : 189 (0xBD)-128 (0x80)
    Format : AC-3
    Format/Info : Audio Coding 3
    Mode extension : CM (complete main)
    Format settings, Endianness : Big
    Muxing mode : DVD-Video
    Duration : 15s 8ms
    Bit rate mode : Constant
    Bit rate : 448 Kbps
    Channel(s) : 6 channels
    Channel positions : Front: L C R, Side: L R, LFE
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Compression mode : Lossy
    Stream size : 821 KiB (18%)

    Menu
    Quote Quote  
  28. It's not DVD compliant ; 720x688
    Quote Quote  
  29. Member
    Join Date
    Aug 2012
    Location
    Romania
    Search Comp PM
    Originally Posted by poisondeathray View Post
    It's not DVD compliant ; 720x688
    If you add the vertical pads you get 576, is this not right?
    Quote Quote  
  30. Originally Posted by doru001 View Post
    Originally Posted by poisondeathray View Post
    It's not DVD compliant ; 720x688
    If you add the vertical pads you get 576, is this not right?

    You need to end up with 720 width, 576 height . 704 width is also "legal" for DVD

    688 is to high. 688 > 576

    I'm thinking something went wrong with your padding
    Quote Quote  



Similar Threads

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