Coverting flv files to dvd

Suse 11.4 - KDE

I want to convert flv files to dvd format. What utility will do the job? I have avidemux-gtk from the packman library. Thanks.

Devede from Packman should do the job.

If only one file, I typically use the application tovid, which is packaged by the packman packagers:

For example, if one has a file inputvideo.flv then the command:


tovid mpg -dvd -pal -quality 9 -normalize -in inputvideo.flv -out outputvideo

creates the output video ‘outputvideo.mpg’ in DVD compliant PAL format, or

For example, if one has a file inputvideo.flv then the command:


tovid mpg -dvd -ntsc -quality 9 -normalize -in inputvideo.flv -out outputvideo

creates the output video ‘outputvideo.mpg’ in DVD compliant NTSC format.

If more than one video file, I like to merge and render them first with kdenlive also packaged by the packman packagers:

Both of those tools will create applications in mpeg dvd compliant format. One can then use another app to create the video dvd (or even use tovid).

On Sun, 23 Oct 2011 20:06:03 +0000, lord valarian wrote:

> Suse 11.4 - KDE
>
> I want to convert flv files to dvd format. What utility will do the job?
> I have avidemux-gtk from the packman library. Thanks.

I’ve used a tool called “any2dvd” in the past - not sure if it’s still
out there or not, but it did a good job when I used it last.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

I use mplayer/mencoder together with dvdauthor to create simple video DVD’s (PAL format) from one or more video files. To facilitate things a bash script is used to generate a primitive .xml description file and calculate acceptable bitrates. Here it is:

#!/bin/bash
#
# Script to create a DVD from one or more video files
#
# set to high | normal
QUALITY=normal
BRAUTO=yes
PP=""
#CROP="crop=592:400:4:0,"
CROP=""
AFILT=""

if test -z "$1" ; then
        echo "Usage: tvscope [wide] <titlename> <videofile.wmv> ...]"
        exit 1
fi

if test -z "$2" ; then
        echo "Usage: tvscope [wide] <titlename> <videofile.wmv> ...]"
        exit 1
fi

if test "$1" == wide ; then
        ASPECT="16:9"
        shift 1
else
        ASPECT="4:3"
fi

PROJ="$1"
shift 1

# Read config file if one exists
if test -r ./$PROJ.conf ; then
        echo "Reading config file '$PROJ.conf'"
        cat ./$PROJ.conf
        . ./$PROJ.conf
fi

if test $QUALITY == high ; then
        # Maximum is 8000
        VBITRATE="8000"
        EXTRAOPTS="trell:mbd=2:precmp=2:subcmp=2:cmp=2:dia=-10:predia=-10:cbp:mv0:vqmin=1:lmin=1:dc=10:"
else
        VBITRATE="3100"
        EXTRAOPTS=""
fi

# determine the duration and the resulting bitrate
if test "$BRAUTO" == "yes" ; then

TIME=0
for INFILE in "$@" ; do
        PTIME=$(ffplay -an -vn -nodisp -stats $INFILE 2>&1 | sed \
                -e "/Duration:/ !d" \
                -e "s/^.*Duration: *//" \
                -e "s/, .*//")
        HOURS=$(echo "$PTIME" | sed -e "s/:.*//" -e "s/^0*//")
        MINS=$(echo "$PTIME"  | cut -d ':' -f 2 | sed -e "s/^0*//")
        SECS=$(echo "$PTIME"  | cut -d ':' -f 3 | sed -e "s/^0*//")

        if test -z "$HOURS" ; then
                HOURS="0"
        fi

        if test -z "$MINS" ; then
                MINS="0"
        fi

        if test -z "$SECS" ; then
                SECS="0"
        fi

        #echo HOURS=$HOURS MINS=$MINS SECS=$SECS

        TIME=$(echo "$TIME + 3600 * $HOURS + 60 * $MINS + $SECS" | bc)
done

DURATION=$(echo "scale=2; $TIME / 60" | bc)
RATE=$(echo "scale=2; (((57000 / $DURATION) - 20) * 10)" | bc)
# rounding
BITRATE=$(echo "scale=0; $RATE / 100 * 100" | bc)

if test $(($BITRATE)) -gt $((8000)) ; then
        BITRATE="8000"
fi

echo $DURATION minutes
echo "$BITRATE kb/s"

echo -n "Adapt this bitrate? (No will use default of $VBITRATE) [y/n] "
read RESP; echo

if test "$RESP" == "Y" -o "$RESP" == "y" ; then
        VBITRATE=$BITRATE
fi

fi


# Create the .xml file for dvdauthor
INFILES=''
NEXT="yes"
#
echo "<dvdauthor>" > DVD$PROJ.xml
echo "  <vmgm />" >> DVD$PROJ.xml
echo "    <titleset>" >> DVD$PROJ.xml
echo "      <titles>" >> DVD$PROJ.xml
echo "        <pgc>" >> DVD$PROJ.xml
#
while test "$NEXT" == "yes" ; do
        if test -n "$1" ; then
                if test -z "$INFILES" ; then
                        INFILES="$1"
                else
                        INFILES=$(echo -e -n "${INFILES}
$1")
                fi
                OUTFILE=$(echo "$1" | sed -e "s/\\.mov//" \
                        -e "s/\\.mp4$//" \
                        -e "s/\\.wmv$//" \
                        -e "s/\\.avi$//" \
                        -e "s/\\.flv$//")
                echo "          <vob file=\"DVD"$OUTFILE".mpg\" chapters=\"0,0:10,0:20,0:30,0:40,0:50\" />" >> DVD$PROJ.xml
                shift 1
        else
                NEXT="no"
        fi
done
#
echo "        </pgc>" >> DVD$PROJ.xml
echo "      </titles>" >> DVD$PROJ.xml
echo "    </titleset>" >> DVD$PROJ.xml
echo "</dvdauthor>" >> DVD$PROJ.xml
#

read -p "Ready to start encoding. Press any key! (or CTRL-C to stop here)"

# prepare aspect for mplayer
MPASPECT=$(echo $ASPECT | sed -e "s|:|/|")

for INFILE in $(echo $INFILES) ; do
        OUTFILE=$(echo "$INFILE" | sed -e "s/\\.mov//" \
                -e "s/\\.mp4$//" \
                -e "s/\\.wmv$//" \
                -e "s/\\.avi$//" \
                -e "s/\\.flv$//")
        if ! test -f DVD"$OUTFILE".mpg ; then

        # dump audio to file
        mplayer -ao pcm:fast:file=audio.wav -vc null -vo null $INFILE \
                2>/dev/null 1>/dev/null

        # first pass
        if test $QUALITY == "high" ; then
                FPOPT=":turbo:vpass=1"

        nice -n 19 mencoder -oac lavc -ovc lavc \
        -of mpeg -mpegopts format=dvd:tsaf \
        -vf ${PP}${CROP}scale=720:576,harddup $AFILT \
        -audiofile audio.wav -srate 48000 -af lavcresample=48000 \
        -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:\
vbitrate=$VBITRATE:keyint=15:vstrict=0:aspect=$MPASPECT:\
acodec=ac3_fixed:abitrate=192$FPOPT \
        -ofps 25 -o DVD"$OUTFILE".mpg $INFILE

                FPOPT=":vpass=2"
        else
                FPOPT=""
        fi

        # Use these to set high quality on single pass
        #EXTRAOPTS="trell:mbd=2:precmp=2:subcmp=2:cmp=2:dia=-10:predia=-10:cbp:mv0:vqmin=1:lmin=1:dc=10:"
        #EXTRAOPTS=""

        # second pass or unique pass
        nice -n 19 mencoder -oac lavc -ovc lavc \
        -of mpeg -mpegopts format=dvd:tsaf \
        -vf ${PP}${CROP}scale=720:576,harddup $AFILT \
        -audiofile audio.wav -srate 48000 -af lavcresample=48000 \
        -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:\
vbitrate=$VBITRATE:keyint=15:${EXTRAOPTS}vstrict=0:aspect=$MPASPECT:\
acodec=ac3_fixed:abitrate=192$FPOPT \
        -ofps 25 -o DVD"$OUTFILE".mpg $INFILE

        fi

        rm -f audio.wav
done

#read -p "Ready to author video image. Press any key! (or CTRL-C to stop here)"

if ! test -d dvd$PROJ ; then
        nice -n 19 dvdauthor -o dvd$PROJ -x DVD$PROJ.xml \
                --video=pal+${ASPECT}+720x576
fi

echo "Size of resulting DVD-image (max 4589843 kb):"
du -s ./dvd$PROJ
echo ""

read -p "Now playing the movie. Enter to start. If it fails, press CTRL-C now!!"

mplayer -vo x11 dvd:// -dvd-device ./dvd$PROJ &

exit 0

Of course you can tweak all options to your taste. Encoding in “one pass” normal mode is usually sufficient. The following script will burn the DVD:

#!/bin/bash
#
DEVICE="/dev/sr0"

if test -z "$1" ; then
        echo "usage: burn <dir_with_VOB_files>" ; exit 1
fi

if ! test "$EUID" == "0" ; then
        echo "Must run as root"
        exit 1
fi

VIDEODIR=$(echo "$1" | sed -e "s|/*$||")

read -p "Insert a blank dvd and press enter"

nice -19 growisofs -dvd-compat -speed=4 -Z $DEVICE -dvd-video $VIDEODIR/ 

exit 0

Handbrake is also a good GUI option.

It was great and easy to use. I could add a background image, music, and create custom menus. I completed the DVD.

One problem, the sound level for the videos and the music from menu were at a different level. Also, I have audacity. What best way to fix the sound levels?

Thanks all for the info.