Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[ffmpeg] convertir une video en XVID et débit variable
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
loopx
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2787
Location: Belgium / Liège

PostPosted: Sun Jan 03, 2010 2:58 pm    Post subject: [ffmpeg] convertir une video en XVID et débit variable Reply with quote

Bonjour,


Suite de mon script youtube, j'essaie d'utiliser ffmpeg pour arriver à avoir un fichier pas trop gros, mais qui conserve le maximum de qualité. Malheureusement, je comprend rien aux variables qscale, qmax et qmin ...


Une idée ? POur l'instant, j'ai mis un "qscale 2", mais j'ai une vidéo qui dépasse les 100Mo, alors, j'essaie "qmin" et "qmax", mais on dirait qu'il ne prend en compte que le "qmax" ... bref, étrange ...



ffmpeg -i * -acodec libmp3lame -ab 192k -vcodec libxvid -qmin 2 -qmax 2 -vtag XVID -f avi $NAME


Quelle est la différence entre "qmin qmax" et "qscale" ??? J'ai l'impression que ca réagi pas comme je le veux :(
_________________
Mon MediaWiki perso : http://pix-mania.dyndns.org
Back to top
View user's profile Send private message
k-root
Guru
Guru


Joined: 08 Jan 2005
Posts: 428

PostPosted: Sun Jan 03, 2010 5:27 pm    Post subject: Reply with quote

xvid ? :? ... h264 c`est mieux :wink:

"qmin qmax" : qmin <quantificateur< qmax
"qscale" : quantificateur fixe

Code:

       -bt tolerance
           set(7,n,1 builtins) video bitrate tolerance (in(1,8) kbit/s)

       -maxrate bitrate
           set(7,n,1 builtins) max video bitrate tolerance (in(1,8) kbit/s)

       -minrate bitrate
           set(7,n,1 builtins) min video bitrate tolerance (in(1,8) kbit/s)


j`utilise c`est options avec les profiles de ffmpeg (hq), le quntificateur y est deja fixe :
cat /usr/share/ffmpeg/libx264-hq.ffpreset
Code:

coder=1
flags=+loop
cmp=+chroma
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
me_method=umh
subq=8
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=2
qcomp=0.6
qmin=10
qmax=51
qdiff=4
bf=3
refs=4
directpred=3
trellis=1
flags2=+wpred+mixed_refs+dct8x8+fastpskip


pour des fichiers mov en 720p la taille est diviser par deux sans perte "visible"

Code:
ffmpeg -i $i -an -pass 1 -vcodec libx264 -vpre fastfirstpass -b 10000kb -bt 5000 $i.p1.mp4
ffmpeg -i $i -acodec libfaac -ab 128k -pass 2 -vcodec libx264 -vpre hq -b 10000kb -bt 5000 $i.p2.mp4

_________________
boozo wrote:
Gentoo, ça mange des ours et baffe des buffles par 37°C avec un bob et des tongs


Last edited by k-root on Sun Jan 03, 2010 5:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
loopx
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2787
Location: Belgium / Liège

PostPosted: Sun Jan 03, 2010 5:29 pm    Post subject: Reply with quote

k-root wrote:
xvid ? :? ... h264 c`est mieux :wink:



c'est pour pouvoir lire la vidéo sur une platine dvd/divx qui fait pas la hd ;)


EDIT:

et je voulais utilié les "q*" pour ne pas entrer trop dans les valeurs numérique vu que les video que je récupère seront soit de mauvaise, soit de bonne qualité ; je veux donc juste les convertir vers une qualité potable, mais format mp4 plus standard pour les simples platine dvd/divx ...
_________________
Mon MediaWiki perso : http://pix-mania.dyndns.org
Back to top
View user's profile Send private message
k-root
Guru
Guru


Joined: 08 Jan 2005
Posts: 428

PostPosted: Sun Jan 03, 2010 5:43 pm    Post subject: Reply with quote

pt-etre plus simplement avec transcode:

Code:
transcode -i $i -o $i.xvid -y xvid


edit : http://www.transcoding.org/transcode?Encoding_For_YouTube
_________________
boozo wrote:
Gentoo, ça mange des ours et baffe des buffles par 37°C avec un bob et des tongs
Back to top
View user's profile Send private message
loopx
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2787
Location: Belgium / Liège

PostPosted: Sun Jan 03, 2010 6:08 pm    Post subject: Reply with quote

k-root wrote:
pt-etre plus simplement avec transcode:

Code:
transcode -i $i -o $i.xvid -y xvid


edit : http://www.transcoding.org/transcode?Encoding_For_YouTube



C'est pas gagné ...
Code:

loopx@loop ~ $ transcode -i t6wrEPodMI0.flv -o test.avi -y xvid
transcode v1.1.5 (C) 2001-2003 Thomas Oestreich, 2003-2009 Transcode Team
libdvdread: Using libdvdcss version 1.2.10 for DVD access
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
[probe_ffmpeg.c] critical: unable to open 't6wrEPodMI0.flv' (libavformat failure)
[transcode] V: auto-probing     | t6wrEPodMI0.flv (FAILED)
[transcode] V: import format    | (null) in  (module=null)
[transcode] A: auto-probing     | t6wrEPodMI0.flv (FAILED)
[transcode] A: import format    | AC3 in  (module=null)
[transcode] V: AV demux/sync    | (1) sync AV at initial MPEG sequence
[transcode] V: import frame     | 720x576  1.25:1  encoded @ UNKNOWN
[transcode] V: bits/pixel       | 0.174
[transcode] V: decoding fps,frc | 25.000,0
[transcode] V: video format     | YUV420 (4:2:0) aka I420
[transcode] A: import format    | 0x2000  AC3          [48000,16,2]
[transcode] A: export format    | 0x55    MPEG ES Layer 3 [48000,16,2]  128 kbps
[transcode] V: export format    | unknown (module dependant)
[transcode] V: encoding fps,frc | 25.000,3
[transcode] A: bytes per frame  | 7680 (7680.000000)
[transcode] A: adjustment       | 0@1000
[transcode] V: IA32/AMD64 accel | sse2 sse mmx cmove asm
[transcode] V: video buffer     | 10 @ 720x576 [0x2]
[transcode] A: audio buffer     | 10 @ 48000x2x16
[import_null.so] v0.2.0 (2002-01-19) (video) null | (audio) null
[export_xvid4.so] v0.0.6 (2007-08-11) (video) XviD 1.0.x series (aka API 4.0) | (audio) MPEG/AC3/PCM
[export_xvid4.so] warning: Error opening configuration file ./xvid4.cfg: No such file or directory
[transcode] Audio: using lame-3.98.2
[export_xvid4.so] warning: Usage of this module for audio encoding is deprecated.
[export_xvid4.so] warning: Consider switch to export_tcaud module.
[encoder.c] Delaying audio



EDIT: lol, il s'arrete pas d'encoder .. c'est une vidéo vide, vu qu'il arrive ni a ouvrir le son, ni la video :D
_________________
Mon MediaWiki perso : http://pix-mania.dyndns.org
Back to top
View user's profile Send private message
k-root
Guru
Guru


Joined: 08 Jan 2005
Posts: 428

PostPosted: Sun Jan 03, 2010 6:23 pm    Post subject: Reply with quote

Code:
ffmpeg -i $i  -sameq /tmp/pre-$i.mov
transcode -i /tmp/pre-$i.mov -o $i.xvid -y xvid


:roll:
_________________
boozo wrote:
Gentoo, ça mange des ours et baffe des buffles par 37°C avec un bob et des tongs
Back to top
View user's profile Send private message
loopx
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2787
Location: Belgium / Liège

PostPosted: Sun Jan 03, 2010 6:43 pm    Post subject: Reply with quote

Code:
loopx@loop ~ $ ffmpeg -i t6wrEPodMI0.flv -acodec libmp3lame -ab 192k -vcodec libxvid -sameq -vtag XVID -f avi test.avi
FFmpeg version SVN-r20373, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  built on Jan  2 2010 17:12:44 with gcc 4.4.2
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-static --enable-shared --cc=i686-pc-linux-gnu-gcc --disable-debug --disable-ffplay --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libxvid --disable-indev=v4l2 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-x11grab --enable-pthreads --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-libopenjpeg --disable-vdpau --disable-vdpau --disable-ssse3 --disable-altivec --disable-amd3dnow --cpu=pentium4 --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-avfilter-lavf --disable-stripping --enable-hardcoded-tables
  libavutil     50. 3. 0 / 50. 3. 0
  libavcodec    52.37. 1 / 52.37. 1
  libavformat   52.39. 2 / 52.39. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libavfilter    1. 4. 1 /  1. 4. 1
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.92 (359/12)
Input #0, flv, from 't6wrEPodMI0.flv':
  Duration: 00:03:49.26, start: 0.000000, bitrate: 255 kb/s
    Stream #0.0: Video: flv, yuv420p, 320x240, 247 kb/s, 29.92 tbr, 1k tbn, 1k tbc
    Stream #0.1: Audio: mp3, 22050 Hz, 2 channels, s16, 8 kb/s
  Metadata
    duration        : 229
    starttime       : 0
    totalduration   : 229
    width           : 320
    height          : 240
    videodatarate   : 241
    audiodatarate   : 59
    totaldatarate   : 308
    framerate       : 30
    bytelength      : 8841049
    canseekontime   : true
    sourcedata      : B4A7D6902HH
    purl            :
    pmsg            :
File 'test.avi' already exists. Overwrite ? [y/N] y
Output #0, avi, to 'test.avi':
    Stream #0.0: Video: libxvid, yuv420p, 320x240, q=2-31, 200 kb/s, 29.92 tbn, 29.92 tbc
    Stream #0.1: Audio: libmp3lame, 22050 Hz, 2 channels, s16, 192 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[libxvid @ 0xa040d20]Invalid pixel aspect ratio 0/1
Video encoding failed

:(


EDIT: étrange cette histoire d'aspect ratio, j'avais pas ce problème avec les autres "qscale" ... Et, ce serait bien de faire du 2 pass ? Faudrait que je test, mais j'ai po les paramtères en tete, vais essayer de résoudre le problèem d'aspect ratio ..
_________________
Mon MediaWiki perso : http://pix-mania.dyndns.org
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum