Find the answer to your Linux question:
Results 1 to 3 of 3
i am working on a script that will automate encoding a video and then author the video files here is the code in the author function i have dvdauthor and ...
  1. #1
    Just Joined!
    Join Date
    Apr 2004
    Posts
    2

    bash script and xml document

    i am working on a script that will automate encoding a video and then author the video files
    here is the code in the author function i have dvdauthor and it calles an xml document is there a way to embed that doc in the code so i don't have to have it with my script in the same folder


    Code:
    #!/bin/sh
    
    # ToDo
    #Variables
    
    
    #functions
    encode()
    {
    	mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup \
    	-srate 48000 -af lavcresample=48000 \
    	-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:\
    	acodec=ac3:abitrate=192 -ofps 30000/1001 -o ${V_NAME}.mpg $V_NAME
    }
    
    author()
    {
    	dvdauthor -o dvd -x dvd.xml
    }
    
    
    
    
    # main
    echo "what is the name of the file"
    read V_NAME
    encode && author

  2. #2
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    I'm not familiar with dvdauthor but if you can persuade it to take the xml from stdin you can either "echo" the text in, or use a "here" document:
    Code:
    echo "dvd.xml text
    more text" | dvdauthor
    or
    Code:
    dvdauthor <<EOF
    dvd.xml text
    more text
    EOF

  3. #3
    Just Joined!
    Join Date
    Apr 2004
    Posts
    2
    thanks a lot
    that did it i made a here doc and it made the file dvdauthor took it thanks a lot
    now if i can get one thing to run at a time it would work like a champ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...