PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : aus Video/TV DVD erstellen; Problem mit transcode



Göbel Udo
30.03.05, 10:13
Hallo,

ich habe aus verschiedenen Threads (die meisten von hunter) folgende Befehle gefunden damit ich einen Film von TV oder Video aufnehmen und auf eine DVD brennen kann:

nice -n -20 streamer -t $1 -s 720x576 -r 25 -b 64 -o /video/tmp/movie.avi -f mjpeg -F stereo -R 48000 -j 85

transcode -i /video/tmp/movie.avi -y ffmpeg --export_prof dvd-pal --export_asr 2 -D0 -E 48000 -b 224 -s2 -w5000 -Z 720x576,fast -m /video/tmp/movie.ac3 -o /video/tmp/movie

mplex -f 8 -S 0 -o $ausgabefile /video/tmp/movie.m2v /video/tmp/movie.ac3


Danach schneide ich den Film mit avidemux2. Um die DVD selbst zu erzeugen benutze ich qdvdauthor.

Ich benutze transcode mit ffmpeg weil ich damit (meiner Meinung nach) die besten Ergebnisse erzielt habe.

Ich habe aber nach dem transcode-Befehl eine Datei vorliegen mit einer Frame-Size von 720x540. Für eine DVD benötige ich aber 720x576 (denke ich zumindest).
Wenn ich aus der erzeugten Datei eine DVD brenne, kann ich sie auf dem PC mit z.B. xine anschauen. Auf meinem DVD-Player sind bei einem Spielfilm die Rändern zu den schwarzen Balken grünlich verfärbt (wie es bei einem Film ohne schwarze Balken aussieht, kann ich jetzt gar nicht sagen).
Wenn ich die Datei mit avidemux2 wieder auf eine Frame-Size von 720x576 transcodiere, funktioniert alles. Dazu sind aber nochmal ca. 3 Stunden nötig. Auserdem verschlechtert sich die Qualität wieder.
Ich habe auch mal die Option "--export_asr 1" gesetzt. Damit ist der Film zwar in der gewünschten Frame-Size von 720x576. Aber im DVD-Player ist das Seitenverhältnis anscheined 16:9 und das sieht etwas gequetscht aus. Mit xine auf dem PC kann ich das richtige Seitenverhältnis wählen.

Ist es möglich mit dem transcode_Befehl schon eine Datei zu erzeugen mit der richtigen Frame-Size vonr 720x576. Kann mir jemand einen Tipp geben was ich falsch mache.

Ich benutze gentoo auf einem AMD64 3200 (32bit).
Weiterhin benutze ich transcode-0.6.14 und ffmpeg 0.4.9-pre1.

Ich habe hier mal eine Ausgabe des transcode-Befehls:

bash-2.05b# transcode -i /video/tmp/movie.avi -y ffmpeg --export_prof dvd-pal --export_asr 2 -D0 -E 48000 -b 224 -s2 -w5000 -m /video/tmp/movie.ac3 -o /video/tmp/movie
transcode v0.6.14 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg
[avilib] Reconstructing index...done. nvi=225001 nai=421876 tot=1728004096
[transcode] (probe) suggested AV correction -D 0 (0 ms) | AV 0 ms | 0 ms
[transcode] auto-probing source /video/tmp/movie.avi (ok)
[transcode] V: import format | MJPG RIFF data, AVI (V=ffmpeg|A=avi)
[transcode] V: import frame | 720x576 1.25:1
XXX: zoom=no pre_clip=yes
[transcode] V: pre clip frame | 720x540 (18,0,18,0)
[transcode] V: bits/pixel | 0.514
[transcode] V: decoding fps,frc | 25.000,3
[transcode] V: Y'CbCr | YV12/I420
[transcode] A: import format | 0x1 PCM [48000,16,2] 1536 kbps
[transcode] A: export format | 0x55 MPEG layer-3 [48000,16,2] 224 kbps
[transcode] V: encoding fps,frc | 25.000,3
[transcode] A: bytes per frame | 7680 (7680.000000)
[transcode] A: adjustment | 0@1000
[transcode] A: rescale stream | 2.000
[transcode] V: IA32 accel mode | sse2 (sse2 sse 3dnowext 3dnow mmxext mmx asm C)
tc_memcpy: using mmxext for memcpy
[transcode] V: video buffer | 10 @ 720x576
[import_avi.so] v0.4.2 (2002-05-24) (video) * | (audio) *
[import_ffmpeg.so] v0.1.11 (2004-02-29) (video) FFmpeg0.4.9-pre1b4718: MS MPEG4v1-3/MPEG4/MJPEG
[export_ffmpeg.so] v0.3.13 (2004-08-03) (video) FFmpeg0.4.9-pre1b4718 | (audio) MPEG/AC3/PCM
[avilib] Reconstructing index...done. nvi=225001 nai=421876 tot=1728004096
[import_avi.so] format=0x1, rate=48000 Hz, bits=16, channels=2, bitrate=1536
[avilib] Reconstructing index...done. nvi=225001 nai=421876 tot=1728004096
[export_ffmpeg.so] Using FFMPEG codec 'mpeg2video' (FourCC 'mpg2', MPEG2 compliant video).
[export_ffmpeg.so]: INFO: Selected dvd profile, pal video type for video
[export_ffmpeg.so]: INFO: Set interlacing to top-first
[export_ffmpeg.so]: INFO: Set frame rate to 25
[export_ffmpeg.so]: WARNING: Y resolution is not 576, 480, 288 or 240 as required
[export_ffmpeg.so]: INFO: Set GOP size to 15
[export_ffmpeg.so] Neither './ffmpeg.cfg' nor '~/.transcode/ffmpeg.cfg'
[export_ffmpeg.so] found. Default settings will be used instead.
[export_ffmpeg.so]: INFO: Starting 1 thread(s)
[export_ffmpeg.so]: INFO: Display aspect ratio calculated as 1.333333
[export_ffmpeg.so]: INFO: Sample aspect ratio calculated as 1.000000
[mpeg2video @ 0xb5343908]removing common factors from framerate
[export_ffmpeg.so]: INFO: Selected dvd profile for audio
[export_ffmpeg.so]: INFO: Resampling filter inactive
[export_ffmpeg.so]: INFO: Set number of audio channels to 2
[export_ffmpeg.so]: INFO: Set number of audio bits to 16
[export_ffmpeg.so]: INFO: Set audio codec to ac3
[mpeg2video @ 0xb5343908]rc buffer underflow
encoding frames [000000-225000], 32.44 fps, EMT: 2:30:00, ( 0| 0| 0)
clean up | frame threads | unload modules | cancel signal | internal threads | done
[transcode] clipped 19784620 audio samples
[transcode] encoded 225001 frames (0 dropped, 0 cloned), clip length 9000.04 s


Mfg.
Udo

Leberwurstsaft
30.03.05, 10:41
vielleicht hilft http://tovid.sourceforge.net

Göbel Udo
01.04.05, 11:19
Hallo

ich habs mal probiert. Leider verkraftet tovid die Datei nicht, die ich mit dem ersten Kommando erzeuge (streamer ...), also die Aufnahme von TV.

Painkiller
01.04.05, 12:36
Hallo... ich mehme kein ffmpeg, daher kann ich zu TC nix sagen, aber du kannst auch "-n pal" eintragen bei deinen Streamer befehl :D

Göbel Udo
03.04.05, 09:22
Hallo,

das ändert leider auch nichts. "tovid" steigt bei mplex aus.

xben
03.04.05, 13:54
habe leider das gleiche Problem und noch keine Lösung...

verwende folgendes avi2vob script (iss nich von mir):
#!/bin/sh

# ************************************************** *************
# This is a batch processing script for normalizing and converting
# a mixed collection of .avi files into .mpg files that can be fed
# to dvdauthor to create dvd's that will play perfectly on nearly
# all NTSC dvd players and analog/digital televisions.
#
# A special feature of this script is the overscan compensation
# based on laborious trial and error. Because I went to this
# trouble your subtitles and/or supertitles will be visible
# on even the most badly overcompensated television screen, but
# you will not see deformed edges on a television that has 'normal'
# overscan.
#
# The list of input files should be edited below, replacing
# file_01.avi, file_02 etc. with your batch of filenames.
# No other editing is required.
#
# NOTE: This script takes it's input filenames from the
# command line if provided, otherwise it will use
# the list declared below on the 'files=' line.
#
# This script requires transcode, mplayer, sox, and toolame.
#
# Performance on my 2.8 GHz system is 30-40 fps conversion.
#
# copyright 2004 Phil Ehrens <phil@slug.org>
# Valuable contributions by Adam Di Carlo <adam@onshored.com>
# ************************************************** *************
# declare the list of root filenames to operate on. this is
# the only line of this file that is edited for use. list the
# names of all the files you want to process.
# The source files will NOT be deleted.
#
# YOU MAY EDIT THE FOLLOWING LINE TO BE THE LIST OF INPUT
# FILES IF YOU DO NOT WISH TO PROVIDE THEM ON THE COMMAND
# LINE.
#
# For example:
#
# files="file_01.avi file_02.avi file_03.avi file_04.avi"
#

files="test.avi"
echo "converting: $files ."
#
# YOU DO NOT NEED TO EDIT ANYTHING BELOW HERE!!
#

# this block writes out the ffmpeg.cfg file with some
# possibly useful values. Note that the lines in this
# block must begin in text column zero or the script
# will exit at this point!


cat > ffmpeg.cfg <<_EOF


[mpeg2video]
vhq = 1
vqcomp = 0.7
vqblur = 0.3
_EOF

# Script will take input file(s) on the command line, or, if
# no arguments are passed, will use the 'files' list declared
# above.

[ ! -z "$1" ] && files="$@";

for arg in $files ;

do

# strip the .avi, .mkv, .mov, or .ogm file extension

file=`echo $arg | sed -e 's/\.[amo][vkgo][ivm]$//'`
ext=`echo $arg | sed -e 's/^.*\.//'`

# test for file existence

if [ ! -f "$file.$ext" ];

then

echo "file '$file.$ext' doesn't exist" >&2
exit 1

fi

# use mencoder to force frame rate to 29.970 all the way through.
# this is because an avi may be a concatenated series of subfiles
# each with a different frame rate, or even a single avi file
# may have a varying frame rate in the worst case.
#
# the expectation that this will work with all sorts of non
# avi input containers is naive at best. offering support
# for container formats that support essentially arbitrary
# stream content type is probably a mistake!
echo "Beginn Stufe 1 mencoder"

mencoder -oac copy \
-ovc copy \
-ofps 29.970 \
-o output.avi \
"$file.$ext" > /dev/null 2>&1

# -ovc copy \
# -ofps 25.2 \ geht auch nicht
# -ovc ffmpeg12,mpeg12, ?
#? -lavcopts vcodec=mpeg1video:vhq:v4mv:trell:vbitrate=3000 \
#mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy other_options media.avi -o output.mpg

echo "Ende Stufe 1 mencoder"
# input files of type .ogm and .mkv can have multiple audio tracks
# and multiple (soft) subtitle tracks. to produce an output .avi
# with a hard subtitle, it is at least necessary to re-encode while
# specifying a subtitle track with the -sid option, i.e.:
#
# mencoder -oac copy \
# -ovc lavc \
# -lavcopts vcodec=mpeg4:vhq:v4mv:trell:vbitrate=3000 \
# -aid 0 \
# -sid 0 \
# -o $file.avi "$file.$ext" >& /dev/null
#
# note that, for didactic purposes, I have included the -aid option
# which is used for the audio stream selection.
# using this code will require changing the -i option of the
# transcode invocation below from output.avi to $file.avi

# At this point you can extract and make use of an ac3 audio
# track by doing this and skipping all the other audio processing
# steps:
# tcextract -i $file.avi -x ac3 > $file.ac3
#
# Remember to mplex the ac3 file!

# dump the audio to a .wav file using mplayer
echo "Beginn Stufe 2 mplayer"

mplayer -ao pcm \
-vo null \
-vc dummy \
output.avi > /dev/null 2>&1

echo "Ende Stufe 2 mplayer"
# if the sound turns out to be 8 bit, then sox needs
# extra options to handle it correctly.
# thanks to Kenneth Stailey for this patch!

file audiodump.wav | grep -qs 'PCM, 8 bit'
if [ $? = 0 ]; then
B=-b
W=-w
else
B=
W=
fi

# if the incoming sound is at 44100
# upsample the sound to 48000.
# here we rely on the fact that sox will abort if the input
# frequency is 48000.
# there will be a stub 44 byte long output.wav if sox aborts.
echo "Beginn Stufe 3 sox"


if sox $B audiodump.wav -r 48000 $W output.wav resample ; then
WAVFILE=output.wav
else

# otherwise sound was already 48000

WAVFILE=audiodump.wav
fi

# and make it into toolame mp2 format, nice!
echo "Ende Stufe 3 sox"
echo "Beginn Stufe 4 nice"

nice -n 20 toolame -p 2 -b 384 $WAVFILE output.mp2 > /dev/null 2>&1
rm -f output.wav audiodump.wav

echo "Ende Stufe 4 nice"

# note the use of '-x mplayer,null' to remove export problems
# imposed by bugs in ffmpeg that sometimes cause segfaults.
#
# the -j option here is intended to account for a phenomenon
# of the NTSC standard and analog TV sets called 'overscan'.
# the black borders created by this option will NOT be visible
# on your TV screen unless the source .avi has already got
# overscan compensation, which is HIGHLY unlikely.
#
# There is an additional interesting side effect of -j that can
# be exploited. Using values that are no mod(8) seems to improve
# the output quality quite a bit. Try using -j -18,-34,-22,-34.
# Using non mod(8) values will slow down transcoding by about
# 20%.
#
# note also that we add -e 48000,16,2 in the transcode invocation
# forcing the sync adjustment to -1600@1000
#
# When encoding animated material, adding the option
# -J hqdn3d will produce significant improvements in image
# quality and an impressive decrease in file size!
#
# If your source has a 'washed out' appearance, you can
# brighten it up with a gamma adjustment using the -G
# option. A value of 0.9 or 0.8 will make quite a large
# difference (in this case, 0.8 is a stronger correction
# than 0.9).
#
# To create a 2-pass invocation (for significant quality
# improvement with live-action material) simply make two
# identical calls to transcode, but with the options
# '-R 1,2pass.log' and '-R 2,2pass.log' in the respective
# invocations.
echo "Beginn Stufe 5 transcode"

transcode --nice 20 \
--print_status 750 \
-x mplayer,null \
-y ffmpeg,null \
-F mpeg2video \
-e 48000,16,2 \
--export_asr 2 \
--export_fps 29.970 \
--export_prof dvd-ntsc \
-Z 720x576,fast \
-j -16,-32,-16,-32 \
-o output \
-i output.avi

# -F mpeg2video \
# --export_fps 25.2 bring nüscht \


rm -f output.avi

echo "Ende Stufe 5 transcode"
# mplex supports constant sync offset correction.
# '-O -300ms' would, for example, start audio 300 ms
# earlier than otherwise.
echo "Beginn Stufe 6 mplex"

mplex -f 8 -o "$file.mpg" output.m2v output.mp2

#-f 8

rm -f output.m2v output.mp2 ;

echo "Ende Stufe 6 mplex"

echo "Ende ohne dvdauthor"
# now you have .mpg files, all ready for dvdauthor.
# like so:
# dvdauthor -t -o mydvd -c 0,11:30 file_01.mpg -c 0,11:30 file_02.mpg -c 0,11:30 file_03.mpg
# (and possibly -v ntsc+4:3+720xfull if you get errors
# and want to be certain that nothing funny happens.)
# dvdauthor -T -o mydvd
# mkisofs -dvd-video -o mydvd.dvd.iso mydvd
# dvdrecord -v -sao dev=0,0,0 driveropts=burnfree mydvd.dvd.iso

done

# end of script

Göbel Udo
06.04.05, 12:36
Hallo,

ich habe eine Lösung zu meinem Problem gefunden. Der transcode-Aufruf sieht jetzt folgendermaßen aus:

transcode -i /video/tmp/movie.avi -y ffmpeg --export_prof dvd-pal --export_asr 2 -D0 -E 48000 -b 224 -s2 -w5000 -Z 720x576 -Y -18,0,-18,0 -m /video/tmp/movie.ac3 -o /video/tmp/movie

Die Option "-Y -18,0,-18,0" ist neu. Dadurch werden oben und unten jeweils 18 Frames angehängt. Das ist die Differenz damit ich von einer Auflösung von "720x540" auf eine von "720x576" komme.

Warum aber ohne diese Option eine Auflösung von "720x540" herauskommt, würde mich doch interessieren.