Output file size encoding for dvd

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Output file size encoding for dvd

William Boyle
I figured out how to reduce the size of my mpeg2 output file when
transcoding an mpeg4 to burn on a dvd. I added the -qscale parameter to the
argument list, instead of letting it "float" from the input as it does by
default. I am using this command line:

    ffmpeg -i inputfile.avi -target ntsc-dvd -qscale 4 -ab 384kb
outputfile.mpg

However, I still need to pad the output top+bottom to get the output to have
the same aspect ratio as the input. Unfortunately, when I do that the output
exceeds the 720x480 limit of an ntsc dvd by the top+bottom padding
quantities. I have been able to fix this by not using the -target argument,
but specifying the video and audio encoding directly.

    ffmpeg -i inputfile.avi -vcodec mpeg2video -r 29.97 -padtop 30
-padbottom 30 \
         -s 720x420 -b 6000kb -qscale 3 -acodec ac3 -ar 48000 -ac 2 -ab
384kb outputfile.mpg

Unfortunately, when I specify the audio codec as ac3, the resulting mpeg
file doesn't have any sound. However if I don't specify the ac3 audio
encoder using this command:

    ffmpeg -i inputfile.avi -vcodec mpeg2video -r 29.97 -padtop 30
-padbottom 30 \
         -s 720x420 -b 6000kb -qscale 3 -acodec -ab 384kb outputfile.mpg

it uses the mpeg2 audio encoder at 44100hz and it works OK. Any suggestions
how to get the ac3 to play? From the ffmpeg terminal output, when I use the
ac3 encoder, the output looks the same as when I just use the -target
ntsc-dvd parameter. BTW, using the video specifications above, the final
output is properly sized to the input. I'm just missing the audio now... :-)

Thanks,

-Bill Boyle
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Output file size encoding for dvd

Hervé-4

Le 8 févr. 08 à 20:05, William Boyle a écrit :

> I figured out how to reduce the size of my mpeg2 output file when
> transcoding an mpeg4 to burn on a dvd. I added the -qscale parameter  
> to the
> argument list, instead of letting it "float" from the input as it  
> does by
> default. I am using this command line:
>
>    ffmpeg -i inputfile.avi -target ntsc-dvd -qscale 4 -ab 384kb
> outputfile.mpg
>
> However, I still need to pad the output top+bottom to get the output  
> to have
> the same aspect ratio as the input. Unfortunately, when I do that  
> the output
> exceeds the 720x480 limit of an ntsc dvd by the top+bottom padding
> quantities. I have been able to fix this by not using the -target  
> argument,
> but specifying the video and audio encoding directly.
>
>    ffmpeg -i inputfile.avi -vcodec mpeg2video -r 29.97 -padtop 30
> -padbottom 30 \
>         -s 720x420 -b 6000kb -qscale 3 -acodec ac3 -ar 48000 -ac 2 -ab
> 384kb outputfile.mpg
>
> Unfortunately, when I specify the audio codec as ac3, the resulting  
> mpeg
> file doesn't have any sound. However if I don't specify the ac3 audio
> encoder using this command:
>
>    ffmpeg -i inputfile.avi -vcodec mpeg2video -r 29.97 -padtop 30
> -padbottom 30 \
>         -s 720x420 -b 6000kb -qscale 3 -acodec -ab 384kb  
> outputfile.mpg
>
> it uses the mpeg2 audio encoder at 44100hz and it works OK. Any  
> suggestions
> how to get the ac3 to play? From the ffmpeg terminal output, when I  
> use the
> ac3 encoder, the output looks the same as when I just use the -target
> ntsc-dvd parameter. BTW, using the video specifications above, the  
> final
> output is properly sized to the input. I'm just missing the audio  
> now... :-)

without output, just a remainder;
audio for dvd is "-ar 48000"

PS: use "-target ntsc-dvd" to conform your resulting stream
bye

Hervé

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Output file size encoding for dvd

William Boyle
Yes. I managed to solve these problems and I do set the ac3 encoding to
48kbps instead of 44.1 as it is for mpeg layer 2 audio. The two problems I
have been having has been the output size and correcting the size after
padding the top/bottom of the image to adjust for the input stream so the
output on a wide-screen tv/display would be the same for the output as it
was for the original input (minimize image distortion). I figured out that
one needs to subtract the total padding from the -s WxH and I can use the
-qscale to adjust the final output size. Most of the time I don't need that
- I am targeting a movie-length video to an output size of about 2gb or so,
except in cases where the input image is of superior quality, in which case
I'm not so concerned about output size except that it fit on an SL or DL
DVD.

In any case, I still haven't solved my problem of getting ac3 audio to
output when I use the raw video settings instead of -target ntsc-dvd (or
whatever). If I do use the specific target, then the input audio, if it is
mp3 for example, is properly transcoded to ac3 and muxed into the output
stream.

Oh well, I'm just a noob with ffmpeg, but I'm making progress. If anyone has
a link to a comprehensive tutorial or other documentation for ffmpeg I would
greatly appreciate getting it. So far, after much googling, I have only
found a few items and none of them get into the gritty details and caveates.
It is an incredibly rich tool and totally blows away (except for lack of
decent GUI) the TMPGEnc Plus I've been using on Windoze. Transcoding a
high-res 90+ minute video with ffmpeg from mpeg4+mp3 (xvid .avi) to
mpeg2+ac3 (ntsc dvd) takes 15-30 minutes with ffmpeg vs. 2+ hours with
TMPGEnc (using fast motion-estimate search), and I don't have the ac3 plugin
for TMPGEnc so it only transcodes the audio to mp2. My brother-in-law
complains when I do that for him because as a professional audio engineer he
prefers to use the direct digital audio link from his dvd player to his
stereo system instead of analog. Maybe now he'll stop griping! :-)

Anyway, thanks for the feedback.

-Bill

On Feb 9, 2008 3:34 AM, Hervé <[hidden email]> wrote:

>
> Le 8 févr. 08 à 20:05, William Boyle a écrit :
>
> > I figured out how to reduce the size of my mpeg2 output file when
> > transcoding an mpeg4 to burn on a dvd. I added the -qscale parameter
> > to the
> > argument list, instead of letting it "float" from the input as it
> > does by
> > default. I am using this command line:
> >
> >    ffmpeg -i inputfile.avi -target ntsc-dvd -qscale 4 -ab 384kb
> > outputfile.mpg
> >
> > However, I still need to pad the output top+bottom to get the output
> > to have
> > the same aspect ratio as the input. Unfortunately, when I do that
> > the output
> > exceeds the 720x480 limit of an ntsc dvd by the top+bottom padding
> > quantities. I have been able to fix this by not using the -target
> > argument,
> > but specifying the video and audio encoding directly.
> >
> >    ffmpeg -i inputfile.avi -vcodec mpeg2video -r 29.97 -padtop 30
> > -padbottom 30 \
> >         -s 720x420 -b 6000kb -qscale 3 -acodec ac3 -ar 48000 -ac 2 -ab
> > 384kb outputfile.mpg
> >
> > Unfortunately, when I specify the audio codec as ac3, the resulting
> > mpeg
> > file doesn't have any sound. However if I don't specify the ac3 audio
> > encoder using this command:
> >
> >    ffmpeg -i inputfile.avi -vcodec mpeg2video -r 29.97 -padtop 30
> > -padbottom 30 \
> >         -s 720x420 -b 6000kb -qscale 3 -acodec -ab 384kb
> > outputfile.mpg
> >
> > it uses the mpeg2 audio encoder at 44100hz and it works OK. Any
> > suggestions
> > how to get the ac3 to play? From the ffmpeg terminal output, when I
> > use the
> > ac3 encoder, the output looks the same as when I just use the -target
> > ntsc-dvd parameter. BTW, using the video specifications above, the
> > final
> > output is properly sized to the input. I'm just missing the audio
> > now... :-)
>
> without output, just a remainder;
> audio for dvd is "-ar 48000"
>
> PS: use "-target ntsc-dvd" to conform your resulting stream
> bye
>
> Hervé
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user