check https://linuxfr.org/~touv/27063.html [fr] ffmpegtotheora ffmpeg to theora xvid avi project-x Avidemux_qt4
goal : convert a video using AVI/xvid to Ogg / Theora / Vorbis to reduce the size of the video keeping a good format
the video : 140 MB from http://www.rmll.info/article434.html Xvid avi 200Kbps available at Internet libre ou minitel 2.0 (TuxFamily)
First test of ffmpeg2theora
mplayer informationPlaying 0434_Bayart_Internet_libre_ou_Minitel_2.0.avi. AVI file format detected. VIDEO: [XVID] 720x576 12bpp 25.000 fps 1027.5 kbps (125.4 kbyte/s) Clip info: Software: MEncoder dev-SVN-rUNKNOWN-4.1.2 Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4) ========================================================================== ========================================================================== Trying to force audio codec driver family libmad... Opening audio decoder: [libmad] libmad mpeg audio decoder AUDIO: 48000 Hz, 2 ch, s16le, 32.0 kbit/2.08% (ratio: 4000->192000) Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3) ========================================================================== AO: [oss] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12) VDec: using Planar YV12 as output csp (no 0) Movie-Aspect is 1.25:1 - prescaling to correct movie aspect. VO: [xv] 720x576 => 720x576 Planar YV12 [zoom]
using ffmpeg2theora is a simple as http://v2v.cc/~j/ffmpeg2theora/examples.html and http://trac.v2v.cc/wiki/FFmpeg2TheoraUsage
ffmpeg2theora 0434_Bayart_Internet_libre_ou_Minitel_2.0.avi
Input #0, avi, from '0434_Bayart_Internet_libre_ou_Minitel_2.0.avi': Duration: 01:04:17.1, start: 0.000000, bitrate: 210 kb/s Stream #0.0: Video: mpeg4, yuv420p, 720x576, 25.00 fps(r) Stream #0.1: Audio: mp3, 48000 Hz, stereo, 32 kb/s Pixel Aspect Ratio: 1.00/1 Frame Aspect Ratio: 1.25/1 Resize: 720x576 0:02:52.00 audio: 66kbps video: 541kbps, time remaining: 00:30:42 0:11:32.44 audio: 67kbps video: 555kbps, time remaining: 00:26:53 [mpeg4 @ 0x2ab1ac489850]concealing 628 DC, 628 AC, 628 MV errors 0:11:33.14 audio: 67kbps video: 555kbps, time remaining: 00:26:51
7 minutes to do the conversion, resulting file : 52 MB
[Ogg] stream 0: video (Theora v3.2.0), -vid 0 [Ogg] stream 1: audio (Vorbis), -aid 0 Ogg file format detected. VIDEO: [theo] 720x576 24bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s) ========================================================================== Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family [theora @ 0xdb6950]Missing extradata! Could not open codec. VDecoder init failed :( Opening video decoder: [theora] Theora/VP3 VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12) VDec: using Planar YV12 as output csp (no 0) Movie-Aspect is 1.25:1 - prescaling to correct movie aspect. VO: [xv] 720x576 => 720x576 Planar YV12 [zoom] Selected video codec: [theora] vfm: theora (Theora (free, reworked VP3)) ========================================================================== ========================================================================== Trying to force audio codec driver family libmad... Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders AUDIO: 48000 Hz, 2 ch, s16le, 80.0 kbit/5.21% (ratio: 10000->192000) Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis decoder) ========================================================================== AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
second test with ffmpeg2theora
With a non free flux (in mpegts) I wanted to extract a portion of the video but encountered several problems- perhaps the original is interlaced ? vlc would not give any timer, totem seems to give a timer divided by 2, smplayer does not detect the accurate end of the file (change of format in the middle), though the value for effective time seems more accurate
- first test with both beginning and end clipping ffmpeg2theora -s 318 -e 1836 file.ts # the beginning does not seem taken into account and the end value is too short by approximately half the effective duration in the original file (as given by totem)
- second test without cliping the beginning ffmpeg2theora -e 3685 file.ts # the end timer seems accurately given by smplayer
- begun at 14h20 first intermediate timing at 11 mn encoded in 18 mn o_O ETA 99 mn hence 15h59
- end at 15h55
- strange : orginal format seems 16:9, the encoded video is displayed in 4:3 in smplayer (people are less fat :D), there seems to be a little shift in the audio too (maybe an option sync is needed with ffmpeg2theora)
third test with ffmpeg2theora
Toujours avec un flux .ts (récupéré de la Freebox / Arte bas débit), il y a un décalage du son assez vite. Cela semble être un problème "connu"- http://forum.ubuntu-fr.org/viewtopic.php?id=126833 [fr] décalage du son, conversion intermédiaire du .ts en MPEG (avec tovid), lien vers tuto intéressant
- http://forum.hardware.fr/hfr/OSAlternatifs/Multimedia/conversion-video-divx-sujet_61731_1.htm [fr] tutoriel avec de bonnes explications
1/ récupération du .ts grâce a mon décodeur TNT et découpe de celui-ci (avec kino ou autre)
2/ Projet-x pour séparer audio et vidéo (http://sourceforge.net/projects/project-x) (uniquement en archive .jar ?)
3/ Compression de la vidéo avec ffmpeg2theora en Theora
4/ Compression de l'audio avec mp32ogg en Vorbis
5/ mettre le flux vidéo et audio dans un même fichier .ogg (avec tuxrip)