DVDのチャプターを抽出してファイルを分離する

DVDのチャプターを抽出してファイルを分離する

私はそれぞれ、複数のエピソードで構成される子供の漫画DVDを持っています。各エピソードが別々のファイルにあるようにどのように抽出できますか?私の考えでは、各エピソードがDVDタイトルの一枚として書かれていると思います。

ベストアンサー1

Title 2 Chapter 3の.VOB抽出

「-chapter 3」と「-chapter 3-」は、3章を最後までコピーします。間違った章番号を指定すると、このオプションは無視され、タイトル全体がコピーされます。

# physical DVD
  mplayer dvd://2 -chapter 3-3 -dumpstream -dumpfile ~/3.VOB

# DVD .iso image  
  mplayer dvd://2 -dvd-device "$dvd_iso" -chapter 3-3 -dumpstream -dumpfile ~/3.VOB  

これを使用して、lsdvd実際のDVDのタイトル、章、セル、オーディオ、ビデオなどを一覧表示できます。しかし、処理する方法がないようです(?) .isomount.iso、必要なら。

# count Titles, and count Cells per title. 
# eg. ${cell[1]}      is the Count of Cells for the first title
#     ${cell[titles]} is the Count of Cells for the last title

eval $(lsdvd | sed -n 's/Title: \([0-9]\+\), .* Chapters: \([0-9]\+\), Cells: .*/cells[$((10#\1))]=$((10#\2));/p')
titles=${#cells[@]}

title_num=2
from_cell=1
to_cell=${cell[title_num]}

dvdxchap一方、aは処理可能です.isoが、ヘッダー情報はリストされません。ただし、章情報を取得するタイトルを指定できます。

  title_num=2
  from_cell=1
# physical DVD
  to_cell="$(dvdxchap -t $title_num  /dev/dvd | sed -n 's/^CHAPTER\([0-9]\+\).*/\1/p' | sed -n '$p')"
# DVD .iso image  
  to_cell="$(dvdxchap -t $title_num "$dvd_iso"| sed -n 's/^CHAPTER\([0-9]\+\).*/\1/p' | sed -n '$p')"   

必要なヘッダー番号とセル数がわかっている場合は、ループにダンプできます。

# physical DVD
  for ((c=$from_cell; c<$to_cell; c++)) ;do
    mplayer dvd://$title_num -chapter $c-$c -dumpstream -dumpfile ~/$c.VOB
  done

# DVD .iso image  
  for ((c=$from_cell; c<$to_cell; c++)) ;do
    mplayer dvd://$title_num -dvd-device "$dvd_iso" -chapter $c-$c -dumpstream -dumpfile ~/$c.VOB
  done

おすすめ記事