Ardour and DVD, soup to nuts.

8 replies [Last post]
philicorda
User offline. Last seen 1 year 46 weeks ago. Offline
Joined: 2006-05-16
Posts:

Hello. This is not totally Ardour related, but useful to someone I hope. I do music for telly sometimes, and receive stuff on DVD. I make new music, sync it to picture myself and then send back a DVD so they can see if it works etc.

I mostly use Cubase to control xjadeo over midi to view picture, and Linux for all the video ripping/recombining. It's all the same for using Ardour, just use jack transport instead of midi. This is a little bit terse, so I welcome improvements. If someone could tell me how to write pcm instead of ac3 to dvd I would be most grateful.

--------------------------------------------------------------------------
PART 1 Ripping and xjadeo.
--------------------------------------------------------------------------

Rip the video:
mencoder -idx -ovc lavc -lavcopts keyint=1 -nosound dvd:// -o dvdoutput_file.avi

Rip the audio:
mplayer dvd:// -vc null -vo null -ao pcm:fast
(this creates the file audiodump.wav)

Play the video synced over midi:
xjadeo -m 28 -f 25 -C dvdoutput_file.avi
xjadeo -m 28 -M 2 -f 25 -C dvdoutput_file.avi
(-m 28 specifies the midi port)
or with jack transport:
xjadeo -f 25 dvdoutput_file.avi

For non mencoded (keyframe every frame), this works for the moment:

xjadeo -K -f 25 sunmjpeg4.avi
xjadeo -K -f 25 -m 28 sunmjpeg4.avi
xjadeo -K -f 25 -m 28 -i 2 sunmjpeg4.avi

Edit soundtrack till happy.
---------------------------------------------------------------------------
PART 2 Recombining.
---------------------------------------------------------------------------
NOW EXPORT SYNC AUDIO AS A NEW AUDIODUMP.WAV from sequencer.

To make combined audio+vid output file:

ffmpeg -i audiodump.wav -i dvdoutput_file.avi -acodec copy -vcodec copy combina.avi
(works for full good quality copy! Won't play on Windows. :( )

Or if new DVD is not required and target is Win.
ffmpeg -i audiodump.wav -i dvdoutput_file.avi -acodec copy -vcodec wmv1 combina.avi
(wmv1 for windows works!) low quality.

Replay the synched video:

mplayer -ao alsa:device=hw=2 combina.avi

---------------------------------------------------
PART 3 How to encode a dvd compatible mpeg with mencoder:
---------------------------------------------------

Low quality audio:
------------------
mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:576,harddup -srate 48000 -af
lavcresample=48000 -lavcopts
vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:acodec=ac3:abitrate=192:aspect=4/3
-ofps 25 -o movie.mpg combina.avi

Better quality ac3 384kbps audio:
-----------------
mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:576,harddup -srate 48000 -af
lavcresample=48000 -lavcopts
vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:acodec=ac3:abitrate=384:aspect=4/3
-ofps 25 -o movie.mpg combina.avi

---------------------------------------------------
PART 4 Make the DVD
---------------------------------------------------

Then make the dvd filesystem:
dvdauthor -o dvd/ -t movie.mpg

Then make the ifo file:
dvdauthor -o dvd/ -T

Then make the iso:
mkisofs -dvd-video -v -o DVD.iso ./dvd

Burn to DVD with K3b

Reuben
User offline. Last seen 4 years 32 weeks ago. Offline
Joined: 2006-03-30
Posts:

I guess I don't understand the problem.

The DVD standard supports ac3, mp2 and pcm audio streams... so why aren't you just dumping a pcm stream into the MPEG2 container instead of ac3?

philicorda
User offline. Last seen 1 year 46 weeks ago. Offline
Joined: 2006-05-16
Posts:

I can't figure out the right options for mencoder/lavc to dump the pcm straight in and have a valid mgeg2 to burn to DVD afterwards.

I've tried a couple of times, but have ended up with DVDs that appear to have an audio track but won't make any sound in a stand alone dvd player, or mencoder just freezes at "Writing header..." while encoding and has to be killed -9.

DVD seems a bit finickity, and combined with my inexperience in all things video this has meant quite a lot of finding things out by trial and error. :)

Eventually I want to make some shell scripts to do most of this, and get the audio side done in Ardour, which would simplify things a lot. Also, synching the video via midi is not as smooth on playback as jack transport over the network.

Reuben
User offline. Last seen 4 years 32 weeks ago. Offline
Joined: 2006-03-30
Posts:

Well, you might try using ffmpeg (or even transcode) to dump the stream into the container instead of mencoder. That would just require an "-acodec copy" from your PCM source. (assuming your pcm is already resampled to 48k)

You're video source should also just be a stream dump from the origional DVD. No need to re-encode anything.

judfilm
User offline. Last seen 7 years 4 weeks ago. Offline
Joined: 2006-03-28
Posts:

Hi philicorda, is it possible I can cut'n'paste your post and add it to the Arch Linux ProAudio Wiki? http://wiki.archlinux.org/index.php/ProAudio
Thanks.

philicorda
User offline. Last seen 1 year 46 weeks ago. Offline
Joined: 2006-05-16
Posts:

Sure. Go ahead.

I think it could be simplified a lot, by skipping the second mencoder part and using pcm copy like Reuben said.

I'll post an updated version here when I get round to it.

alan
User offline. Last seen 6 years 43 weeks ago. Offline
Joined: 2007-05-09
Posts:

"why aren’t you just dumping a pcm stream into the MPEG2 container instead of ac3?"

The DVD format supports three types of audio: Dolby Digital (AC-3), uncompressed PCM, and MPEG Layer II. Each of them has advantages and disadvantages. All audio must be a minimum 48hz and stereo. It can also be surround sound. The most popular of them is AC3, as it is a small file that retains high quality. Dolby sound also allows for surround sound, most commonly the Dolby Digital 5.1 sound scheme.

softarea51
User offline. Last seen 6 years 37 weeks ago. Offline
Joined: 2007-07-31
Posts:

You might try using ffmpeg as Reuben said, but if still not working I can figure it out other way. The problem is strange anyway, because you should be able to do a pcm stream dumping.

thorgal
User offline. Last seen 1 year 21 weeks ago. Offline
Joined: 2007-08-03
Posts:

Don't advertize these websites!

To Enan and Vasil (same guy maybe ?),
I'd like to draw your attention to section 6. of the 'Terms of Service' of world-films.org, or its alias movie-library.com :

6 Copyrights
6.1 All materials presented on this site are available for the distribution over the Internet in accordance with the license of the Russian Organization for multimedia and Digital Systems (ROMS) and intended for personal use only. Further distribution, resale or broadcasting is strictly prohibited.
6.2 The Site remunerates the fees for every downloaded File in accordance with the license agreement.
6.3 All trade marks, trade names, company names, slogans, logos, and any other copyright items, which can be seen on the Site pages in various contexts, are the property of their respective owners. You have no right to copy, distribute or use them without written permission from the owners.
6.4 The Client has no right to download any Files from the Site if this violates the law of his country.
6.5 The Site Administration can not control actions of each Client therefore the Client is responsible for any illegitimate use of the Site's materials or/and Services.

If you google ROMS + AllofMp3, you're gonna find interesting articles ... My question would naturally be : who at the end gets the money you pay for buying these downloads ? it is far from obvious. But knowing that it disappears in the hands of some obscure russian recipient who surfs at the edge of its own country's legal line - which, viewed from western legislation, is actually full of loopholes - makes me uneasy. I would not advocate such a website on this forum.