VideoHelp Forum




Results 1 to 5 of 5
  1. Member
    Join Date
    Apr 2005
    Location
    europe
    Search Comp PM
    Hi,

    I'm trying to compress video from a digital camera. It's a canon A510, which produces an avi container with:
    video: mjpeg, yuvj422p, 320x240
    audio: pcm_u8, 11024 Hz, mono, 88 kb/s

    What would you recommand me for settings, knowing that:

    - processing time doesn't matter
    - quality is very important (even if the quality of the original is already miserable, or maybe because of it, I want to preserve as much as I can of it)
    - But size also matters, and I think 50MB is exagerated for 2 min 30s (what my camera produces)...

    I made some tests with mencoder/H.264 at 135kbps (what ffmpegX recommanded as "best" bitrate), and it isn't really good: contrasts are too high, and I do see some artifacts.

    I tried to compress the audio in AAC 64kbps and 11025Hz, but the quality is really worse than the original. 112kbps and 24000Hz does it, but maybe it's too much, and I could preserve the quality using less bytes?

    Thanks a lot for any advice!
    kaz

  2. Member edDV's Avatar
    Join Date
    Mar 2004
    Location
    Northern California, USA
    Search Comp PM
    I once calculated that Canon MJPeg is already compressed 60-80x and all in frame. It may be possible to add some motion compression if you shoot from a tripod.

  3. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    For video, you could try doubling the bitrate. Maybe it's way too much, maybe the app won't use all of that bitrate, but the result will be better. The adviced 'Best' bitrate is based on somewhat quality input, so you may need more to preserve what is there in the 'miserable' source.
    Also have a look at the Options tab: Turn off Constant bitrate and set Qmin and Qmax to a lower value.
    For audio, keep 11025 Hz (a higher value won't help), but up the bitrate a bit (more than 128 kbps is overkill).

  4. Member
    Join Date
    Apr 2005
    Location
    europe
    Search Comp PM
    Thanks a lot for the responses.

    Audio: Unfortunately, libfaac (?) doesn't support less thant 24000Hz and 112kbps it seems (I made some tests, and when I either lowered the bitrate or the sampling frequency, I had

    Code:
    [aac @ 0x45a630]libfaac doesn't support this output format!
    Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
    Video: it became much better (qmin=15, qmax=30), but I still have the problem of the contrast: shadows are darker in the output, trees are greener. It's not unbearable, but it's quite visible, even without looking at the original.

    Could it have something to do with the colorspace conversion (422p to yuv420p?)? Here the output of my encoding:

    Code:
    Encoding started on Mon Jun 25 17:13:46 CEST 2007
    MEncoder dev-CVS-051126-18:35-3.3 (C) 2000-2005 MPlayer Team
    Mac OSX static build for ffmpegX
    AltiVec found
    CPU: PowerPC
    success: format: 0  data: 0x0 - 0x20dd0a
    AVI file format detected.
    AVI_NI: No audio stream found -> no sound.
    VIDEO:  [MJPG]  320x240  24bpp  15.000 fps  2543.4 kbps (310.5 kbyte/s)
    [V] filefmt:3  fourcc:0x47504A4D  size:320x240  fps:15.00  ftime:=0.0667
    Opening video filter: [expand osd=1]
    Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
    Opening video filter: [scale w=320 h=240]
    Opening video filter: [harddup]
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG decoder)
    ==========================================================================
    VDec: vo config request - 320 x 240 (preferred colorspace: Planar 422P)
    VDec: using Planar 422P as output csp (no 1)
    Movie-Aspect is undefined - no prescaling applied.
    
    SwScaler: Lanczos scaler, from Planar 422P to Planar YV12 using AltiVec
    x264 [info]: no need for a SAR
    x264 [info]: using cpu capabilities Altivec 
    Writing AVI header... 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
    Pos:   6.5s     98f (99%)  1.98fps Trem:   0min   0mb  A-V:0.000 [686:0]
    Flushing video frames
    
    Writing AVI index...
    Fixing AVI header...
    
    Video stream:  686.552 kbit/s  (85818 B/s)  size: 560684 bytes  6.533 secs  98 frames
    x264 [info]: slice I:1     Avg QP:21.00  size: 26327  PSNR Mean Y:42.57 U:45.56 V:46.82 Avg:43.47 Global:43.47
    x264 [info]: slice P:49    Avg QP:29.84  size:  6824  PSNR Mean Y:32.97 U:37.60 V:40.76 Avg:34.20 Global:34.15
    x264 [info]: slice B:48    Avg QP:29.92  size:  4145  PSNR Mean Y:32.74 U:37.69 V:40.81 Avg:34.01 Global:33.98
    x264 [info]: mb I  I16..4:  6.0%  0.0% 94.0%
    x264 [info]: mb P  I16..4:  1.7%  0.0%  2.9%  P16..4: 26.7% 32.2% 28.8%  0.0%  0.0%    skip: 7.7%
    x264 [info]: mb B  I16..4:  0.1%  0.0%  0.1%  B16..8: 53.9%  4.0% 12.8%  direct:10.0%  skip:19.2%
    x264 [info]: final ratefactor: 30.96
    x264 [info]: PSNR Mean Y:32.953 U:37.723 V:40.849 Avg:34.203 Global:34.104 kb/s:685.29
    MEncoder dev-CVS-051126-18:35-3.3 (C) 2000-2005 MPlayer Team
    Mac OSX static build for ffmpegX
    AltiVec found
    CPU: PowerPC
    success: format: 0  data: 0x0 - 0x20dd0a
    AVI file format detected.
    AVI_NI: No audio stream found -> no sound.
    VIDEO:  [MJPG]  320x240  24bpp  15.000 fps  2543.4 kbps (310.5 kbyte/s)
    [V] filefmt:3  fourcc:0x47504A4D  size:320x240  fps:15.00  ftime:=0.0667
    Opening video filter: [expand osd=1]
    Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
    Opening video filter: [scale w=320 h=240]
    Opening video filter: [harddup]
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG decoder)
    ==========================================================================
    VDec: vo config request - 320 x 240 (preferred colorspace: Planar 422P)
    VDec: using Planar 422P as output csp (no 1)
    Movie-Aspect is undefined - no prescaling applied.
    
    SwScaler: Lanczos scaler, from Planar 422P to Planar YV12 using AltiVec
    x264 [info]: no need for a SAR
    x264 [error]: Error: 2pass curve failed to converge
    x264 [error]: target: 270.00 kbit/s, expected: 645.84 kbit/s, avg QP: 30.0000
    x264 [error]: try increasing target bitrate or increasing qp_max (currently 30)
    x264 [info]: using cpu capabilities Altivec 
    Writing AVI header... 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
    Pos:   6.5s     98f (99%)  2.26fps Trem:   0min   0mb  A-V:0.000 [657:0]
    Flushing video frames
    
    Writing AVI index...
    Fixing AVI header...
    
    Video stream:  657.999 kbit/s  (82249 B/s)  size: 537366 bytes  6.533 secs  98 frames
    x264 [info]: slice I:1     Avg QP:30.00  size: 13716  PSNR Mean Y:34.32 U:39.16 V:41.21 Avg:35.53 Global:35.53
    x264 [info]: slice P:49    Avg QP:30.00  size:  6655  PSNR Mean Y:32.80 U:37.42 V:40.56 Avg:34.04 Global:34.04
    x264 [info]: slice B:48    Avg QP:30.00  size:  4094  PSNR Mean Y:32.65 U:37.55 V:40.61 Avg:33.91 Global:33.91
    x264 [info]: mb I  I16..4: 10.3%  0.0% 89.7%
    x264 [info]: mb P  I16..4:  2.0%  0.0%  2.9%  P16..4: 28.0% 31.6% 28.5%  0.0%  0.0%    skip: 7.0%
    x264 [info]: mb B  I16..4:  0.1%  0.0%  0.1%  B16..8: 55.2%  3.9% 12.5%  direct: 9.8%  skip:18.4%
    x264 [info]: PSNR Mean Y:32.741 U:37.498 V:40.592 Avg:33.991 Global:33.986 kb/s:656.71
    Computing levels...
     MVI_2871_2-nochma 100% done, ETA 00:00:00 (batch 100% done, ETA 00:00:00) 
    Applying adjustment of 6.25dB to /Users/me/Desktop/folder/MVI_2871_2-nochmal2.wav...
     MVI_2871_2-nochma 100% done, ETA 00:00:00 (batch 100% done, ETA 00:00:00) 
    FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
    Mac OSX universal build for ffmpegX
      configuration:  --enable-mp3lame --enable-gpl --disable-vhook --disable-ffplay --disable-ffserver --enable-a52 --enable-xvid --enable-faac --enable-faad --enable-amr_nb --enable-pthreads --enable-x264 
      libavutil version: 49.0.0
      libavcodec version: 51.9.0
      libavformat version: 50.4.0
      built on Apr 15 2006 08:41:02, gcc: 3.3 20030304 (Apple Computer, Inc. build 1666)
    Input #0, h264, from '/Users/me/Desktop/folder/MVI_2871_2-nochmal2.264':
      Duration: N/A, bitrate: N/A
      Stream #0.0, 15.00 fps(r): Video: h264, yuv420p, 320x240
    Input #1, wav, from '/Users/me/Desktop/folder/MVI_2871_2-nochmal2.wav':
      Duration: 00:00:06.5, start: 0.000000, bitrate: 88 kb/s
      Stream #1.0: Audio: pcm_u8, 11024 Hz, mono, 88 kb/s
    Output #0, mp4, to '/Users/me/Desktop/folder/MVI_2871_2-nochmal2.aac.mp4':
      Stream #0.0: Audio: aac, 24000 Hz, mono, 112 kb/s
    Stream mapping:
      Stream #1.0 -> #0.0 [sync #0.0]
    Press [q] to stop encoding
    size=      34kB time=6.4 bitrate=  43.4kbits/s    
    video:0kB audio:32kB global headers:0kB muxing overhead 5.624372%
    Adjusting AVC SizeLength to 16 bits
    AVC-H264 import - frame size 320 x 240 at 15.000 FPS
    Import results: 98 samples - Slices: 2 I 98 P 96 B - 1 SEI - 2 IDR
    IsoMedia import - track ID 1 - Audio (SR 24000 - 1 channels)
    Saving /Users/me/Desktop/folder/MVI_2871_2-nochmal2.mp4: 0.500 secs Interleaving
    Encoding completed on Mon Jun 25 17:15:27 CEST 2007

  5. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Originally Posted by kaz219
    Audio: Unfortunately, libfaac (?) doesn't support less thant 24000Hz and 112kbps it seems
    AAC supports from 8 kHz to 96 kHz, so I never realized it could be an issue.

    Originally Posted by kaz219
    Video: [...] I still have the problem of the contrast: shadows are darker in the output, trees are greener. It's not unbearable, but it's quite visible, even without looking at the original.
    Could it have something to do with the colorspace conversion (422p to yuv420p?)?
    ffmpegX doesn't have many controls to influence that. You might want to try changing preset (h.264 x264) and decoders to get a slightly different result. If Decode with Quicktime wasn't checked, then try again with that decoder checked.




Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!