Quantcast FFmpeg: Help Me get Rid of 'shimmering' Effect with FFmpeg - digitalFAQ.com Forums [Archives]
Go Back    digitalFAQ.com Forums [Archives] > Video Production Forums > Video Encoding and Conversion

Reply
 
LinkBack Thread Tools
  #1  
06-08-2004, 11:31 AM
sk545 sk545 is offline
Free Member
 
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
I used ffmpeg from cvs on linux to make a vcd complaint mpg with this command:

Code:
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
Well, the resulting vcd.mpg is watchable and all, but it can give a headache. There is a effect that comes in it which i could best describe as 'shimmering'. It like comes on for a few milliseconds now and then during the vcd. I don't know what else to call it except for shimmering.

The myfile.avi has these properties:

Code:
[tcprobe] RIFF data, AVI video
[avilib] V: 25.000 fps, codec=DX50, frames=34525, width=544, height=416
[avilib] A: 44100 Hz, format=0x55, bits=0, channels=2, bitrate=127 kbps,
[avilib]    52866 chunks, 22095830 bytes, VBR
[tcprobe] summary for S1E02 - The Robbery.avi, (*) = not default, 0 = not detected
import frame size: -g 544x416 [720x576] (*)
       frame rate: -f 25.000 [25.000] frc=3
      audio track: -a 0 [0] -e 44100,0,2 [48000,16,2] -n 0x55 [0x2000] (*)
                   bitrate=127 kbps
           length: 34525 frames, frame_time=40 msec, duration=0:23:01.000
Any way to fix this shimmering?

Thx.

ffmpeg version 0.4.8 from cvs.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
06-08-2004, 12:52 PM
sk545 sk545 is offline
Free Member
 
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
oops
Reply With Quote
  #3  
06-11-2004, 09:52 PM
Airrsongs Airrsongs is offline
Free Member
 
Join Date: Jun 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Don't know if this will work with vcd's (might be out of spec), but try adding a -bufsize statement to your cmdline.

For example, this works great for me when converting from avi to xsvcd/dvd mpegs: -bufsize 1835. Shimmer is gone. YMMV.

From reading the ffmpeg-dev list on sourceforge, this apparently is a problem with the buffer that handles i,p,and b frames..... essentially, the default rate is too low to keep up...


For anyone interested, here's the Linux scriptlet I use:


Code:
ffmpeg -i $1  -target svcd -s 352x360 -padtop 60 -padbottom 60 -qscale 1 -bufsize 1835 -strict 1 -mbd 2 -bt 1024 -bf 2 -aspect 16:9 -hq -qcomp 0.5 -ab 192 -ar 48000 -ac 2 $2.mpg
To try it in Windows, just change the "$" to "%".....

AIR.
Reply With Quote
  #4  
06-11-2004, 11:50 PM
sk545 sk545 is offline
Free Member
 
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
cool, thx. I'll try that script out. I found this one to use on vcd's:

Code:
ffmpeg -i file.avi -y -f vcd -vcodec mpeg1video -map 0.0:0.0 -b 1150 -s 352x240 -r 29.97 -g 12 -qmin 3 -qmax 13 -hq -acodec mp2 -ab 224 -ar 44100 -ac 2 -map 0.1:0.1 movie.mpg
What do you think? I don't see a bufsize option in there, wonder if i could stick it in...
Reply With Quote
  #5  
06-12-2004, 03:56 PM
rds_correia rds_correia is offline
Free Member
 
Join Date: Apr 2003
Location: Chinese Democracy starts now!
Posts: 2,563
Thanks: 1
Thanked 0 Times in 0 Posts
Hi guys,
For linux encodings you could try this thread http://www.kvcd.net/forum/viewtopic.php?t=7771
It's a template made up by russiansexpat.
Other users have given good feedback when using it.
Though it uses mencoder's audio encoding routines.
But since you're trying ffmpeg and mencoder itself has a lot of ffmpeg code inside I thought you guys would
care to give it a try.
Cheers
__________________
Rui
Reply With Quote
  #6  
06-12-2004, 11:23 PM
sk545 sk545 is offline
Free Member
 
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
yes, i did look at that script. But i just can't figure out which one to use on that thread, there are like 6 pages of posts..
Reply With Quote
  #7  
06-13-2004, 10:21 AM
rds_correia rds_correia is offline
Free Member
 
Join Date: Apr 2003
Location: Chinese Democracy starts now!
Posts: 2,563
Thanks: 1
Thanked 0 Times in 0 Posts
There is not anything like the perfect script.
That rules for windows, *nix, etc.
If you care to look at the scripts there you will see that authors did their job based on russiansexpat initial script.
And they've made some remarks on what they tried to achieve by doing their own script.
Did you read it thoroughly?
Anyway it seems that ffmpeg will not be able to pull as much quality as the one obtained by mplayer/mencoder.
But keep it coming.
Maybe we haven't still used the right parameters.
Cheers
__________________
Rui
Reply With Quote
  #8  
06-13-2004, 04:28 PM
sk545 sk545 is offline
Free Member
 
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
I did try to use the sript (the first one he posted), but i am not sure if i am using it correctly.

Here is what i used as a command:

Code:
./script.sh movieout moviein.avi

Code:
mencoder -sws 0 -vf denoise3d,eq2,scale=352:-3,expand=0:288 \
   -forceidx -of mpeg -nosound \
   -ovc lavc -lavcopts vcodec=mpeg1video:\
intra_matrix=\
8,9,12,22,26,27,29,34,\
9,10,14,26,27,29,34,37,\
12,14,18,27,29,34,37,38,\
22,26,27,31,36,37,38,40,\
26,27,29,36,39,38,40,48,\
27,29,34,37,38,40,48,58,\
29,34,37,38,40,48,58,69,\
34,37,38,40,48,58,69,79:\
inter_matrix=\
16,18,20,22,24,26,28,30,\
18,20,22,24,26,28,30,32,\
20,22,24,26,28,30,32,34,\
22,24,26,30,32,32,34,36,\
24,26,28,32,34,34,36,38,\
26,28,30,32,34,36,38,40,\
28,30,32,34,36,38,42,42,\
30,32,34,36,38,40,42,44\
:mbd=2:vbitrate=1152:vrc_minrate=300:vrc_maxrate=2300:vrc_buf_size=320:keyint=25:vlelim=-4:vcelim=7:lumi_mask=0.05:dark_mask=0.01 \
    /home/me/dcup/moviein.avi -o video.mpg 2> /dev/null
MEncoder 1.0pre4-3.3.3 (C) 2000-2004 MPlayer Team

CPU: Advanced Micro Devices Athlon Thunderbird 998.3 MHz (Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
MMX2 supported but disabled
3DNow supported but disabled
3DNowExt supported but disabled
CPUflags: Type: 6 MMX: 1 MMX2: 0 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX

Reading /home/me/.mplayer/codecs.conf: Can't open '/home/me/.mplayer/codecs.conf': No such file or directory
Reading /etc/mplayer/mencoder_codecs.conf: 66 audio & 176 video codecs
File not found: 'frameno.avi'
Failed to open frameno.avi
Reading config file /home/me/.mplayer/mencoder: No such file or directory
Font /home/me/.mplayer/font/font.desc loaded successfully! (206 chars)
File not found: ' '
Failed to open
Cannot open file/device.
Exiting...
./script.sh.txt: line 2: -forceidx: command not found
./script.sh.txt: line 3: -ovc: command not found
./script.sh.txt: line 5: 8,9,12,22,26,27,29,34, : command not found
./script.sh.txt: line 6: 9,10,14,26,27,29,34,37, : command not found
./script.sh.txt: line 7: 12,14,18,27,29,34,37,38, : command not found
./script.sh.txt: line 8: 22,26,27,31,36,37,38,40, : command not found
./script.sh.txt: line 9: 26,27,29,36,39,38,40,48, : command not found
./script.sh.txt: line 10: 27,29,34,37,38,40,48,58, : command not found
./script.sh.txt: line 11: 29,34,37,38,40,48,58,69, : command not found
./script.sh.txt: line 12: 34,37,38,40,48,58,69,79: : command not found
./script.sh.txt: line 14: 16,18,20,22,24,26,28,30, : command not found
./script.sh.txt: line 15: 18,20,22,24,26,28,30,32, : command not found
./script.sh.txt: line 16: 20,22,24,26,28,30,32,34, : command not found
./script.sh.txt: line 17: 22,24,26,30,32,32,34,36, : command not found
./script.sh.txt: line 18: 24,26,28,32,34,34,36,38, : command not found
./script.sh.txt: line 19: 26,28,30,32,34,36,38,40, : command not found
./script.sh.txt: line 20: 28,30,32,34,36,38,42,42, : command not found
./script.sh.txt: line 21: 30,32,34,36,38,40,42,44 : command not found
./script.sh.txt: line 22: :mbd=2:vbitrate=1152:vrc_minrate=300:vrc_maxrate=2300:vrc_buf_size=320:keyint=25:vlelim=-4:vcelim=7:lumi_mask=0.05:dark_mask=0.01: command not found
Input #0, wav, from 'audio.wav':
  Duration: N/A, bitrate: 1411 kb/s
  Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, 1411 kb/s
Output #0, mp2, to 'movie.mpa':
  Stream #0.0: Audio: mp2, 44100 Hz, stereo, 128 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
size=   21578kB time=1381.0 bitrate= 128.0kbits/s
video:0kB audio:21578kB global headers:0kB muxing overhead 0.000000%

INFO: using reference profile (MPEG1)
INFO: profile type is (PAL)
INFO: mixing up parameters from profile (tcmplex.tmp)
  maxFileSize = 795

ERROR: Input file movie.mpv was not found.

++ WARN: initializing libvcd 0.7.20 [linux-gnu/i386]
++ WARN:
++ WARN:  this is the UNSTABLE development branch!
++ WARN:  use only if you know what you are doing
++ WARN:  see http://www.hvrlab.org/~hvr/vcdimager/ for more information
++ WARN:
**ERROR: could not stat() file `movie??.mpg': No such file or directory

script.sh encoding is completed in 48 seconds.

PLEASE INSERT BLANK CD IN CD-WRITER, after a keypress we start:
What am i doing wrong?
Reply With Quote
  #9  
06-13-2004, 11:23 PM
Airrsongs Airrsongs is offline
Free Member
 
Join Date: Jun 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I also had no video output using the 1st two versions of the script.

Using the last version (page 3 or 4 of the thread, I think), the encoding went ok.

The only issue I'm having with it now (I'll get around to posting this in the proper thread) is that when I switch the vid output from PAL to any type of NTSC, no video gets encoded. I don't know if it's my build of Mencoder or what, but when I try values like: 23.976 or 29.97 Mencoder won't process the video.

Changing the values to 23 or 29 works (whole numbers). I'm going to re-compile Mencoder before I post on the thread, just to make sure it's not _my_ sloppy arse screwing things up

AIR.
Reply With Quote
  #10  
06-13-2004, 11:32 PM
Airrsongs Airrsongs is offline
Free Member
 
Join Date: Jun 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by rds_correia
Hi guys,
For linux encodings you could try this thread http://www.kvcd.net/forum/viewtopic.php?t=7771
It's a template made up by russiansexpat.
Other users have given good feedback when using it.
Though it uses mencoder's audio encoding routines.
But since you're trying ffmpeg and mencoder itself has a lot of ffmpeg code inside I thought you guys would
care to give it a try.
Cheers
Just wanted to say 'Thanks' for the link. Real interesting stuff there!

AIR.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
FFMPEG: Do ffvfw and mencoder/ffmpeg give the same results? Razorblade2000 Video Encoding and Conversion 4 02-06-2004 04:23 PM
FFMPEG: Ffmpeg and inter/intra matrices vidar Video Encoding and Conversion 4 10-31-2003 08:48 PM
FFMPEG: My preliminary test. ffmpeg 0.4.7 vs. TMPEG 2.520 kwag Video Encoding and Conversion 23 10-21-2003 05:13 PM
FFMPEG: Encoding Audio: toolame,mp2enc or ffmpeg Razorblade2000 Video Encoding and Conversion 0 10-18-2003 03:04 PM
FFMPEG: Letterboxing with ffmpeg (aspect ratio) el_mozo Video Encoding and Conversion 16 10-14-2003 03:53 PM




 
All times are GMT -5. The time now is 12:07 AM  —  vBulletin © Jelsoft Enterprises Ltd