Playing generation 202 sheep on Linux client

Hi!

After a long pause (and a switch from Windows to Linux) I wanted to install the Electric Sheep screensaver again. I still have about 36 GB of generation 202 sheep and would like to play them read-only rather than downloading tens of GB of new generation sheep.

As I understand from the source code, the Linux client browses the cache directory for avi files and sort of concatenates the frames to a huge avi file piped to an mplayer process. I don't see any direct dependency on the x264 codec. Wouldn't it be possible to transform the generation 202 mpg files to avi files which use the MPEG-2 codec instead of the x264 codec and then use the existing client to display them? Did anybody try this yet or does anybody have a clue on how to do this?

If it worked, it would allow one to mix the 202 flock with the new generations, just like you can already have generation 243 and 244 mixed in your flock - there wouldn't be any transitions between the different generations, but any time the screensaver starts it would pick a starting point in one of the generations so you can enjoy them all.

So, any ideas on whether a conversion could work and on how to convert the files?

Best regards!

Partly solved

First success: Using VLC, I transformed one of the old mpg sheep into an avi file without recompression (just chose AVI as the container, and told it to copy the original video stream). electricsheep --read-only 1 --standalone 1 --parasite 1 opened an mplayer window which looped the sheep.

Now I just need to automate that transformation to convert my whole 202 flock in-place and it should be fine. I'll cope with that later and post my solution here.

/edit: As the VLC converted files were not playable by Totem, I thought I'd better convert them using a different tool. ffmpeg -i xyz.mpg -vcodec copy xyz.avi produced files playable with both Totem and mplayer, which seemed to be an improvement over the VLC conversion, but then electricsheep could not read the files ("av_interleaved_write_frame: Invalid format").
So I reverted to VLC. for file in *.mpg; do vlc -I dummy $file :sout='#transcode{acodec=none}:duplicate{dst=std{access=file,mux=avi,dst="'${file%.mpg}.avi'"}}' vlc://quit; done converts all mpg files in the current directory to avi files (for mass conversion, find will be a better solution, but I'm still just experimenting). I did this to a folder of 23 files and started electricsheep again. It basically works, but for the loops there seems to be a fraction of a second missing (the animation jumps), and for edges there are ugly mpeg artifacts as if there were missing I-frames.

If there is anybody else interested in mixing old 202 and new 234/244 sheep in his/her client, please feel free to follow the steps I've taken and experiment further to get better results. For now I will give up and rather try to get an old client version to work, which will at least allow me to watch 202 sheep.

i am pretty sure the client

i am pretty sure the client depends on the sheep having the same codec and resolution, so just repackaging won't work. but if you re-encode them to the same format, it should be fine.

Same codec and resolution

Thanks for your comment. When I transformed the 202 sheep to avi files, the codec and resolution remained the same for all sheep (640x480 MPEG-2), still there were artifacts. Either the files got broken in the conversion process, or the client's method of feeding them to the mplayer process is not suitable for MPEG-2 in avi containers.

/update: It's both. Concatenating files and playing them with mplayer gave the following results:
  • original mpg: seamless loop
  • avi created by vlc: loop jumps (part is missing)
  • avi created by ffmpeg: loop is stuttering (slight delay where the loop repeats)
So the artifacts I saw are caused by vlc not converting the files properly. The files converted by ffmpeg are probably okay (unlike concatenated mpgs, concatenated avi files are ill-formatted, which would explain the delay), but the electricsheep client does not play them. I guess this could be fixed in the client (function copy_out_file in electricsheep.c), but I don't have the time to try that in the near future.

If this is fixed, having 202 sheep (MPEG-2) and 244 sheep (x264) together in one flock shouldn't pose additional problems, as there are no edges between them. As I understand, the screensaver would stay in whatever generation it happened to start, so mixing formats would not hurt.

User login