LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-28-2013, 01:57 PM   #1
anon109
LQ Newbie
 
Registered: May 2010
Location: Vista, CA
Distribution: Ubuntu 12.10, custom rolled distro
Posts: 19

Rep: Reputation: 0
Lower video quality with ffmpeg?


I have a video in heigh quality I would like to play on my netbook, but it's chopy. I'm thinking my netbook doesn't have to power to play it. How can I lower the quality so my netbook will play it?

Code:
>ffmpeg -i Avata.mp4
ffmpeg version 0.8.5-4:0.8.5-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
  built on Jan 24 2013 18:03:14 with gcc 4.6.3

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (5000000/104271) -> 23.98 (24000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Avatar.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2011-08-23 18:27:53
  Duration: 02:51:31.94, start: 0.000000, bitrate: 3336 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 1920x864 [PAR 8:9 DAR 160:81], 2927 kb/s, PAR 853:960 DAR 853:432, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
    Metadata:
      creation_time   : 2011-08-23 18:27:53
    Stream #0.1(eng): Audio: aac, 48000 Hz, 5.1, s16, 404 kb/s
    Metadata:
      creation_time   : 2011-08-23 18:29:52
 
Old 02-28-2013, 04:07 PM   #2
Dman58
Member
 
Registered: Nov 2010
Location: The Danger Zone
Distribution: Slackware & everything else in a VM
Posts: 294

Rep: Reputation: 31
Not sure exactly the proper syntax but maybe something like:

Code:
ffmpeg -i /path/to/avatar.mp4 -s 1366x768 /location/for/converted/avatar.mpg
The -s option will change the output resolution of the original file. Might want to play around with that some. But this will take time to convert and maybe not worth your time.

I'm not at my linux machine so unable to test it but this should get you going. Check the man page for detailed info.

Code:
man ffmpeg
What application are you using to play this file? VLC is very good as it supports many av formats. Also mplayer, xine, dragon player might work.

Another app choice is 'avplay'

Keep us posted, good luck!
 
Old 02-28-2013, 06:22 PM   #3
anon109
LQ Newbie
 
Registered: May 2010
Location: Vista, CA
Distribution: Ubuntu 12.10, custom rolled distro
Posts: 19

Original Poster
Rep: Reputation: 0
I've been using vlc and totem. The command you gave me is not working.

Code:
ffmpeg -i Avatar.mp4  -s 1366x768 Avatar-lower.mpg                                                                 <-- ~/Media
ffmpeg version 0.8.5-4:0.8.5-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
  built on Jan 24 2013 18:03:14 with gcc 4.6.3

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (5000000/104271) -> 23.98 (24000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Avatar.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2011-08-23 18:27:53
  Duration: 02:51:31.94, start: 0.000000, bitrate: 3336 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 1920x864 [PAR 8:9 DAR 160:81], 2927 kb/s, PAR 853:960 DAR 853:432, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
    Metadata:
      creation_time   : 2011-08-23 18:27:53
    Stream #0.1(eng): Audio: aac, 48000 Hz, 5.1, s16, 404 kb/s
    Metadata:
      creation_time   : 2011-08-23 18:29:52
[buffer @ 0x850afe0] w:1920 h:864 pixfmt:yuv420p
[scale @ 0x85027c0] w:1920 h:864 fmt:yuv420p -> w:1366 h:768 fmt:yuv420p flags:0x4
[mp2 @ 0x8501fa0] encoding 6 channel(s) is not allowed in mp2
Output #0, mpeg, to 'Avatar-lower.mpg':
    Stream #0.0(und): Video: mpeg1video, yuv420p, 1366x768 [PAR 6824:6147 DAR 853:432], q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
    Metadata:
      creation_time   : 2011-08-23 18:27:53
    Stream #0.1(eng): Audio: mp2, 48000 Hz, 5.1, s16, 128 kb/s
    Metadata:
      creation_time   : 2011-08-23 18:29:52
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
Looks to me the problem is '[mp2 @ 0x8501fa0] encoding 6 channel(s) is not allowed in mp2'. Any ideas?
 
Old 02-28-2013, 11:54 PM   #4
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Lower the quality means?
Do you want to reduce the resolution or reduce the size?
Try this
Code:
ffmpeg -i "Avatar.mp4" -f mp4 -vcodec mpeg4 -b 512k -r 30 -s 640x360 -acodec libfaac -ar 32000 -ab 128k -ac 2 -threads 8 "Avatar_out.mp4"
-b = video bit rate, lesser the value, lesser the size of the video. But it reduces the quality of video. If you put it 256k, you can see the video is pixelette.
-s = resolution of the video, 640x360 is common resolution for mobiles. but it should be according to aspect ratio. If you put it here anything, it gives error.
 
1 members found this post helpful.
Old 03-01-2013, 02:20 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
My first recommendation is to try the multi-threaded decoding in mplayer:

Code:
mplayer -vo xv -af volnorm=1 -subfont-autoscale 1 -lavdopts threads=4 -idx movie.mp4
If that doesn't do it, then convert it like:

Code:
ffmpeg -i input.mkv -vcodec libx264 -vpre special -crf 15 -s 640x288 -aspect 16:9 -r 23.976 -threads 4 -acodec libvo_aacenc -ab 128k -ar 48000 -async 48000 -ac 2 -scodec copy output.mkv
preset:
Code:
coder=1
flags=+loop
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
me_method=hex
subq=6
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=1
qcomp=0.6
qmin=10
qmax=51
qdiff=4
bf=3
refs=5
trellis=1
wpredp=2
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] High quality batch ffmpeg video encoding propofol Linux - Software 6 11-22-2012 01:57 PM
ffmpeg mixing audio/video - trying to end vid after video stream completes joejoe99 Linux - Software 2 06-21-2012 11:44 PM
[SOLVED] Regular expression needed to write [[:lower:]] to [[:lower:]] and [[:upper:]] rgdacosta Programming 13 04-05-2012 12:50 PM
[SOLVED] ffmpeg - quality loss while converting to wmv ralfbutler Linux - Software 2 10-11-2010 03:11 PM
ffmpeg video output really low quality Cultist Linux - Software 1 08-11-2010 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:03 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