I have a dvd which I would like to grab some video clips as MPEG 1
system streams. My DVD-R was created by piping in a camcorder over
firewire to a set-top DVD burner. I then ripped the ISO-9660 image from
the DVD to my hard disk in a file called jumps.iso using dd, so it would
be easier to work with.
That was the easy part, now for the transcode part.
I'm using Fedora Core 5 on a Athlon XP1800 machine. I have transcode
1.0.2-7.fc5, which I got from the freshrpms RPM.
$ tcprobe -i jumps.iso
[tcprobe] unknown file type
[tcprobe] filetype/codec not yet supported by 'transcode'
Deleting quicktime codecs
I refuse to believe that DVDs are an unknown file type, so undaunted, I
press on.
$ transcode -x dvd -i jumps.iso -p velvet.mp3 -T 1,1,1 -y xvid4 -c
00:00:05-00:01:28 -I 5 -o clip1.avi
This prints out some source information and then dies with:
[import_dvd.so] v0.4.0 (2003-10-02) (video) DVD | (audio) MPEG/AC3/PCM
[export_xvid4.so] v0.0.5 (2003-12-05) (video) XviD 1.0.x series (aka API 4.0) |
(audio) MPEG/AC3/PCM
[import_dvd.so] failed to open DVD jumps.iso
audio import module error: OPEN failed
[transcode] critical: failed to open input source
I notice in the source information this line:
[transcode] A: import format | 0x2001 AC3/A52 [48000,16,2]
However, velvet.mp3 is an mp3, not an AAC.
$ tcprobe -i velvet.mp3
[tcprobe] unknown file type
[tcprobe] filetype/codec not yet supported by 'transcode'
Deleting quicktime codecs
Weird, especially when:
$ file velvet.mp3
velvet.mp3: MPEG ADTS, layer III, v1, 128 kBits, 44.1 kHz, JntStereo
So we'll try another mp3 instead:
$ tcprobe -i mine.mp3
[tcprobe] MPEG-1 layer-3 stream
[tcprobe] summary for mine.mp3, (*) = not default, 0 = not detected
Deleting quicktime codecs
ok, transcode seems to like this one
$ file mine.mp3
mine.mp3: MPEG ADTS, layer III, v1, 192 kBits, 44.1 kHz, JntStereo
file thinks it's pretty much the same, except at a somewhat higher
bitrate. Why does tcprobe recognize one and not the other?
Lets try the extraction again:
$ transcode -x dvd -i jumps.iso -p mine.mp3 -T 1,1,1 -y xvid4 -c
00:00:05-00:01:28 -I 5 -o clip1.avi
transcode v1.0.2 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
(dvd_reader.c) DVD title 1/2: 1 chapter(s), 1 angle(s), title set 1
(dvd_reader.c) title playback time: 00:03:11.15 192 sec
(dvd_reader.c) [Chapter 01] 00:00:00.000 , block from 0 to 8833
Deleting quicktime codecs
Deleting quicktime codecs
[transcode] (probe) suggested AV correction -D 0 (0 ms) | AV 0 ms | 0 ms
[transcode] auto-probing source jumps.iso (ok)
[transcode] V: import format | MPEG-2 DVD NTSC (V=dvd|A=mp3)
[transcode] V: AV demux/sync | (2) initial MPEG sequence / enforce frame
rate[transcode] V: import frame | 720x480 1.50:1 encoded @ 4:3
[transcode] V: de-interlace | (mode=5) interpolate scanlines / blend frames
[transcode] V: bits/pixel | 0.217
[transcode] V: decoding fps,frc | 23.976,1
[transcode] V: Y'CbCr | YV12/I420
[transcode] A: import format | 0x55 MPEG layer-3 [48000,16,2]
[transcode] A: export format | 0x55 MPEG layer-3 [48000,16,2] 128 kbps
[transcode] V: encoding fps,frc | 23.976,1
[transcode] A: bytes per frame | 8008 (8008.000000)
[transcode] A: adjustment | [EMAIL PROTECTED]
[transcode] V: IA32/AMD64 accel | sse (sse 3dnowext 3dnow mmxext mmx asm C)
tc_memcpy: using sse for memcpy
[transcode] V: video buffer | 10 @ 720x480
[import_mp3.so] v0.1.4 (2003-08-04) (audio) MPEG
[import_dvd.so] v0.4.0 (2003-10-02) (video) DVD | (audio) MPEG/AC3/PCM
[export_xvid4.so] v0.0.5 (2003-12-05) (video) XviD 1.0.x series (aka API 4.0) |
(audio) MPEG/AC3/PCM
[import_mp3.so] MP3->PCM
[import_mp3.so] tcextract -a 0 -i "mine.mp3" -x mp3 -d 0 | tcdecode -x mp3 -d 0
-z 0
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
[import_dvd.so] tccat -T 1,1,1 -i "jumps.iso" -t dvd -d 0 | tcdemux -s 0xc0 -x
mpeg2 -S 0 -M 2 -f 23.976024 -P /tmp/filegj7I56 -d 0 | tcextract -t vob -a 0 -x
mpeg2 -d 0 | tcdecode -x mpeg2 -d 0 -y yv12
[import_dvd.so] delaying DVD access by 3 second(s)
.tc_memcpy: using sse for memcpy
..tc_memcpy: using sse for memcpy
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
[export_xvid4.so] Neither './xvid4.cfg' nor '~/.transcode/xvid4.cfg'
[export_xvid4.so] found. Default settings will be used instead.
Audio: using new version
Audio: using lame-3.96.1
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
[decode_mpeg2.c] libmpeg2 0.4.0b loop decoder
[decode_mpeg2.c] libmpeg2 acceleration: 3dnow
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
It prints out a few hundred of these libdvdread errors over the course
of a minute or so, and then freezes. The output stops, and the CPU usage
goes to zero. I hit ^C, and get this message:
Deleting quicktime codecs
clean up | frame threads | unload modules | cancel signal | internal threads |
done
[transcode] encoded 0 frames (5744 dropped, 0 cloned), clip length 0.00 s
I verify that no frames were recorded:
$ ls -lh clip1.avi
-rw-rw-r-- 1 sig sig 2.1K Jun 1 21:11 clip1.avi
$ tcprobe -i clip1.avi
[tcprobe] RIFF data, AVI video
AVI open: avilib - AVI file has no video data
[tcprobe] summary for clip1.avi, (*) = not default, 0 = not detected
no audio track: use "null" import module for audio
Deleting quicktime codecs
$ file clip1.avi
clip1.avi: RIFF (little-endian) data, AVI, 720 x 480, 23.98 fps, video:
XviD, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)
So we managed to create an avi file, but it's a very boring one.
I wonder if it is still confused about the audio file being an MP3, so,
even though this line is there:
[transcode] V: import format | MPEG-2 DVD NTSC (V=dvd|A=mp3)
and this one:
[transcode] A: import format | 0x55 MPEG layer-3 [48000,16,2]
i make it explicit by changing "-x dvd" for "-x dvd,mp3":
$ transcode -x dvd,mp3 -i jumps.iso -p mine.mp3 -T 1,1,1 -y xvid4 -c
00:00:05-00:01:28 -I 5 -o clip1.avi
but this one does exactly the same thing as without the ,mp3. (Freezes
after a minute and produces a 2.1k contentless avi file.) On a hunch, I
try the ,mp3 with the first mp3 file, the one that transcode thought was
an AAC:
$ transcode -x dvd,mp3 -i jumps.iso -p velvet.mp3 -T 1,1,1 -y xvid4 -c
00:00:05-00:01:28 -I 5 -o clip1.avi
transcode v1.0.2 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
(dvd_reader.c) DVD title 1/2: 1 chapter(s), 1 angle(s), title set 1
(dvd_reader.c) title playback time: 00:03:11.15 192 sec
(dvd_reader.c) [Chapter 01] 00:00:00.000 , block from 0 to 8833
Deleting quicktime codecs
Deleting quicktime codecs
[transcode] auto-probing source jumps.iso (failed)
[transcode] V: import format | unknown (V=dvd|A=mp3)
[transcode] V: import frame | 720x576 1.25:1
[transcode] V: de-interlace | (mode=5) interpolate scanlines / blend frames
[transcode] V: bits/pixel | 0.174
[transcode] V: decoding fps,frc | 25.000,0
[transcode] V: Y'CbCr | YV12/I420
[transcode] A: import format | 0x2001 AC3/A52 [48000,16,2]
[transcode] A: export format | 0x55 MPEG layer-3 [48000,16,2] 128 kbps
[transcode] V: encoding fps,frc | 25.000,3
[transcode] A: bytes per frame | 7680 (7680.000000)
[transcode] A: adjustment | [EMAIL PROTECTED]
[transcode] V: IA32/AMD64 accel | sse (sse 3dnowext 3dnow mmxext mmx asm C)
tc_memcpy: using sse for memcpy
[transcode] V: video buffer | 10 @ 720x576
[import_mp3.so] v0.1.4 (2003-08-04) (audio) MPEG
[import_dvd.so] v0.4.0 (2003-10-02) (video) DVD | (audio) MPEG/AC3/PCM
[export_xvid4.so] v0.0.5 (2003-12-05) (video) XviD 1.0.x series (aka API 4.0) |
(audio) MPEG/AC3/PCM
[import_mp3.so] MP3->PCM
[import_mp3.so] tcextract -a 0 -i "velvet.mp3" -x mp3 -d 0 | tcdecode -x mp3 -d
0 -z 0
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
[import_dvd.so] tccat -T 1,1,1 -i "jumps.iso" -t dvd -d 0 | tcdemux -s 0x80 -x
mpeg2 -S 0 -M 1 -d 0 | tcextract -t vob -a 0 -x mpeg2 -d 0 | tcdecode -x mpeg2
-d 0 -y yv12
[import_dvd.so] delaying DVD access by 3 second(s)
.tc_memcpy: using sse for memcpy
(extract_mp3.c) no file type specified, assuming RAW stream
Can't step back 467!
..*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
tc_memcpy: using sse for memcpy
[export_xvid4.so] Neither './xvid4.cfg' nor '~/.transcode/xvid4.cfg'
[export_xvid4.so] found. Default settings will be used instead.
Audio: using new version
Audio: using lame-3.96.1
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
[decode_mpeg2.c] libmpeg2 0.4.0b loop decoder
[decode_mpeg2.c] libmpeg2 acceleration: 3dnow
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
skipping frames [000000-000019], 86.32 fps, EMT: 0:00:00, ( 0| 0| 0)
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
skipping frames [000000-000025], 81.17 fps, EMT: 0:00:01, ( 0| 0| 0)
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
<snip...>
encoding frame [2195], 17.21 fps, 99.8%, ETA: 0:00:00, ( 0| 0| 0)
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
encoding frame [2199], 17.22 fps, 100.0%, ETA: 0:00:00, ( 0| 0| 0)
clean up | frame threads | unload modules | cancel signal | internal threads |
done
[transcode] encoded 2075 frames (0 dropped, 0 cloned), clip length 83.00 s
And then it exits normally, and seems to have created an AVI file:
$ tcprobe -i clip1.avi
[tcprobe] RIFF data, AVI video
[avilib] V: 25.000 fps, codec=XVID, frames=2075, width=720, height=576
[avilib] A: 48000 Hz, format=0x55, bits=16, channels=2, bitrate=128
kbps,
[avilib] 2075 chunks, 1327444 bytes, CBR
[tcprobe] summary for clip1.avi, (*) = not default, 0 = not detected
import frame size: -g 720x576 [720x576]
frame rate: -f 25.000 [25.000] frc=3
audio track: -a 0 [0] -e 48000,16,2 [48000,16,2] -n 0x55 [0x2000]
(*)
bitrate=128 kbps
length: 2075 frames, frame_time=40 msec, duration=0:01:23.000
Deleting quicktime codecs
I play the file using mplayer, however, and it looks terrible. It sort
of reminds me of watching an old television where the V-hold isn't
syncing. So it is flickering upwards really fast, and the colors are all
messed up. The sound is good though, so at least something worked.
Next think that maybe doing the rip from DVD and -p audio substitution
at the same time is a bad idea, so I try them one at a time:
$ transcode -x dvd -i jumps.iso -T 1,1,1 -y xvid4 -c 00:00:05-00:01:28
-I 5 -o clip1.avi
transcode v1.0.2 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
(dvd_reader.c) DVD title 1/2: 1 chapter(s), 1 angle(s), title set 1
(dvd_reader.c) title playback time: 00:03:11.15 192 sec
(dvd_reader.c) [Chapter 01] 00:00:00.000 , block from 0 to 8833
Deleting quicktime codecs
[transcode] (probe) suggested AV correction -D 0 (0 ms) | AV 0 ms | 0 ms
[transcode] auto-probing source jumps.iso (ok)
[transcode] V: import format | MPEG-2 DVD NTSC (V=dvd|A=dvd)
[transcode] V: AV demux/sync | (2) initial MPEG sequence / enforce
frame rate[transcode] V: import frame | 720x480 1.50:1 encoded @
4:3
[transcode] V: de-interlace | (mode=5) interpolate scanlines / blend
frames
[transcode] V: bits/pixel | 0.217
[transcode] V: decoding fps,frc | 23.976,1
[transcode] V: Y'CbCr | YV12/I420
[transcode] A: import format | 0x10001 LPCM [48000,16,2]
[transcode] A: export format | 0x55 MPEG layer-3 [48000,16,2] 128
kbps
[transcode] V: encoding fps,frc | 23.976,1
[transcode] A: bytes per frame | 8008 (8008.000000)
[transcode] A: adjustment | [EMAIL PROTECTED]
[transcode] V: IA32/AMD64 accel | sse (sse 3dnowext 3dnow mmxext mmx asm
C)
tc_memcpy: using sse for memcpy
[transcode] V: video buffer | 10 @ 720x480
[import_dvd.so] v0.4.0 (2003-10-02) (video) DVD | (audio) MPEG/AC3/PCM
[export_xvid4.so] v0.0.5 (2003-12-05) (video) XviD 1.0.x series (aka API
4.0) | (audio) MPEG/AC3/PCM
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
[import_dvd.so] tccat -T 1,1,1 -i "jumps.iso" -t dvd -d 0 -L | tcdemux
-a 0 -x pcm -S 0 -M 2 -d 0 | tcextract -t vob -x pcm -a 0 -d 0
[import_dvd.so] tccat -T 1,1,1 -i "jumps.iso" -t dvd -d 0 | tcdemux -s
0xa0 -x mpeg2 -S 0 -M 2 -f 23.976024 -P /tmp/fileeoJAni -d 0 | tcextract
-t vob -a 0 -x mpeg2 -d 0 | tcdecode -x mpeg2 -d 0 -y yv12
[import_dvd.so] delaying DVD access by 3 second(s)
.tc_memcpy: using sse for memcpy
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** Zero check failed in ifo_read.c:432
for vmgi_mat->zero_3 = 0x00000000010000000000000000000000000000
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
<snip...>
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
encoding frame [2103], 11.16 fps, 99.7%, ETA: 0:00:00, ( 0| 0| 0)
*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***
encoding frame [2109], 11.16 fps, 100.0%, ETA: 0:00:00, ( 0| 0| 2)
At this point transcode freezes, and the CPU usage drops to zero. So I
^C it. It says:
[transcode] (sighandler) SIGINT received
but doesn't actually quit. So I have to '$ killall -9 transcode' from
another terminal.
But at least it produced some content this time, despite the freeze:
$ tcprobe -i clip1.avi
[tcprobe] RIFF data, AVI video
[avilib] V: 23.976 fps, codec=XVID, frames=1989, width=720, height=480
[avilib] A: 48000 Hz, format=0x55, bits=16, channels=2, bitrate=128
kbps,
[avilib] 1989 chunks, 1326866 bytes, CBR
[tcprobe] summary for clip1.avi, (*) = not default, 0 = not detected
import frame size: -g 720x480 [720x576] (*)
frame rate: -f 23.976 [25.000] frc=1 (*)
audio track: -a 0 [0] -e 48000,16,2 [48000,16,2] -n 0x55 [0x2000]
(*)
bitrate=128 kbps
length: 1989 frames, frame_time=41 msec, duration=0:01:22.957
Deleting quicktime codecs
I play the file, and the video looks fine. No V-Hold problems, even
though the only thing I changed was the audio.
However there is still a problem. This is an NTSC-DVD, so the frame rate
should be 29.970 and not 23.976 or 25.000 as transcode seems to think
(does "23.976 [25.000]" mean 23.976 or 25.000? That is very confusing.)
So I try adding a -f 29.970 to see if I can get it in the right frame
rate:
$ transcode -x dvd -f 0,4 -i jumps.iso -T 1,1,1 -y xvid4 -c 00:01:30-00:02:54
-I 5 -o clip1.avi
So that works, and gives me a nice avi file with the correct framerate:
$ tcprobe -i clip1.avi
[tcprobe] RIFF data, AVI video
[avilib] V: 29.970 fps, codec=XVID, frames=2517, width=720, height=480
[avilib] A: 48000 Hz, format=0x55, bits=16, channels=2, bitrate=128 kbps,
[avilib] 2517 chunks, 1343012 bytes, CBR
[tcprobe] summary for clip1.avi, (*) = not default, 0 = not detected
import frame size: -g 720x480 [720x576] (*)
frame rate: -f 29.970 [25.000] frc=4 (*)
audio track: -a 0 [0] -e 48000,16,2 [48000,16,2] -n 0x55 [0x2000] (*)
bitrate=128 kbps
length: 2517 frames, frame_time=33 msec, duration=0:01:23.983
Deleting quicktime codecs
So now I join the audio that I want:
$ transcode -x avi,mp3 -i clip1.avi -p velvet.mp3 -y raw -P 1 -o
clip1-combine.avi
this creates an avi file which has my audio and video, but doesn't exit.
I can't ^C it either, I have to killall -9 transcode from another
terminal, which is a pain since that makes it much harder to automate
from a script it the process won't exit normally.
Now that I have my combined file, I want to make it into an MPEG v1
System stream, so I say:
$ ffmpeg -i clip1-combine.avi -b 800 -ab 128 clip1.mpg
And that does what I expect it to. It would be nicer if I could just
make an MPEG v1 file with transcode, instead of having to do 2 codings,
one to XVID and one to MPEG with ffmpeg, but all the -y ffmpeg options
that I could get to produce something would only produce mpegs inside
of .avi files. Not MPEG system streams.
Now I have a nice MPEG file made from my DVD. However, I seemed to have
stumbled over a number of issues in the process of creating it:
1) Why does tcprobe recognize some mp3s and not others?
2) Why does transcode think some mp3 files are AAC files?
3) Why do some mp3 files cause transcode to produce content-free avi
files?
4) Why do some mp3 files cause transcode to produce avi files with weird
v-hold sync video streams?
5) Why does transcode sometimes not exit and need to be killed with ^C
6) Why does transcode sometimes not exit and need to be killed with
'killall -9 transcode'?
7) Why does transcode not detect the correct framerate for NTSC-DVD
files?
8) What is the deal with all the "libdvdread: CHECK_VALUE failed in
nav_read.c:207" errors?
9) How do I get transcode to produce a MPEG v1 system stream directly?
If anyone can shed some light on any of these things, I'd appreciate it.
Thanks.
--
[EMAIL PROTECTED]
Plead the First.