more adventures in video encoding / the incapabilities of ffmpeg

August 5, 2009 at 15:49 | Posted in Adventures | Leave a comment
Tags: , , , , , ,

So. I went back and used this post to try to convert Haibane Renmei into rockbox format. The difference being, Lain is in .avi format, and Haibane Renmei is in an .mkv container. I used the script from lain, and got no subtitles. There is no subtitle extracting argument for ffmpeg encoding. So, mencoder, here we go. I need a 320×240 mpeg2 video.

Okay, mencoder FAILS AT ENCODING ANYTHING.

First extracting subs from mkv container with mkvtoolnix:

mkvextract tracks Haibane\ Renmei\ 01* 3:1.srt

Using mencoder to add subs:

mencoder Haibane*\ 01\ * -sub 1.srt -oac mp3lame -ovc lavc -of mpeg -noskip -vf harddup -o menc-h01.mpg

which produces an unsupported format for rockbox, and something only playable in mplayer. Next, reformat it with ffpeg:

ffmpeg -i menc-h01.mpg -acodec libmp3lame -vcodec mpeg2video -s 320×240 -b 1200kb ff1.mpg

I had to downgrade to lame 3.97 first, however, because otherwise it’s choppy as fuck due to buffer problems.

The output from mencoder is smooth, but the final output from ffmpeg is choppy, seeming no matter what I do. So, fuck it, I’ll live with choppy video.

edit – okay fuck it seriously. the audio and video are horribly out of sync. fuck motherfucking ffmpeg, fuck mencoder. I don’t need videos on my POS ipod.

Using ffmpeg to convert anime episodes to ipod format :3

March 19, 2009 at 16:45 | Posted in Adventures | 1 Comment
Tags: , , , ,

First, the plugs.

then I did

$ ffmpeg -i [KAA]_Serial_Experiments_Lain_11.DVD[6437FD7E].avi -acodec libfaac -vcodec mpeg4 -s 320×180 -title lain -r 25 lain11.mp4

but the subtitles were cut off the bottom for some reason even though the input file was 640×480 v_v And I needeth teh subtitles, so let’s get that fixed… now doing:

$ time { ffmpeg -i [KAA]_Serial_Experiments_Lain_11.DVD[6437FD7E].avi -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 320×240 -r 25 lain11.mp4; }

oh my god I just realised I didn’t change the 180 in that command to 240. okay that’s my problem there, stupid. this one should turn out fine, with possibly higher quality, and in a time bracket so I’ll know how long exactly the encoding takes. Almost 39k frames.

Oh, so before this I had to install lame, x264, yasm, xvidcore, and ffmpeg, lmao. Just to get ffmpeg to compile. It looked like I had some version of ffmpeg installed already, but it was fucked and wouldn’t work or do shit, so obviously I reinstalled it.

frame=35862 fps= 47 q=2.0 Lsize= 204247kB time=1434.48 bitrate=1166.4kbits/s
video:180889kB audio:22535kB global headers:0kB muxing overhead 0.404186%

real 12m36.655s

cool. 12m to encode. 200MB. 3m to transfer to the ipod. five episodes would make a gig, and i have 12 free gigs… five times twelve means i can put 60 episodes this size onto the ipod lmao. 60 times 25m episodes equals 1500m of anime. 1500m=25 hours of anime. surely enough to keep me awake and entertained on the van to school.

… cool story bro. mp4 is an unsupported format for the mpegplayer on rockbox xD. oh well, I’ll try AGAIN using mpg.

12 minutes is too long to wait for though, so I’ll do series in batches with shell scripts while I’m sleeping, and then have them transfer themselves onto the ipod before I wake up.

Great. Found out here that the player only plays mpeg1-2 video codecs, not mpeg4. So, stopped the encoding half-way through and changed the codec to ‘mpeg2video’.

GREAT. THE SOUND IS FUCKED UP. WTF REENCODING AGAIN WITH ‘libmp3lame’ CODEC.

success.

$ time { ffmpeg -i [KAA]_Serial_Experiments_Lain_11.DVD[6437FD7E].avi -acodec libmp3lame -ab 128kb -vcodec mpeg2video -b 1200kb -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 320×240 -r 25 lain11.mpg; }

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.

Follow

Get every new post delivered to your Inbox.