[gnome-getting-started-docs] Use open codecs only



commit 1d50e90c907e0020a1e2f85d53a21574bdb050d2
Author: Jakub Steiner <jimmac gmail com>
Date:   Thu Jan 3 13:57:05 2013 +0100

    Use open codecs only
    
    - render pipeline consists of still frames (PNG) + flac mixdown
    - gstreamer 1.0 used to transcode and mux into vp8,vorbis webm
    - only changing-wallpaper converted for now.
    - regular non-ffmpeg packaged blend can be used. opens a window to
      render at buildtime (allowing more freedom for translations)

 animation/gnome-change-wallpaper.blend       |  Bin 1482796 -> 1479408 bytes
 animation/gnome-change-wallpaper.py          |   31 +++++++++++++++++++++-----
 animation/gnome-responding-to-messages.blend |  Bin 2672564 -> 2667816 bytes
 animation/gnome-windows-and-workspaces.blend |  Bin 2821052 -> 2821052 bytes
 getting-started/C/change-wallpaper.page      |    2 +-
 5 files changed, 26 insertions(+), 7 deletions(-)
---
diff --git a/animation/gnome-change-wallpaper.blend b/animation/gnome-change-wallpaper.blend
index 3e994cb..e620ff7 100644
Binary files a/animation/gnome-change-wallpaper.blend and b/animation/gnome-change-wallpaper.blend differ
diff --git a/animation/gnome-change-wallpaper.py b/animation/gnome-change-wallpaper.py
index bcba174..60a4853 100644
--- a/animation/gnome-change-wallpaper.py
+++ b/animation/gnome-change-wallpaper.py
@@ -1,26 +1,44 @@
 import bpy,os,re
 from xml.etree import ElementTree as ET
 
+ 
 def render(lang):
+  global renderpath
+  
   #bpy.context.scene.render.resolution_percentage =
   #bpy.context.scene.render.use_compositing = 0
   bpy.context.scene.render.use_sequencer = 1
   renderpath = '//sequence/'+lang
+  sndfile = renderpath+'/snd/snd.flac'
   if (not renderpath):
     os.mkdir(renderpath)
-  bpy.context.scene.render.filepath = "//" + renderpath + '/changing-wallpaper-'
+  if (not renderpath+'/snd'):
+    os.mkdir(renderpath+'/snd')
+  regexobj = re.search(r"^(.*\/)*(.*)(\.blend)$", bpy.data.filepath)
+  bpy.context.scene.render.filepath = "%s/%s/" % (renderpath,regexobj.group(2))
   if (not os.path.isfile(bpy.context.scene.render.frame_path())):
     bpy.ops.render.render(animation=True)
+    bpy.ops.sound.mixdown(filepath=sndfile)
   else:
     print('already rendered',bpy.context.scene.render.frame_path())
-  transcodepath = "../getting-started/" + lang + "/figures/"
-  regexobj = re.search(r"^(.*\/)(.*)-(\d*)-(\d*)(\.avi)$", bpy.context.scene.render.frame_path())
-  webmfile = regexobj.group(2) + ".webm"
-  transcodecmd = "ffmpeg -y -i " + bpy.context.scene.render.frame_path() + " -b:v 8000k " + transcodepath + webmfile
+
+def transcode(lang):
+  global renderpath
+  #FIXME
+  #theora gst-launch-1.0 oggmux name=mux ! filesink location="../video.webm"    file:///home/jimmac/src/git/gnome/gnome-getting-started-docs/animation/sequence/C/changing-wallpaper/snd/test.flac ! decodebin ! audioconvert ! vorbisenc ! mux.     multifilesrc location="/home/jimmac/src/git/gnome/gnome-getting-started-docs/animation/sequence/C/changing-wallpaper/%04d.png" index=1 caps="image/png,framerate=\(fraction\)25/1" ! pngdec ! videoconvert ! videorate ! theoraenc ! mux.
+  #webm gst-launch-1.0 webmmux name=mux ! filesink location="../video.webm"    file:///home/jimmac/src/git/gnome/gnome-getting-started-docs/animation/sequence/C/changing-wallpaper/snd/test.flac ! decodebin ! audioconvert ! vorbisenc ! mux.     multifilesrc location="/home/jimmac/src/git/gnome/gnome-getting-started-docs/animation/sequence/C/changing-wallpaper/%04d.png" index=1 caps="image/png,framerate=\(fraction\)25/1" ! pngdec ! videoconvert ! videoscale ! videorate ! vp8enc threads=4 ! mux.
+  regexobj = re.search(r"^(.*\/)*(.*)(\.blend)$", bpy.data.filepath)
+  framepath = "%ssequence/%s/%s" % (regexobj.group(1),lang,regexobj.group(2))
+  webmfile = "%s.webm" % (regexobj.group(2))
+  sndfile = "%ssequence/%s/%s/snd/snd.flac" % (regexobj.group(1),lang,regexobj.group(2))
+  transcodepath = "../getting-started/%s/figures/" % (lang)
+  
+  #print(transcodepath,webmfile,sndfile,framepath)
+  transcodecmd = "gst-launch-1.0 webmmux name=mux ! filesink location=\"%s/%s\"    file://%s ! decodebin ! audioconvert ! vorbisenc ! mux.     multifilesrc location=\"%s/%%04d.png\" index=1 caps=\"image/png,framerate=\(fraction\)25/1\" ! pngdec ! videoconvert ! videoscale ! videorate ! vp8enc threads=4 ! mux." % (transcodepath,webmfile,sndfile,framepath)
   if (not os.path.isfile(transcodepath+webmfile)):
     os.system(transcodecmd)
   else:
-    print('already transcoded',transcodepath + webmfile)
+    print('already transcoded',transcodepath + webmfile)  
   
 #translates strings and calls render
 def main():
@@ -39,6 +57,7 @@ def main():
         bpy.data.objects[textobj.get('id')].data.body = textobj.text
     bpy.data.objects['usermenuuser'].data.body = bpy.data.objects['user'].data.body #due to different alignment
     render(lang)
+    transcode(lang)
     
 if __name__ == '__main__':
     main()
diff --git a/animation/gnome-responding-to-messages.blend b/animation/gnome-responding-to-messages.blend
index 8822060..8cb8744 100644
Binary files a/animation/gnome-responding-to-messages.blend and b/animation/gnome-responding-to-messages.blend differ
diff --git a/animation/gnome-windows-and-workspaces.blend b/animation/gnome-windows-and-workspaces.blend
index d87ee51..d5a28c0 100644
Binary files a/animation/gnome-windows-and-workspaces.blend and b/animation/gnome-windows-and-workspaces.blend differ
diff --git a/getting-started/C/change-wallpaper.page b/getting-started/C/change-wallpaper.page
index dea5c9a..9d36943 100644
--- a/getting-started/C/change-wallpaper.page
+++ b/getting-started/C/change-wallpaper.page
@@ -18,7 +18,7 @@
 
   <title>Change the wallpaper</title>
 
-  <media type="video" src="figures/changing-wallpaper.webm" width="840" height="468">
+  <media type="video" src="figures/gnome-change-wallpaper.webm" width="840" height="468">
     <media type="image" style="poster" src="figures/changing-wallpaper.png"/>
   </media>
   



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]