I made it! I finally able to play my digital-camera recorded avi files in my
avi-compatible dvd player.
So, to play the digital-camera AVIs files in DivX certified dvd players, use
the following command. You can see that I'm trying to convert the 15.00 fps
NTSC type avi file at 320x240 frame size to be able to play in my dvd
player. Finally made it works on the 8th trial. The trick is the right
format of video codec to use. You can tweak the audio encoding parameter to
closely match your digital-camera's (mine is 11024 Hz to 12000 Hz).
avif=test8.avi
$ nice ffmpeg -i test1.avi -acodec mp3 -ab 32k -ar 12000 -ac 1 -vcodec mpeg4 -pix_fmt yuv420p -sameq -r 24 -y $avif
Input #0, avi, from 'test1.avi':
Duration: 00:00:21.3, start: 0.000000, bitrate: 2656 kb/s
Stream #0.0: Video: mjpeg, yuvj422p, 320x240, 15.00 fps(r)
Stream #0.1: Audio: pcm_u8, 11024 Hz, mono, 88 kb/s
Output #0, avi, to 'test8.avi':
Stream #0.0: Video: mpeg4, yuv420p, 320x240, q=2-31, 200 kb/s, 24.00 fps(c)
Stream #0.1: Audio: libmp3lame, 12000 Hz, mono, 32 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 510 fps=226 q=4.0 Lsize= 2598kB time=21.2 bitrate=1001.5kbits/s
video:1147kB audio:84kB global headers:0kB muxing overhead 111.119497%
-r--r--r-- 1 7083894 12-31 14:49 test1.avi
-r--r--r-- 1 2660150 01-03 12:51 test8.avi
The converted file is not only playable in my dvd player, but also less than
40% of the original size. Bravo!!!
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
libavutil version: 49.4.1
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on Jul 19 2007 10:55:35, gcc: 4.1.3 20070629 (prerelease) (Debian 4.1.2-13)
documented on: 2008-01-03
> i was trying something like this:
> tcmplex -i old.vob -o sound.wav -o new.vob -m d
IMHO tcmplex is not the tool of choice at all. Try mplex from
mjpeg-tools.
> ERROR: File VTS_01_1.VOB is not a 11172-2 or 13818-2 Video stream.
Not familiar with tcmplex, but tcprobe -i <VOBfile> should give you
advice if the file is usable on dvd or not.
merging audio and video for a dvd
> the tcprobe output returns the following:
> [tcprobe] MPEG program stream (PS)
Your file is a program stream (already muxed), mplex wants elementary
streams (mpeg video/mpeg audio/ac3 audio)
Newsgroups: gmane.comp.audio.cd-record
Date: Mon, 31 Jul 2006 19:57:44 +0200
> I was wondering if anyone knows an easy way to put digital photos on a
> dvd for viewing on a dvd player. I don't want to create a simply data
> dvd, but a video with the photos. I'm assuming they'd either be delayed
> slide show or each could be their own channel and require one to forward
> from one to the next.
images2mpg - MPEG portfolio images multiplexer
images2mpg [ options ] -o <output MPEG file> -i <input image files>
This script use this packages :
ImageMagick version >= 5.4.8 [ http://www.imagemagick.org/ ]
MjpegTools version >= 1.6.0 [ http://mjpeg.sourceforge.net/ ]
The 'images2mpg' bash script convert some images on MPEG sequences
with a specific duration and merge all images on an single MPEG
file. It use the MjpegTools and ImageMagick packages.
Between the images, you can insert a basic transition. You can
also add an audio track on the images sequence with a MP2 or WAV
file.
All images will be automatically scaling to the good size for the
video format. Also a specific background color or a image file
could be used.
You can use this for to build some DVD/XVCD/SVCD/VCD
portfolios for your home DVD player. Use 'vcdimager' for create
this…
Newsgroups: gmane.comp.video.transcode.user
Date: Fri, 09 Sep 2005 19:10:29 +0900
I've started to make films recently using linux and I've been trying to
find the best mpeg2 encoder for making DVD compliant video. After reading
the news groups for a while, I realized this is one of those
never-fully-answered, and always-asked questions. I decided to at least do
some looking around beforehand to help alleviate the eye-rolling.
First, to find the possible encoder candidates. A few months ago, I
thought the main encoding utilities were mjpegtools, ffmpeg, transcode,
and mencoder (please tell me if I missed any leading ones). But reading
more deeply into the matter has raised a few questions for me. Please
clarify things for me if you can.
So, if I'm reading this correctly, the truly 'base' utilities/libraries
are ffmpeg and mpeg2enc, while transcode and mencoder are
front-ends/re-branders of sorts. Is this accurate?
Second, evaluate the encoders. The first step here would be research -
look for others' work to avoid rehashing known facts. I've done some
googling and haven't found much quantitative information comparing the
stream quality of streams encoded by mpeg2enc and libavcodec (the
FFmpeg_Vs._Mpeg2enc page offers some good starting information, but I fear
that it's a little old - last edited over a year and a half ago). I found
another site that compares many other encoders, but libavcodec and
mpeg2enc aren't included: http://www.tecoltd.com/enctest/enctest.htm . Do
you know any sites that have done any comparisons? What are your personal
experiences with the two?
If comparisons haven't been made, then I should do some. Which are good
video types to test? What content do I want? I like tecoltd.com's choice
of fast motion, edges, and details. What types of video will show how
encoders differ?
The best quality OSS mpeg2 encoder?
> suggest that ffmpeg is built off of (and I suspect develops...?)
> libavcodec.
FFmpeg is the application, it's merely a quite simple wrapper around
libavcodec and libavformat.
> libavcodec is also used by mplayer/mencoder. Given that ffmpeg has
> admitted having bitrate
> problems with mpeg-2, does that hold true for mencoder?
It's not exactly so. The bitrate control of ffmpeg is really not perfect,
but in practise you'll never know (in my opinion). Unless you want to make
a super-hq DVD with an average bitrate of 9 Mbps, which imho is silly
anyway.
> The mplayer docs
> (http://www.mplayerhq.hu/DOCS/HTML/en/codecs.html#ffmpeg)[] say that
> mplayer uses ffmpeg's libavcodec (which version?). How intertwined are
> these tools?
> I found a basic comparison between ffmpeg and mpeg2enc here:
> http://www.transcoding.org/cgi-bin/transcode?FFmpeg_Vs._Mpeg2enc[] that
> confirms ffmpeg's bitrate control problem (and a more brief description
> in the newsgroups:
> http://article.gmane.org/gmane.comp.video.ffmpeg.user/481).[]
Please keep in mind those postings (and the opinions even more) are mostly
based on versions of libavcodec from years ago. FFmpeg is one of the
fastest moving open source projects around. That's also why you should
always use CVS.
> Both pages
> also suggest that transcode can use either ffmpeg/libavcodec or mpeg2enc
> when encoding. Yet, transcode lists neither as a dependency (from what
> I've seen)... Does it include its own libraries from these utilities? If
> so, which versions?
Transcode used to ship the ffmpeg libs until 0.6.12 and link to these
statically. Then I decided in my endless wisdom that it was too much
burden on the developers to include the latest CVS of ffmpeg each time and
also I don't like static libraries, so transcode now dynamically links to
libavcodec. AFAIK all docs are changed to reflect this change. Before that
time, the dependency on ffmpeg already was there because transcode uses
all kinds of utils from libavcodec, regardless.
You can make a transcode that doesn't use mpeg2enc, so in that
perspective, mpeg2enc is not a dependency.
> So, if I'm reading this correctly, the truly 'base' utilities/libraries
> are ffmpeg and mpeg2enc, while transcode and mencoder are
> front-ends/re-branders of sorts. Is this accurate?
Almost. It's more correctly to compare libavcodec and mpeg2enc. BTW afaik
mpeg2enc does not supply separate libraries, so you always must run the
program (separate or started from a frontend).
> Second, evaluate the encoders. The first step here would be research -
> look for others' work to avoid rehashing known facts. I've done some
> googling and haven't found much quantitative information comparing the
> stream quality of streams encoded by mpeg2enc and libavcodec
Bottom line: both are good encoders, libavcodec has some options to make
it work faster (imho a lot, but opinions vary on this subject) but also
less precise (bitrate and max compression, not quality). In some very rare
cases of a very picky decoder, mpeg2enc tends to give better results. Also
mpeg2enc is way easier to use from the command line, because it only makes
mpeg program streams with mpeg2 video.
> If comparisons haven't been made, then I should do some. Which are good
> video types to test? What content do I want? I like tecoltd.com's choice
> of fast motion, edges, and details. What types of video will show how
> encoders differ?
I don't think it's worth the effort to do extensive comparison. Try both,
watch the completion time and then look for yourself if you see any
difference. If no, use the fastest.
At least don't use bbmpeg (-y mpeg in transcode). It's really ugly.
The best quality OSS mpeg2 encoder?
> > libavcodec is also used by mplayer/mencoder. Given that ffmpeg has
> > admitted having bitrate=20
> > problems with mpeg-2, does that hold true for mencoder?
>
>It's not exactly so. The bitrate control of ffmpeg is really not perfect,
>but in practise you'll never know (in my opinion).
That's wrong. The ffmpeg bug can bite you even at rates of 3Mbps
(like it has me); the issue is that it can exceed the _maximum_ bitrate
which transcode sets to 9Mbps per default (DVD spec says the maximum is
9800 kbps). It's not an issue of how it looks, it's an issue of whether
the video data is within spec or not.
The best quality OSS mpeg2 encoder?
>That's what I say (a little bit further on). It may bite you when you
>want an average bit rate of 9 Mbps or so.
No no, you're misreading me. It bites you with an AVERAGE bitrate of
3 Mbps, if your MAXIMUM bitrate is set too high (like 9 Mbps—which is
what transcode defaults to with —export-profile dvd, hence this is
relevant to ordinary transcoding).
>BTW this also only counts for two-pass encoding (which I never do
>anyway).
This is true, but I on the other hand always use two-pass (for the
reasons I give on the wiki), and I have in fact had to deal with this
several times at ordinary bitrates, like 3-4 Mbps.
The best quality OSS mpeg2 encoder?
> 3 Mbps, if your MAXIMUM bitrate is set too high (like 9 Mbps--which is
> what transcode defaults to with --export-profile dvd, hence this is
> relevant to ordinary transcoding).
I've got bitten with this too. I've used ffmpeg to re-encoded some
dvb-recorded material to a smapper size. W/ ffmpeg I used option -b 1860
to set the bitrate… Everything looked fine on computer but viewing the
resulting stuff using dvd player gave me jerky output on tv (cartoon scene
where much rain caused lot's of changes in picture — I checked the .m2v
video — a that part all frames were I-frames…). In latest re-encodings
I've used -b 1860 -maxrate 6000. I haven't checked the output (and whether
there has been potentially problematic content there), but I hope I have
better luck now.
The best quality OSS mpeg2 encoder?
>As an elder n00b, is there any point in doing this if it just lowers the
>actual max bitrate from 18 Mbps to 17 Mbps? Or does lowering it from 9000
>to 8000 get it under some threshhold that stops it from going wild?
The problem is that ffmpeg doesn't actually pay attention to the
maximum bitrate during the second pass of 2-pass encoding; it relies only
on what the results of the first pass tell it. Since the maximum _is_
applied during the first pass, the logfile will reflect that to an
extent— but since the whole point of 2-pass encoding is to alter bitrates
based on the logfile, the second pass can end up exceeding the maximum
bitrate if it decides to use more bits for a scene than it did in the
first pass. So we have to lower the max bitrate we give to ffmpeg in
order to get ffmpeg to give us video within the DVD specs (9800 kbps).
Unfortunately, there's no way to tell exactly how much ffmpeg will
exceed the maximum bitrate by; 6000 is merely a guess at a "safe" value.
(For reference, my personal worst-case scenario is out-of-spec video at a
maxrate of 7000 kbps. 6500 turned out fine for the same video.)