Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Blu-Ray (on gentoo) how-to [solved with MakeMKV, WIP]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next  
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Tariella
Guru
Guru


Joined: 10 Dec 2005
Posts: 384
Location: Europe/Austria

PostPosted: Thu May 29, 2008 7:58 am    Post subject: Reply with quote

Thanks for the Info. :)

Status:
I'll recieve the keys to my hd media on monday (from a colleague at work, who will find them using windows).
As soon as I get them I'll report about the results of dumping/playing.

For burning bluray I got nero (I like having simple guis). So that works fine.
Data reading/writing is no problem, the main issue remains playing films.

Update:

My american HD-DVDs just arrived - too bad I'm going to be away for the weekend. :|
Back to top
View user's profile Send private message
x1um1n
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2005
Posts: 126
Location: Chester, UK

PostPosted: Mon Jun 02, 2008 8:19 pm    Post subject: Reply with quote

Hey,
I've just setup xp inside virtualbox, seems to work fine.

Now I just need to acquire a copy of AnyDVD HD and see if I can dump my Bluray.

Once dumped/decrypted I'll transcode it in Gentoo and let you know how that goes.
_________________
Linux Version 2.6.25-hh4, Compiled #1 SMP Sun May 25 17:17:46 GMT 2008
Two 3GHz AMD Athlon 64 Processors, 4GB RAM, 12004 Bogomips Total
omnius
Back to top
View user's profile Send private message
Tariella
Guru
Guru


Joined: 10 Dec 2005
Posts: 384
Location: Europe/Austria

PostPosted: Tue Jun 03, 2008 6:29 pm    Post subject: Reply with quote

Success! :D

I was able to dump my first HD-DVD film using the dumphd tool in linux.
The problem with the other film I tried before was that the volume unique key (I thought I had found it using aacskeys) was wrong. Using an imported HD-DVD from USA solved the problem, because the key of the disc was already in dumphd's keydb.cfg file.

I was able to play the dumped EVO files using mplayer. :)

So now I'm trying to find a way to get the keys of my european HD-DVDs.
Tomorrow I'll get the logfiles of a colleague's anydvd output (he uses winxp) - maybe I'll be able to find a way to extract the key information. ;)
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Fri Jun 06, 2008 8:51 am    Post subject: Reply with quote

I have gotten a drive myself lately. I am looking into transcoding .evo/.m2ts files for simple playback and smaller sizes. If I find a good solution (not filling up 200 GB of harddisk with uncompressed video that is) I will report back. The solutions I found are not working out of the box :wink:
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
Tariella
Guru
Guru


Joined: 10 Dec 2005
Posts: 384
Location: Europe/Austria

PostPosted: Fri Jun 06, 2008 9:21 pm    Post subject: Reply with quote

Great!

I wanted to try some programs out myself but first I want to play around with the aacskeys program now that I have some disks of which I already know the correct vuk keys. So maybe I'll be able to find out how to use it correctly (and what version of it).

The programs I wanted to test are ffmpeg (frontend Winff exists for linux) or mencoder (various guis to try). Both should be able to use the x264 codec that someone over on the doom9 forums developed (afaik) and that is included into mplayer (see mplayer homepage).
Just to give you some hints where you can start searching. ;)

Thanks for giving input to this "project". :)
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Fri Jun 06, 2008 10:17 pm    Post subject: Reply with quote

I would advise against using ffmpeg with x264, because ffmpeg's codec defaults totally suck and configuring x264 correctly with it is a very tough job. And if you use mencoder, output a raw video stream (-of rawvideo -o video.264), because mencoder can't deal well with containers. You can then mux it with audio later, either with MP4Box (media-video/gpac) for .mp4 or mkvmerge (media-video/mkvtoolnix) for .mkv. Emerge mkvtoolnix with the wxwidgets USE flag to get the very nice gui.

In any case, configuring x264 is not an easy task, I would suggest looking at presets on the doom9.org forums.
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Sat Jun 07, 2008 10:40 am    Post subject: Reply with quote

Thanks gys, I already have x264 settings using mencoder. They are for DVD rips, but they are well tested and with more bitrate should be sufficient for a 2pass encode of 1080i.

My EVA8000 needs .avi or .wmv container. Mencoder does not have a problem with .avi.

What I have to find out is, how to select the correct Video and audio streams automatically, feeding them to mencoder without filling up the harddisk and how to convert the AC3 streams to a DVD compliant bitrate.
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
grant123
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1080

PostPosted: Sun Jun 08, 2008 3:30 pm    Post subject: Reply with quote

So if I buy a computer Blu-Ray drive I should be able to rip Blu-Ray movies and play the files back on the computer with mplayer? Is mplayer the only one that will play them back? How much space should a raw rip take up?
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Mon Jun 09, 2008 5:57 am    Post subject: Reply with quote

Technically programs like Anydvd HD (windows) are able to copy the data and remove the DRM. For some discs with already known keys there is a program for linux that can do the same.

mplayer cannot play them back directly! To make playback possible you have to trascode them, which consumes 2,5 days (for one pass :roll: ) on my Turion 64 X2 2.0 GHz for a 140 min. movie atm. VLC is in some cases able to play the m2ts files directly (with bad performance atm.) That all depends on the Codecs used on the disc. This is heavy work in progress and assumes you are using the svn versions of mplayer, ffmpeg and vlc.

The rip of the data is between 25 and 50 GB per movie. If you uncompress the video to raw data (like some of the scripts out there do) it's >4GB per minute! Mplayer could play that raw yuv data, but who could store it? :wink:
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Mon Jun 09, 2008 8:46 am    Post subject: Reply with quote

MPlayer can play the decrypted files directly (you don't even have to rip the disc, DumpHD can perform on-the-fly decryption), but you need to patch mplayer to add the necessary audio decoders. The problem is getting the decryption keys. If they're not on doom9.org, you need a Windows installation and even then, it's not possible to get all keys.
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Mon Jun 09, 2008 9:47 am    Post subject: Reply with quote

Let me correct myself. Mplayer-svn can playback .m2ts IF they are encoded with MPEG2 or MPEG4 AVC (h.264), but it is a dia show (approx 2 fps with my hardware) and it stops approx 10 seconds into the video when playing h.264. With every VC-1 encoding I have tested playback crashes instantly.

So it is safe to say: Theoretically Mplayer-svn can playback the Streams. :twisted:

As I already stated this is in heavy development.
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
cord
Guru
Guru


Joined: 28 Apr 2007
Posts: 344

PostPosted: Mon Jun 09, 2008 10:39 am    Post subject: Reply with quote

Gusar wrote:
And if you use mencoder, output a raw video stream (-of rawvideo -o video.264), because mencoder can't deal well with containers. You can then mux it with audio later, either with MP4Box (media-video/gpac) for .mp4 or mkvmerge (media-video/mkvtoolnix) for .mkv.

mkvmerge can read rawvideo?

Code:
$ mkvmerge --list-types
Known file types:
  ext  description
  ---  --------------------------
  demultiplexers:
  aac   AAC (Advanced Audio Coding)
  ac3   A/52 (aka AC3)
  avi   AVI (Audio/Video Interleaved)
  dts   DTS (Digital Theater System)
  h264  AVC/h.264 elementary streams
  mp2   MPEG-1 layer II audio (CBR and VBR/ABR)
  mp3   MPEG-1 layer III audio (CBR and VBR/ABR)
  mkv   general Matroska files
  ogg   audio/video embedded in OGG
  mov   Quicktime/MP4 audio and video
  rm    RealMedia audio and video
  srt   SRT text subtitles
  ssa   SSA/ASS text subtitles
  idx   VobSub subtitles
  btn   VobBtn buttons
  wav   WAVE (uncompressed PCM)
  flac  FLAC lossless audio
  tta   TTA lossless audio
  m1v   MPEG-1 video elementary stream
  m2v   MPEG-2 video elementary stream
  mpg   MPEG program stream
  wv    WAVPACK lossless audio
  output modules:
        AAC audio
        AC3 audio
        DTS audio
        FLAC
        MP3 audio
        RealAudio and RealVideo
        simple text subtitles
        text subtitles (SRT, SSA/ASS)
        TTA lossless audio
        uncompressed PCM audio
        video (MPEG 1, MPEG 2, MPEG 4 part 2 and 10)
        VobSub subtitles
        Vorbis audio
        WAVPACK lossless audio

$ mkvmerge --version
mkvmerge v2.1.0 ('Another Place To Fall') built on Dec 28 2007 20:10:28
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Mon Jun 09, 2008 11:55 am    Post subject: Reply with quote

@cord:
From your list:
Code:
h264  AVC/h.264 elementary streams


This is what "-of rawvideo -o video.264" creates - an elementary stream. "Raw video" as opposed to "encapsulated in container video". What you're thinking of is raw video as in raw uncompressed frames. Different semantics.
Back to top
View user's profile Send private message
Tariella
Guru
Guru


Joined: 10 Dec 2005
Posts: 384
Location: Europe/Austria

PostPosted: Mon Jun 09, 2008 1:07 pm    Post subject: Reply with quote

The HD-DVD .evo files are playing flawlessly on my AMD X2 4000+ with 2GB RAM.

Haven't tested any BluRays yet. Their encryption is more complicated (BD+) and they have region-codes too. It would be safe to assume that because of the .m2ts container format it will playback .

The evo and m2ts container formats seem both to be very ineffective (but the m2ts of bluray is reported to be worse). A co-worker using the same hardware is complaining about crappy evo playback on win vista too.

Of course recoding will make the performance better and the storage requirements for the recoded files are significantly less.
Back to top
View user's profile Send private message
grant123
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1080

PostPosted: Mon Jun 09, 2008 2:58 pm    Post subject: Reply with quote

Thanks guys. Sounds like I should check back in in a couple months. Thanks for putting in the time with this stuff.
Back to top
View user's profile Send private message
x1um1n
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2005
Posts: 126
Location: Chester, UK

PostPosted: Mon Jun 09, 2008 4:46 pm    Post subject: Reply with quote

Hi Guys,
I've successfully ripped a Blu-Ray using VirtualBox, AnyDVD HD, tsMuxeR and mkvmerge.
I know, I know, using windoze is cheating, but as my drive is now locked (see previous posts) I don't really have much choice.

Unfortunately, it doesn't play properly. I get the following error from mplayer:

Code:

MPlayer dev-SVN-r26753-4.1.2 (C) 2000-2008 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 6000+ (Family: 15, Model: 67, Stepping: 3)
3DNow supported but disabled
3DNowExt supported but disabled
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
Playing /DivX/Torrents/X3.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_AC3), -aid 0, -alang und
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO:  [avc1]  1920x1080  24bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 640.0 kbit/41.67% (ratio: 80000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
[h264 @ 0xae08a0]brainfart cropping not supported, this could look slightly wrong ...
[h264 @ 0xae08a0]brainfart cropping not supported, this could look slightly wrong ...
[h264 @ 0xae08a0]brainfart cropping not supported, this could look slightly wrong ...
VDec: vo config request - 1920 x 1080 (preferred colorspace: Planar YV12)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
[swscaler @ 0xac6350]using unscaled yuv420p -> bgr24 special converter
VO: [gl2] 1920x1080 => 1920x1080 BGR 24-bit  [fs]
[ASPECT] Warning: No suitable new res found!
[gl2] You have OpenGL >= 1.2 capable drivers, GOOD (16bpp and BGR is ok!)
[gl2] antialiasing off
[gl2] bilinear linear
[ASPECT] Warning: No suitable new res found!
..
..
A:   9.5 V:   8.1 A-V:  1.403 ct:  0.012   0/  0 65% 39%  1.2% 80 0
Too many video packets in the buffer: (36 in 8486268 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.


I don't think this can be a performance issue, as I've got a reasonably quick system with a GeForce 8500GT in, which is a HDCP capable card so should be able to handle 1080p using only the GPU..
I could be wrong on that, but I've got other 1080p files that play fine.

I haven't recoded the video stream as I want to keep it as high quality as possible, but I have converted the DTS TrueHD audio to AC3.

The AC3 stream plays fine on it's own and when I put the h264 stream into an mkv on its own it appears to play fine as well. It's a little harder to tell if it's stepping without the audio.

Has anyone come across that mplayer error before?
It's a new one on me.

Thanks
_________________
Linux Version 2.6.25-hh4, Compiled #1 SMP Sun May 25 17:17:46 GMT 2008
Two 3GHz AMD Athlon 64 Processors, 4GB RAM, 12004 Bogomips Total
omnius
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Mon Jun 09, 2008 5:17 pm    Post subject: Reply with quote

Just a guess: it's the -vo module. Try this:
Code:
mplayer -vo gl:yuv=2:force-pbo -dr -noslices yourfile.mkv

You'll need a pretty new mplayer to get the force-pbo option. You could also try a simple "-vo xv", but gl with force-pbo is slightly faster, especially if you're running a compositor.
Back to top
View user's profile Send private message
x1um1n
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2005
Posts: 126
Location: Chester, UK

PostPosted: Mon Jun 09, 2008 6:09 pm    Post subject: Reply with quote

:Gusar

Cheers mate, that did it!
Are those options specific to HD or can I safely drop them into .mplayer/config?

Now I just need to figure out why the audio's out of sync :(
_________________
Linux Version 2.6.25-hh4, Compiled #1 SMP Sun May 25 17:17:46 GMT 2008
Two 3GHz AMD Athlon 64 Processors, 4GB RAM, 12004 Bogomips Total
omnius
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Thu Jun 12, 2008 5:47 am    Post subject: Reply with quote

A little update from my side:

I am struggling with sound conversion atm. My combination of network player and receiver only can play DVD compliant AC3 or DTS. So I have to convert the EAC3/TrueHD or DTS-HD streams to a lower bitrate/resolution and merge them. I already tried ffmepg->aften. The channels got mixed up and I had an audio offset of several seconds.

I also tried converting video with mencoder directly. But it is not the most stable type of conversion. A stream that converted nicely with ldecod->mencoder crashes 200 seconds into the file using only mencoder (but the mencoder only encoding is 2 times faster).

If anyone knows a solution for this problems out of the box, don't hesitate to tell me. :wink:

fangorn
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Thu Jun 19, 2008 11:57 am    Post subject: Reply with quote

Making heavy progress.

My script is on a good way. So far it uses ffmpeg, libx264, libfaac and libmp3lame and encodes ripped blu-ray data to .avi, .mkv or .mp4 containers using either h264 or XVID and resolutions of 1080p or 720p.

I am experiencing one error at the moment. The encoded video has a recurring sequence of

single frame - two identical frames - three identical frames - single frame - ...

which leads to a video stream with twice the playtime.

Has anyone experienced something like this before?

For reference, her is my script
Code:
#!/bin/bash
# b2m
# Licence: Free for every use
# No Warranty of any kind!
#
# This script works best with ffmpeg and x264 from SVN repositories.
# compile them into /usr/local and leave stable versions for every day use.
# (be sure to have /usr/local after /usr in your path environments)

# get a defined environment. If you don't have this one installed, change to en_US.UTF-8 or something
export LC_ALL=en_US

#change paths if necessary
ffmpeg=/usr/local/bin/ffmpeg
mplayer=/usr/local/bin/mplayer

help_text () {
cat <<EOF
$0 is used to convert Blu-Ray/HDDVD Rips into a format more playable.
$0 can handle up to two audio streams which can either be copied as-is
or encoded to stereo mp3/aac

usage $0 [-f <fps>] [ -b <bitrate>] filename [audio_id_1] [audio_id_2]
    -f         frames per second of input video (default: 23.976)
    -b         bitrate for video encoding (in kbit/s) (default: 6000)
    -r         full resolution (full HD 1080p) (default: 1280x720)
    -l         low Quality (MPEG4 ASP/MP3)
    -m         switch container format to .mkv (Default: .avi)
    -4         switch container format to .mp4 (Default: .avi)
    -h         print this helptext
    audio_id_x usually a number between 1 and 8
               see ffmpeg -i <movie_name> for a list of available streams
EOF
   exit 0
}

preview="no"
format=".avi"
FPS='24000/1001'
BITRATE=6000
resolution="hd720"
quality="high"
while getopts h4rmlpf:b: option;
do
  case "$option"
  in
    r)  resolution="hd1080";;
    f)  FPS=$OPTARG;;
    b)  BITRATE=$OPTARG;;
    l)  quality="low";;
    m)  format=".mkv";;
    4)  format=".mp4";;
#    p)  preview="yes";;
    h)  help_text ;;
  esac
done
shift $(($OPTIND - 1))

if [ -z $1 ] ; then
   help_text
   exit ;
fi

mapping=""
newaudio=""
if [ $# = 3 ] ; then
   # two audio streams
   mapping="-map 0:0 -map 0:$2 -map 0:$3"
   if [ $quality = "low" ] ; then
      newaudio="-acodec libmp3lame -ar 48000 -ac 2 -ab 128k -newaudio"
   else
      if [ $format = ".mp4" ] ; then
         newaudio="-ac 2 -ab 128k -newaudio"
      else
         newaudio="-acodec copy -newaudio"
      fi
   fi
elif [$# = 2 ] ; then
   mapping="-map 0:0 -map 0:$2"
else
   mapping="-map 0:0 -map 0:1"
fi
echo "stream mapping: $mapping"

movie=$1

SRC_FPS=`ffmpeg -i "$movie" 2>&1 | grep Video | cut -d' ' -f 15`
DUR_HOURS=`ffmpeg -i "$movie" 2>&1 | grep Duration | cut -d: -f2 | sed 's/ //' | sed -e 's/^0//'`
DUR_MINS=`ffmpeg -i "$movie" 2>&1 | grep Duration | cut -d: -f3 | sed 's/ //' | sed -e 's/^0//'`
DUR_SECS=`ffmpeg -i "$movie" 2>&1 | grep Duration | cut -d: -f4 | cut -d. -f1 | sed 's/ //' | sed -e 's/^0//'`
DURATION=`perl -le "print ( (($DUR_HOURS*60)*60) + ($DUR_MINS*60) + $DUR_SECS )"`

echo "movie framerate is $SRC_FPS fps and encoding will happen with $FPS fps "
echo "movie playtime is $DURATION seconds, which is $DUR_HOURS:$DUR_MINS:$DUR_SECS"
echo "Do you wanna encode with these parameters? (y/n)"
read a

if [ ! $a = "y" ] && [ ! $a = "Y" ] ; then
   exit;
fi

#if [ $preview = "yes" ] ; then
#   PREVIEW_ARGS="-f yuv4mpegpipe - 2> /dev/null | $mplayer -nofs -vo sdl $SCALE_ARGS -aspect 16:9 -osdlevel 2 - &> /dev/null"
#else
#   PREVIEW_ARGS=""
#fi
#DURATION=60
if [ $quality = "low" ] ; then
   $ffmpeg -r $FPS -i $movie -t $DURATION -re \
           -y -threads 2 -aspect 16:9 \
           -s $resolution -b $BITRATE"k" \
           -vtag XVID  -pass 1 -passlogfile $movie".log" \
           -acodec copy \
           -f avi /dev/null
   $ffmpeg -r $FPS -i $movie  -t $DURATION -re \
           -y -threads 2 -aspect 16:9 \
           -s $resolution -b $BITRATE"k" \
           -vtag XVID  -pass 2 -passlogfile $movie".log" \
           -async 1 -acodec libmp3lame -ar 48000 -ac 2 -ab 128k \
           $mapping \
           $movie$format \
           $newaudio
else
   if [ $format = ".mp4" ] ; then
      acodec="-ac 2 -ab 128k"
   else
      acodec="-acodec copy"
   fi
   options="-coder 1 -flags +loop -cmp +chroma -bidir_refine 1 -partitions +parti4x4+partp8x8+partb8x8 -me hex -subq 5 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4"
echo   $ffmpeg -r $FPS -i $movie  -t $DURATION  \
           -y -threads 2 -aspect 16:9 \
      -s $resolution -b $BITRATE"k" \
           -vcodec libx264 $options \
      -async 1 $acodec \
      $mapping \
      $movie$format \
      $newaudio
   $ffmpeg -r $FPS -i $movie  -t $DURATION  \
           -y -threads 2 -aspect 16:9 \
      -s $resolution -b $BITRATE"k" \
           -vcodec libx264 $options \
      -async 1 $acodec \
      $mapping \
      $movie$format \
      $newaudio
   # if you are very patient, activate this instead
#   $ffmpeg -r $FPS -i $movie \
#           -y -threads 2 -aspect 16:9 \
#           -s $resolution -b $BITRATE"k" \
#           -vcodec libx264 $options -pass 1 -passlogfile $movie".log" \
#           -acodec copy \
#           -f avi /dev/null
#   $ffmpeg -r $FPS -i $movie \
#           -y -threads 2 -aspect 16:9 \
#           -s $resolution -b $BITRATE"k" \
#           -vcodec libx264 $options -pass 2 -passlogfile $movie".log" \
#           -async 1 $acodec \
#           $mapping \
#           $movie$format \
#           $newaudio
   
fi
 


You have to identify the audio streams you want to use in an external software. I use tsMuxerGUI for that task. Just count the audio streams (starting with 1) and give one or two numbers in the ordering you want them to appear in the output container.
_________________
Video Encoding scripts collection | Project page


Last edited by fangorn on Tue Jun 24, 2008 5:57 am; edited 1 time in total
Back to top
View user's profile Send private message
Tariella
Guru
Guru


Joined: 10 Dec 2005
Posts: 384
Location: Europe/Austria

PostPosted: Fri Jun 20, 2008 8:24 am    Post subject: Reply with quote

Great! Thanks :)

I'm going to do some heavy testing/experimenting this weekend. Hopefully we'll get some new results.
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Tue Jun 24, 2008 5:29 am    Post subject: Reply with quote

As mentioned before, the ffmpeg solution above still has a problem in the video part.

For the time being There is a workaround with mencoder. It is a little more handwork though.

1. First you have to remux the .m2ts streams you want into a MPEG4 Transportstream (.ts) using any suitable program. I use tsMuxeR (I use the windows version under wine because the linux version segfaults) with a script generated by tsMuxerGUI.

2. transcode the .ts file using mencoder and x264 to AVI or raw video, Copy audio or convert to AAC

3. convert AVI to mkv using mmg (MKVmergeGUI) or create a .mp4 from the rawvideo using mp4create

This is the script to get .mkv
Code:
#!/bin/bash

export LC_ALL=en_US

help_text () {
cat <<EOF
$0 is used to convert Blu-Ray/HDDVD Rips into a format more playable.
$0 can handle up to two audio streams which can either be copied as-is
or encoded to stereo mp3

usage $0 [-f <fps>] [ -b <bitrate>] filename [audio_id_1] [audio_id_2]
    -f         frames per second of input video (default: 23.976)
    -b         bitrate for video encoding (in kbit/s) (default: 6000)
    -r         full resolution (full HD 1080p) (default: 1280x720)
    -h         print this helptext
    audio_id_x usually a number between 1 and 8
EOF
   exit 0
}

mencoder=/usr/local/bin/mencoder
mplayer=/usr/local/bin/mplayer

BITRATE=6000
SCALE="1280:720"
AUDIO=""
FPS="23.976"
audio1=""
audio2=""

while getopts ra:b:f: option;
do
  case "$option"
  in
    r)  resolution="1920:1080";;
    b)  BITRATE=$OPTARG;;
    f)  FPS=$OPTARG;;
    h)  help_text ;;
  esac
done
shift $(($OPTIND - 1))


if [ -z $1 ] ; then
   help_text
   exit ;
else
   input=$1
fi

name=`basename $input .ts`

if [ ! -z $2 ] ; then
   num=$(( $2 + 1 ))
   AUDIO="-aid 435"$num
fi

echo $mencoder $input \
         $AUDIO -oac copy \
    -ovc x264 -x264encopts subq=4:bframes=4:b_pyramid:weight_b:pass=1:psnr:bitrate=$BITRATE:turbo=2:threads=0 \
    -vf scale=1280:720 \
    -fps $FPS -ofps $FPS \
    -o /dev/null
   
echo $mencoder $input \
         $AUDIO -oac copy \
    -ovc x264 -x264encopts subq=5:partitions=4x4:8x8dct:frameref=3:bframes=4:b_pyramid:pass=2:psnr:bitrate=$BITRATE:threads=0 \
    -vf spp,scale=$resolution,hqdn3d=2:1:2 \
    -fps $FPS -ofps $FPS \
    -o $name".avi"   

if [ ! -z $3 ] ; then
   num=$(( $3 + 1 ))
   AUDIO="-aid 435"$num
   $mplayer $input $AUDIO -dumpaudio -dumpfile $name"_"$3".ac3"
fi

mmg   


To get mp4 you need these two scripts
Code:
#!/bin/bash

export LC_ALL=en_US

help_text () {
cat <<EOF
$0 is used to convert Blu-Ray/HDDVD Rips into a format more playable.
$0 can handle up to two audio streams which can either be copied as-is
or encoded to stereo mp3

usage $0 [-f <fps>] [ -b <bitrate>] filename [audio_id_1] [audio_id_2]
    -f         frames per second of input video (default: 23.976)
    -b         bitrate for video encoding (in kbit/s) (default: 6000)
    -r         full resolution (full HD 1080p) (default: 1280x720)
    -h         print this helptext
    audio_id_x usually a number between 1 and 8
EOF
   exit 0
}

mencoder=/usr/local/bin/mencoder
mplayer=/usr/local/bin/mplayer

BITRATE=6000
SCALE="1280:720"
AUDIO=""
FPS="23.976"
audio1=""
audio2=""

while getopts ra:b:f: option;
do
  case "$option"
  in
    r)  resolution="1920:1080";;
    b)  BITRATE=$OPTARG;;
    f)  FPS=$OPTARG;;
    h)  help_text ;;
  esac
done
shift $(($OPTIND - 1))


if [ -z $1 ] ; then
   help_text
   exit ;
else
   input=$1
fi

name=`basename $input .ts`

if [ ! -z $2 ] ; then
   multichannel2aac $input $2
   audio1=$input"_$2.aac"
   mv $input".aac" $audio1
fi

echo $mencoder $input \
    -ovc x264 -x264encopts subq=4:bframes=4:b_pyramid:weight_b:pass=1:psnr:bitrate=$BITRATE:turbo=2:threads=0 \
    -vf scale=$resolution \
    -fps $FPS -ofps $FPS \
    -of rawvideo -nosound \
    -o /dev/null
   
echo $mencoder $input \
    -ovc x264 -x264encopts subq=5:partitions=4x4:8x8dct:frameref=3:bframes=4:b_pyramid:pass=2:psnr:bitrate=$BITRATE:threads=0 \
    -vf spp,scale=$resolution,hqdn3d=2:1:2 \
    -fps $FPS -ofps $FPS \
    -of rawvideo -nosound \
    -o $name".h264"   

if [ ! -z $3 ] ; then
   multichannel2aac $input $3
   audio2=$input"_$3.aac"
   mv $input".aac" $audio2
fi

#mmg   
base=`echo $FPS 1000 | awk '{printf "%10.0f", $1 * $2}'`
mp4creator -create=$name".h264" -optimize -rate=$FPS -timescale=$base -use64bits $name".mp4"

if [ -f $audio1 ] ; then
   mp4creator -aac-profile=4 -create=$audio1 $name".mp4"
fi
if [ -f $audio2 ] ; then
   mp4creator -aac-profile=4 -create=$audio2 $name".mp4"
fi

Code:
#!/bin/bash

AID=$(( $2 + 1))
mkfifo audiodump.pcm
faac -q 100 -I 5,6 -P -R 48000 -C 6 -X audiodump.pcm -o $1.aac & mplayer $1 -aid "435$AID" -vc dummy -vo null -ao pcm:nowaveheader -channels 6
killall faac
rm audiodump.pcm

Have fun :wink:
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Tue Jun 24, 2008 5:56 am    Post subject: Reply with quote

OK, the mp4 version is not working, but atm I don't know why :roll:
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
Tariella
Guru
Guru


Joined: 10 Dec 2005
Posts: 384
Location: Europe/Austria

PostPosted: Tue Jun 24, 2008 3:07 pm    Post subject: Reply with quote

I found some (new?) software for decrypting HD and Bluray media.
It is win software but claims to work with wine, as you can see here. The best of it seems even to be free (as in beer ;))

The only thing that it is not (yet) able to do is decrypting BD+ protected discs.

I'm going to try it out asap.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Tue Jun 24, 2008 5:06 pm    Post subject: Reply with quote

I've known about DVDFab for quite a while. I use it to decrypt DVDs (those with "protections" that linux rippers can't handle). It can only handle MKBv1 and MKBv3 discs, so it's of limited use.

But even if it's of limited use for HD, I can only recommend it for DVDs, it's nice and works very well.

I didn't know they actually advertised linux via wine support. I find it kinda funny. But oh well, maybe it gets them a few customers for the Platinum edition.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Page 2 of 8

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum