LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-14-2008, 01:49 PM   #1
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Rep: Reputation: 34
dvd-slideshow gives problem with ffmpeg encoder


I am using fedora8 and would like to try out a program called dvd-slideshow. It generates slideshows from .jpgs with audio and ken burns effect.
Everything is working alright till the audio conversion starts - the program aborts with an error:-
[dvd-slideshow] Creating ac3 audio...
FFmpeg version SVN-r11070, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --arch=i386 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables --enable-liba52 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libx264 --enable-pp --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --disable-strip
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 51.19.0
built on Jun 25 2008 09:25:21, gcc: 4.1.2 20070925 (Red Hat 4.1.2-33)
Input #0, wav, from 'pipe:':
Duration: N/A, bitrate: 1536 kb/s
Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Output #0, ac3, to '/opt/dvd-slideshow-0.8.0-1/dvd-slideshow_temp_10206/audio1.ac3':
Stream #0.0: Audio: ac3, 48000 Hz, 5:1, 0 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
[dvd-slideshow] ERROR during ffmpeg execution!
[dvd-slideshow] see /opt/dvd-slideshow-0.8.0-1/dvd-slideshow.log for details
[dvd-slideshow] cleanup...

can someone help me out....
thanks in advance
nishith
 
Old 07-15-2008, 01:34 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
What version of dvd-slideshow are you using? A year or so ago ffmpeg changed the way it reads the bitrate options, and now it needs the setting to be in bits per second instead of kilobits per second*. If your version of dvd-slideshow is too old, it might be passing the wrong bitrate to the program.

It could also be just a bug in the script. dvd-slideshow is really just a collection of shell scripts for automating things, so you might even be able to open the thing up and fix it yourself if you know anything about scripting.

Have you tried using mp2 output instead of ac3?



* The ffmpeg command line flags -b and -ab now need to be set either with the number in bits, e.g. '-ab 192000', or with a 'k' at the end, e.g. '-ab 192k. It used to use kilobytes per second, so many old scripts and examples will break.
 
Old 07-15-2008, 04:45 AM   #3
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Original Poster
Rep: Reputation: 34
thanks for your response.
I am using dvd-slideshow 0.8.0-1 from the sourceforge website.
I have indeed tried to use mp2 output instead of ac3 and I specified in the .dvd-slideshowrc file as the directives :-
#ac3=1 # ac3 audio commented out
ac3=0 # use mpeg2 audio by default

Now I did google around a bit on my own and understood that there is something about the bit rate setting I have to do maybe ?!? and I did open up the shell script dvd-slideshow, but I was totally overwhelmed by the code and got lost.
So could you tell me what to do and where to fix that ?
thanks in advance
nishith
 
Old 10-27-2008, 09:15 PM   #4
dlaw
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
dvd-slideshow patch to fix ffmpeg bitrate error

David the H. - thank you mucho - you saved me a lot of time.

I just edited the script and got it to work - thanks for the tip on the bitrate. Here are the changes I made. (This is a diff -u output and could be fed to patch if you like.)

--- /usr/bin/dvd-slideshow 2006-12-26 21:42:24.000000000 -0500
+++ dvd-slideshow 2008-10-27 21:47:54.000000000 -0400
@@ -3987,6 +3990,7 @@
if [ "$vcd" -eq 1 ] ; then
ac3=0 # force mp2
audio_bitrate=224
+ faudio_bitrate=224000
video_bitrate='1152'
audio_sample_rate=44100
mplex_type=1
@@ -3995,6 +3999,7 @@
elif [ "$svcd" -eq 1 ] ; then
ac3=0 # force mp2
audio_bitrate=128
+ faudio_bitrate=128000
video_bitrate='4500'
audio_sample_rate=44100
mplex_type=4
@@ -4002,6 +4007,7 @@
mpeg2enc_params="-v 0 -4 2 -2 1 -H -b 2500 -n n -s -f $mplex_type"
else
audio_bitrate=192
+ faudio_bitrate=192000
video_bitrate='3800'
audio_sample_rate=48000
mplex_type=8
@@ -4174,7 +4180,7 @@
# checkfor_lame
myecho "[dvd-slideshow] Decoding mp3 audio: $file"
# use ffmpeg instead of lame!
- ffmpeg -i "$file" -y -vn -ab $audio_bitrate -f wav -ar $audio_sample_rate -ac 2 "$tmpdir/audio$track"_"$audio_index_padded.wav" >> "$outdir/$logfile" 2>&1
+ ffmpeg -i "$file" -y -vn -ab $faudio_bitrate -f wav -ar $audio_sample_rate -ac 2 "$tmpdir/audio$track"_"$audio_index_padded.wav" >> "$outdir/$logfile" 2>&1
# lame --decode "$file" "$tmpdir/audio$track"_"$audio_index_padded.wav" 2> /dev/null
elif [ "$suffix" == "ogg" ] ; then
checkfor_oggdec
@@ -5815,11 +5821,11 @@
checkfor_lame
myecho "[dvd-slideshow] decoding mp3 audio file... be patient..."
if [ "$audiosmp" -eq 1 ] ; then
- ffmpeg -i "$file" -y -vn -ab $audio_bitrate -f wav -ar $audio_sample_rate -ac 2 "$tmpdir/audio$track"_"$audio_index_padded.wav" >> "$outdir/$logfile" 2>&1 &
+ ffmpeg -i "$file" -y -vn -ab $faudio_bitrate -f wav -ar $audio_sample_rate -ac 2 "$tmpdir/audio$track"_"$audio_index_padded.wav" >> "$outdir/$logfile" 2>&1 &
# lame --decode "${file}" "$tmpdir/audio$track"_"$audio_index_padded.wav" 2> /dev/null &
# ffmpeg -i "$file" -y -vn -ab $audio_bitrate -acodec pcm_s16be -f s16be -ar $audio_sample_rate -ac 2 "$tmpdir/audio$track"_"$audio_index_padded.raw" >> "$outdir/$logfile" 2>&1 &
else
- ffmpeg -i "$file" -y -vn -ab $audio_bitrate -f wav -ar $audio_sample_rate -ac 2 "$tmpdir/audio$track"_"$audio_index_padded.wav" >> "$outdir/$logfile" 2>&1
+ ffmpeg -i "$file" -y -vn -ab $faudio_bitrate -f wav -ar $audio_sample_rate -ac 2 "$tmpdir/audio$track"_"$audio_index_padded.wav" >> "$outdir/$logfile" 2>&1
# lame --decode "${file}" "$tmpdir/audio$track"_"$audio_index_padded.wav" 2> /dev/null
# ffmpeg -i "$file" -y -vn -ab $audio_bitrate -acodec pcm_s16be -f s16be -ar $audio_sample_rate -ac 2 "$tmpdir/audio$track"_"$audio_index_padded.raw" >> "$outdir/$logfile" 2>&1
fi
@@ -6103,7 +6109,7 @@
if [ "$ac3" -eq 1 ] && [ "$output_format" != 'flv' ] ; then
checkforprog ffmpeg
myecho "[dvd-slideshow] Creating ac3 audio for $file..."
- ffmpeg -i "$tmpdir/audio1.wav" -y -vn -ab $audio_bitrate -acodec ac3 -ar $audio_sample_rate -ac 6 "$tmpdir/audio1.ac3" >> "$outdir/$logfile" 2>&1
+ ffmpeg -i "$tmpdir/audio1.wav" -y -vn -ab $faudio_bitrate -acodec ac3 -ar $audio_sample_rate -ac 6 "$tmpdir/audio1.ac3" >> "$outdir/$logfile" 2>&1
if [ $? -ne 0 ] ; then
## ffmpeg errored
myecho "[dvd-slideshow] ERROR during ffmpeg execution!"
@@ -6317,11 +6323,13 @@

## AC3 audio may be more compatible:
if [ "$ac3" -eq 1 ] && [ "$output_format" != 'flv' ]; then
- myecho "[dvd-slideshow] Creating ac3 audio..."
+ myecho "[dvd-slideshow] Creating ac3 audio 1 ..."
checkforprog ffmpeg
check_rm "$tmpdir/audio1.ac3"
# find "$tmpdir" -name audio1_\?\?\?\?.raw -print0 | xargs -0 sox -t raw -w -s -c 2 -r $audio_sample_rate - "$tmpdir/audio1.wav"
- cat "$tmpdir"/audio1_????.raw | sox -t raw -w -s -c 2 -r $audio_sample_rate - -t wav - 2> /dev/null | ffmpeg -i - -vn -ab $audio_bitrate -acodec ac3 -ar $audio_sample_rate -ac 6 "$tmpdir/audio1.ac3" >> "$outdir/$logfile" 2>&1
+ echo "cat $tmpdir/audio1_????.raw | sox -t raw -w -s -c 2 -r $audio_sample_rate - -t wav - 2> /dev/null | ffmpeg -i - -vn -ab $faudio_bitrate -acodec ac3 -ar $audio_sample_rate -ac 6 $tmpdir/audio1.ac3 >> $outdir/$logfile"
+
+ cat "$tmpdir"/audio1_????.raw | sox -t raw -w -s -c 2 -r $audio_sample_rate - -t wav - 2> /dev/null | ffmpeg -i - -vn -ab $faudio_bitrate -acodec ac3 -ar $audio_sample_rate -ac 6 "$tmpdir/audio1.ac3" >> "$outdir/$logfile" 2>&1
# ffmpeg -i "$tmpdir/audio1.wav" -vn -ab $audio_bitrate -acodec ac3 -ar $audio_sample_rate -ac 6 "$tmpdir/audio1.ac3" >> "$outdir/$logfile" 2>&1
if [ $? -ne 0 ] ; then
## ffmpeg errored
@@ -6329,6 +6337,7 @@
myecho "[dvd-slideshow] see $outdir/$logfile for details"
cleanup; exit 1
fi
+ echo "=== Done 1 ==="
else
myecho "[dvd-slideshow] Concatenating all audio files..."
## cat all the audio files together:
@@ -6547,16 +6556,18 @@
fi
## AC3 audio may be more compatible:
if [ "$ac3" -eq 1 ] && [ "$output_format" != 'flv' ] ; then
- myecho "[dvd-slideshow] Creating ac3 audio..."
+ myecho "[dvd-slideshow] Creating ac3 audio 2 ..."
checkforprog ffmpeg
check_rm "$tmpdir/audio2.ac3"
- ffmpeg -i "$tmpdir/audio2.wav" -vn -ab $audio_bitrate -acodec ac3 -ar $audio_sample_rate -ac 6 "$tmpdir/audio2.ac3" >> "$outdir/$logfile" 2>&1
+ echo "ffmpeg -i $tmpdir/audio2.wav -vn -ab $faudio_bitrate -acodec ac3 -ar $audio_sample_rate -ac 6 $tmpdir/audio2.ac3 >> $outdir/$logfile 2>&1"
+ ffmpeg -i "$tmpdir/audio2.wav" -vn -ab $faudio_bitrate -acodec ac3 -ar $audio_sample_rate -ac 6 "$tmpdir/audio2.ac3" >> "$outdir/$logfile" 2>&1
if [ $? -ne 0 ] ; then
## ffmpeg errored
myecho "[dvd-slideshow] ERROR during ffmpeg execution!"
myecho "[dvd-slideshow] see $outdir/$logfile for details"
cleanup; exit 1
fi
+ echo "==== Done ===="
else
## toolame is way faster! (3x in my test)
it=`which toolame`
 
Old 11-09-2008, 09:47 PM   #5
rastiazul
Member
 
Registered: Feb 2006
Location: Costa Rica
Distribution: GalliumOS, Lubuntu
Posts: 84

Rep: Reputation: 15
yea that works, just edit the bitrate part
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Burning DVD with both video and slideshow moxieman99 Linux - Software 2 09-07-2007 11:21 AM
DVD-slideshow are you kidding me? bioalchemist Linux - Software 12 11-04-2006 03:59 PM
problem with dvd slideshow /SuSE9.3 rokka SUSE / openSUSE 7 10-06-2005 02:44 PM
decoder and encoder with ffmpeg (libavcodec) sangijuela Programming 1 08-20-2005 07:53 AM
problem with dvd slideshow rokka Linux - Software 1 06-23-2005 07:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration