Recherche avancée

Médias (91)

Autres articles (89)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (10574)

  • Alfresco Content transformation from .avi to *.flv using ffmpeg

    25 octobre 2011, par Masanchez

    I'm trying to transform diferents video formats into .flv in Alfresco
    I'm using 'ffmpeg' tool to transform content.
    My code :
    avi2flv-transform-context.xml

    <?xml version='1.0' encoding='UTF-8'?>

    <beans>
       <bean class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">
           <property>
               <ref bean="mimetypeService"></ref>
           </property>
           <property>
               <bean class="org.alfresco.util.exec.RuntimeExec">
                   <property>
                       <map>
                           <entry key=".*">
                               <list>
                                   <value>ffmpeg</value>
                                   <value>-version</value>
                               </list>
                           </entry>
                       </map>
                   </property>
                   <property>
                       <value>1</value>
                   </property>
               </bean>
           </property>
           <property>
               <bean class="org.alfresco.util.exec.RuntimeExec">
                   <property>
                       <map>
                           <entry key="Linux">
                               <value>ffmpeg -i &#39;${target}&#39; ${flv.encoder.params} &#39;${source}&#39;</value>
                           </entry>
                       </map>
                   </property>
                   <property>
                       <value>1,2</value>
                   </property>
                   <property>
                       <value>true</value>
                   </property>
                   <property>
                       <props>
                           <prop key="flv.encoder.params">-vcodec flv</prop>
                       </props>
                   </property>
               </bean>
           </property>
           <property>
               <list>
    <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/avi</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/x-msvideo</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/mpeg</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/mp4</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/mpeg2</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/x-sgi-movie</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/quicktime</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/x-ms-asf</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/x-ms-wmv</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/x-rad-screenplay</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/ogg</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
               </list>
           </property>
       </bean>
       <bean class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
           <property>
               <ref bean="transformer.ffmpeg.avi.worker"></ref>
           </property>
       </bean>
    </beans>

    webservice :

    if(getFile(folderVIDEO, field.filename) == null)
    {
                               if(file_test_node=folderVIDEO.createFile(nombrefichero+field.filename)){
                                   model.mensajes.push(&#39;Se ha creado el fichero &#39;+nombrefichero+field.filename);
                               }else
                                   model.mensajes.push(&#39;Ha ocurrido un error cuando se intentaba crear el fichero &#39;+nombrefichero+field.filename);
                               file_test_node.properties.content.write(field.content);
                               folderVIDEO = getFolder(search.findNode("workspace://SpacesStore/"+fondoid),nameFolderVIDEO);
                               var action = actions.create("transform");
                               // Store the transformed version in the same folder as the source
                               action.parameters["destination-folder"] = file_test_node.parent;
                               action.parameters["assoc-type"] = "{http://www.alfresco.org/model/content/1.0}contains";
                               action.parameters["assoc-name"] = file_test_node.name + "transformed";
                               action.parameters["mime-type"] = "video/x-flv";
                               // Execute
                               action.execute(file_test_node);
                           }

    The error

    The Web Script /alfresco/s/gcd/fondo has responded with a status of 500 - Internal Error.

    500 Description:     An error inside the HTTP server which prevented it from fulfilling the request.

    Message:    09180016 Wrapped Exception (with status template): 09180029 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/creado.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09180028 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/18/20/56/65b3457f-c37c-4404-b4b7-9abac30f018d.bin, mimetype=video/x-msvideo, size=1614694, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/18/20/56/e92d00e2-7bd8-4bdd-8d50-b61fe4bac903.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@745ce55


    Exception:  org.alfresco.service.cmr.repository.ContentIOException - 09180027 Transformation failed - status indicates an error: Execution result: os: Linux command: [ffmpeg, -i, &#39;/home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_target_3008293789769608319.flv&#39;, -vcodec flv, &#39;/home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_source_5021918644492976031.avi&#39;] succeeded: false exit code: 1 out: err: FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.2, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --extra-version=4:0.5.1-1ubuntu1.2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --e



    org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker.transform(RuntimeExecutableContentTransformerWorker.java:272)

    org.alfresco.repo.content.transform.ProxyContentTransformer.transformInternal(ProxyContentTransformer.java:68)

    org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:161)

    org.alfresco.repo.content.ContentServiceImpl.transform(ContentServiceImpl.java:555)

    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    java.lang.reflect.Method.invoke(Method.java:597)

    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)

    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

    net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.alfresco.repo.model.ml.MLContentInterceptor.invoke(MLContentInterceptor.java:125)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:44)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:160)

    org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:137)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

    $Proxy42.transform(Unknown Source)

    org.alfresco.repo.action.executer.TransformActionExecuter.doTransform(TransformActionExecuter.java:305)

    org.alfresco.repo.action.executer.TransformActionExecuter.executeImpl(TransformActionExecuter.java:270)

    org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:133)

    org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:749)

    org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:675)

    org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:540)

    org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:526)

    org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:758)

    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    java.lang.reflect.Method.invoke(Method.java:597)

    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)

    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

    org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:44)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.alfresco.repo.audit.AuditMethodInterceptor.proceedWithAudit(AuditMethodInterceptor.java:217)

    org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:184)

    org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:137)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

    $Proxy34.executeAction(Unknown Source)

    org.alfresco.repo.jscript.ScriptAction.executeImpl(ScriptAction.java:147)

    org.alfresco.repo.jscript.ScriptAction.execute(ScriptAction.java:136)

    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    java.lang.reflect.Method.invoke(Method.java:597)

    org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)

    org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)

    org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)

    org.mozilla.javascript.gen.c59._c9(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js:459)

    org.mozilla.javascript.gen.c59.call(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js)

    org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)

    org.mozilla.javascript.gen.c59._c0(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js:271)

    org.mozilla.javascript.gen.c59.call(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js)

    org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)

    org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)

    org.mozilla.javascript.gen.c59.call(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js)

    org.mozilla.javascript.gen.c59.exec(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js)

    org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:472)

    org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:190)

    org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:282)

    org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)

    org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:981)

    org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)

    org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:383)

    org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)

    org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)

    org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)

    org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)

    org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)

    org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)

    org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)

    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

    java.lang.Thread.run(Thread.java:619)


    Exception:  org.alfresco.service.cmr.repository.ContentIOException - 09180028 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/18/20/56/65b3457f-c37c-4404-b4b7-9abac30f018d.bin, mimetype=video/x-msvideo, size=1614694, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/18/20/56/e92d00e2-7bd8-4bdd-8d50-b61fe4bac903.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@745ce55



    org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:177)


    Exception:  org.alfresco.scripts.ScriptException - 09180029 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/creado.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09180028 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/18/20/56/65b3457f-c37c-4404-b4b7-9abac30f018d.bin, mimetype=video/x-msvideo, size=1614694, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/18/20/56/e92d00e2-7bd8-4bdd-8d50-b61fe4bac903.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@745ce55



    org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:194)


    Exception:  org.springframework.extensions.webscripts.WebScriptException - 09180016 Wrapped Exception (with status template): 09180029 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/creado.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09180028 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/18/20/56/65b3457f-c37c-4404-b4b7-9abac30f018d.bin, mimetype=video/x-msvideo, size=1614694, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/18/20/56/e92d00e2-7bd8-4bdd-8d50-b61fe4bac903.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@745ce55



    org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:758)


    Server: Community v3.4.0 (c 3335) schema 4,113
    Time:   Oct 18, 2011 8:56:51 PM


    Diagnostics:    Inspect Web Script (com/inventiaplus/gcd/fondo/creado.post)

    I don't know where is the problem
    Somebody can help me ?

    I did some changes...

    avi2flv-transform-context.xml :

    <entry key="Linux">
           <value>ffmpeg -y -i &#39;${target}&#39; ${flv.encoder.params} &#39;${source}&#39;</value>
    </entry>

    Source <-> Target

    <props>
       <prop key="flv.encoder.params">-threads 2 -s 320x240 -r 29.97 -threads 1 -pix_fmt yuv420p -g 300 -qmin 3 -b 512k -async 50 -ar 44100 -ac 2 -ab 128k</prop>
    </props>

    change parameters

    error :

    The Web Script /alfresco/s/gcd/fondo/9fe0bf90-1875-4f51-9f75-7c35f6d0802c has responded with a status of 500 - Internal Error.

    500 Description:    An error inside the HTTP server which prevented it from fulfilling the request.

    Message:    09250001 Wrapped Exception (with status template): 09250004 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/guardar.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09250003 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/25/8/27/efff7050-3a67-492d-9e5b-507c03bd0a80.bin, mimetype=video/x-msvideo, size=256362496, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/25/8/28/cb81b7f2-3c72-4266-afd7-0d1a3fb9f420.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@18c4074f

    Exception:  org.alfresco.service.cmr.repository.ContentIOException - 09250002 Transformation failed - status indicates an error: Execution result: os: Linux command: [ffmpeg, -y, -i, &#39;/home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_target_4598080275234396407.flv&#39;, -threads 2 -s 320x240 -r 29.97 -threads 1 -pix_fmt yuv420p -g 300 -qmin 3 -b 512k -async 50 -ar 44100 -ac 2 -ab 128k, &#39;/home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_source_6538382831295915428.avi&#39;] succeeded: false exit code: 1 out: err: FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.2, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --extra-version=4:0.5.1-1ubuntu1.2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --e

       ...

    Exception:  org.alfresco.service.cmr.repository.ContentIOException - 09250003 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/25/8/27/efff7050-3a67-492d-9e5b-507c03bd0a80.bin, mimetype=video/x-msvideo, size=256362496, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/25/8/28/cb81b7f2-3c72-4266-afd7-0d1a3fb9f420.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@18c4074f

       org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:177)

    Exception:  org.alfresco.scripts.ScriptException - 09250004 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/guardar.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09250003 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/25/8/27/efff7050-3a67-492d-9e5b-507c03bd0a80.bin, mimetype=video/x-msvideo, size=256362496, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/25/8/28/cb81b7f2-3c72-4266-afd7-0d1a3fb9f420.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@18c4074f

       org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:194)

    Exception:  org.springframework.extensions.webscripts.WebScriptException - 09250001 Wrapped Exception (with status template): 09250004 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/guardar.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09250003 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/25/8/27/efff7050-3a67-492d-9e5b-507c03bd0a80.bin, mimetype=video/x-msvideo, size=256362496, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/25/8/28/cb81b7f2-3c72-4266-afd7-0d1a3fb9f420.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@18c4074f

       org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:758)

    Server: Community v3.4.0 (c 3335) schema 4,113
    Time:   Oct 25, 2011 8:28:29 AM

    I use command line

    ffmpeg -y -i /home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_source_6538382831295915428.avi -threads 2 -s 320x240 -r 29.97 -threads 1 -pix_fmt yuv420p -g 300 -qmin 3 -b 512k -async 50 -ar 44100 -ac 2 -ab 128k /home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_target_4598080275234396407.flv

    and It works

  • Dumping and playing h264 bytestream from RTSP webcam

    18 octobre 2011, par thek

    My goal is to connect (rtsp) to camera, get h264 stream from rtp packages, save it as a bytestream to file and be able to play it (with ffplay or vlc). The only problem is that my result stream gives me errors (and a nice gray rectangle, sometimes with something moving - like only P frames are decoded) while playing.

    Here is my DESCRIBE response from rtsp server (ip replaced with ) :

       10:04:18.387 [New I/O client worker #1-1] INFO  rtsp.WebcamClientResponseHandler - Sending DESCRIBE request: DESCRIBE rtsp://<server>:<port>/channel1 RTSP/1.0
    -------status---------
    200 OK
    -------headers---------
    CSeq : 2
    Date : Wed, Jan 07 2009 19:05:09 GMT
    Content-Base : rtsp://<server>/channel1/
    Content-Type : application/sdp
    Content-Length : 433
    -------content---------
    v=0
    o=- 515949295799 1 IN IP4 <server>
    s=Session streamed by stream
    i=1
    t=0 0
    a=tool:LIVE555 Streaming Media v2009.01.26
    a=type:broadcast
    a=control:*
    a=range:npt=0-
    a=x-qt-text-nam:Session streamed by stream
    a=x-qt-text-inf:1
    m=video 0 RTP/AVP 96
    c=IN IP4 0.0.0.0
    b=AS:128
    a=rtpmap:96 H264/90000
    a=fmtp:96 packetization-mode=1;profile-level-id=420028;sprop-parameter-sets=Z0IAKOkCg/I=,aM44gA==
    a=control:tracks
    </server></server></port></server>

    And server sends me RTP packages with non IDR frames and fragmented (type=28) IDR frames. First ones are written to file, fragmented are unpacked.
    The result byte stream is :

    NAL SPS NAL PPS NAL FRAME1 NAL FRAME2 ... NAL FRAMEN

    where NAL is (hex) 00 00 01
    and SPS is (decoded Z0IAKOkCg/I= from sprop-parameter-sets): 67 42 00 28 e9 02 83 f2
    and PPS is (decoded aM44gA==): 68 ce 38 80

    I found similar topic with same steps taken :
    how-to-process-raw-udp-packets-so-that-they-can-be-decoded-by-a-decoder-filter-i
    but I can't see what am I missing.

    Could anyone give me some clue what may be wrong ?

    This is a link to generated h264 file :
    a.h264

    Below I'm attaching some more information from playing my stream.


    Playing my video with ffplay -f h264 a.h264 gives me following output (and a gray rectangle) :

    ffplay version 0.8.4-4:0.8.4-0ubuntu1~jon1, Copyright (c) 2003-2011 the FFmpeg developers
     built on Sep 25 2011 09:45:09 with gcc 4.4.3
     configuration: --extra-version=&#39;4:0.8.4-0ubuntu1~jon1&#39; --prefix=/usr --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
     libavutil    51.  9. 1 / 51.  9. 1
     libavcodec   53.  7. 0 / 53.  7. 0
     libavformat  53.  4. 0 / 53.  4. 0
     libavdevice  53.  1. 1 / 53.  1. 1
     libavfilter   2. 23. 0 /  2. 23. 0
     libswscale    2.  0. 0 /  2.  0. 0
     libpostproc  52.  0. 0 / 52.  0. 0
    [h264 @ 0x184d4c0] Missing reference picture
    [h264 @ 0x184d4c0] decode_slice_header error                                                                                                                                                                                                
    [h264 @ 0x184d4c0] concealing 300 DC, 300 AC, 300 MV errors                                                                                                                                                                                
    [h264 @ 0x1822640] max_analyze_duration 5000000 reached at 5000000
    [h264 @ 0x1822640] Estimating duration from bitrate, this may be inaccurate                                                                                                                                                                
    Input #0, h264, from &#39;a.h264&#39;:                                                                                                                                                                                                              
     Duration: N/A, bitrate: N/A
    Stream #0.0: Video: h264 (Baseline), yuv420p, 320x240, 25 fps, 25 tbr, 1200k tbn, 50 tbc
    [h264 @ 0x184d4c0] Missing reference pictureq=    3KB sq=    0B f=0/0  
    [h264 @ 0x184d4c0] decode_slice_header error                                                                                                                                                                                                
    [h264 @ 0x184d4c0] concealing 300 DC, 300 AC, 300 MV errors                                                                                                                                                                                
    [h264 @ 0x184d4c0] QP 4294967283 out of rangeKB sq=    0B f=0/0   0/0  
    [h264 @ 0x184d4c0] decode_slice_header error                                                                                                                                                                                                
    [h264 @ 0x184d4c0] concealing 300 DC, 300 AC, 300 MV errors                                                                                                                                                                                
    [h264 @ 0x184d4c0] Missing reference picture
    [h264 @ 0x184d4c0] decode_slice_header error                                                                                                                                                                                                
    [h264 @ 0x184d4c0] mmco: unref short failure                                                                                                                                                                                                
    [h264 @ 0x184d4c0] concealing 300 DC, 300 AC, 300 MV errors                                                                                                                                                                                
    [h264 @ 0x184d4c0] P sub_mb_type 5 out of range at 8 0
    [h264 @ 0x184d4c0] error while decoding MB 8 0                                                                                                                                                                                              
    [h264 @ 0x184d4c0] concealing 300 DC, 300 AC, 300 MV errors                                                                                                                                                                                
    [h264 @ 0x184d4c0] QP 4294967283 out of range
    [h264 @ 0x184d4c0] decode_slice_header error                                                                                                                                                                                                
    [h264 @ 0x184d4c0] concealing 300 DC, 300 AC, 300 MV errors

    Running h264_analyse (http://h264bitstream.sourceforge.net/) on my stream gives me :

    ./h264_analyze a.h264
    !! Found NAL at offset 3 (0x0003), size 8 (0x0008)
    ==================== NAL ====================
    forbidden_zero_bit : 0
    nal_ref_idc : 3
    nal_unit_type : 7 ( Sequence parameter set )
    ======= SPS =======
    profile_idc : 66
    constraint_set0_flag : 0
    constraint_set1_flag : 0
    constraint_set2_flag : 0
    constraint_set3_flag : 0
    reserved_zero_4bits : 0
    level_idc : 40
    seq_parameter_set_id : 0
    chroma_format_idc : 0
    residual_colour_transform_flag : 0
    bit_depth_luma_minus8 : 0
    bit_depth_chroma_minus8 : 0
    qpprime_y_zero_transform_bypass_flag : 0
    seq_scaling_matrix_present_flag : 0
    log2_max_frame_num_minus4 : 0
    pic_order_cnt_type : 0
     log2_max_pic_order_cnt_lsb_minus4 : 1
     delta_pic_order_always_zero_flag : 0
     offset_for_non_ref_pic : 0
     offset_for_top_to_bottom_field : 0
     num_ref_frames_in_pic_order_cnt_cycle : 0
    num_ref_frames : 1
    gaps_in_frame_num_value_allowed_flag : 0
    pic_width_in_mbs_minus1 : 19
    pic_height_in_map_units_minus1 : 14
    frame_mbs_only_flag : 1
    mb_adaptive_frame_field_flag : 0
    direct_8x8_inference_flag : 1
    frame_cropping_flag : 0
     frame_crop_left_offset : 0
     frame_crop_right_offset : 0
     frame_crop_top_offset : 0
     frame_crop_bottom_offset : 0
    vui_parameters_present_flag : 0                                                                                                                                                                                                            
    === VUI ===                                                                                                                                                                                                                                  
    aspect_ratio_info_present_flag : 0                                                                                                                                                                                                          
     aspect_ratio_idc : 0                                                                                                                                                                                                                      
    sar_width : 0                                                                                                                                                                                                                          
    sar_height : 0                                                                                                                                                                                                                          
    overscan_info_present_flag : 0                                                                                                                                                                                                              
     overscan_appropriate_flag : 0                                                                                                                                                                                                            
    video_signal_type_present_flag : 0                                                                                                                                                                                                          
     video_format : 0                                                                                                                                                                                                                          
     video_full_range_flag : 0                                                                                                                                                                                                                
     colour_description_present_flag : 0                                                                                                                                                                                                      
    colour_primaries : 0                                                                                                                                                                                                                    
     transfer_characteristics : 0                                                                                                                                                                                                              
     matrix_coefficients : 0                                                                                                                                                                                                                  
    chroma_loc_info_present_flag : 0                                                                                                                                                                                                            
     chroma_sample_loc_type_top_field : 0                                                                                                                                                                                                      
     chroma_sample_loc_type_bottom_field : 0                                                                                                                                                                                                  
    timing_info_present_flag : 0                                                                                                                                                                                                                
     num_units_in_tick : 0                                                                                                                                                                                                                    
     time_scale : 0                                                                                                                                                                                                                            
     fixed_frame_rate_flag : 0                                                                                                                                                                                                                
    nal_hrd_parameters_present_flag : 0                                                                                                                                                                                                        
    vcl_hrd_parameters_present_flag : 0                                                                                                                                                                                                        
     low_delay_hrd_flag : 0                                                                                                                                                                                                                    
    pic_struct_present_flag : 0
    bitstream_restriction_flag : 0
     motion_vectors_over_pic_boundaries_flag : 0
     max_bytes_per_pic_denom : 0
     max_bits_per_mb_denom : 0
     log2_max_mv_length_horizontal : 0
     log2_max_mv_length_vertical : 0
     num_reorder_frames : 0
     max_dec_frame_buffering : 0
    === HRD ===
    cpb_cnt_minus1 : 0
    bit_rate_scale : 0
    cpb_size_scale : 0
    initial_cpb_removal_delay_length_minus1 : 0
    cpb_removal_delay_length_minus1 : 0
    dpb_output_delay_length_minus1 : 0
    time_offset_length : 0
    !! Found NAL at offset 14 (0x000E), size 4 (0x0004)
    ==================== NAL ====================
    forbidden_zero_bit : 0
    nal_ref_idc : 3
    nal_unit_type : 8 ( Picture parameter set )
    ======= PPS =======
    pic_parameter_set_id : 0
    seq_parameter_set_id : 0
    entropy_coding_mode_flag : 0
    pic_order_present_flag : 0
    num_slice_groups_minus1 : 0
    slice_group_map_type : 0
    num_ref_idx_l0_active_minus1 : 0
    num_ref_idx_l1_active_minus1 : 0
    weighted_pred_flag : 0
    weighted_bipred_idc : 0
    pic_init_qp_minus26 : 0
    pic_init_qs_minus26 : 0
    chroma_qp_index_offset : 0
    deblocking_filter_control_present_flag : 0
    constrained_intra_pred_flag : 0
    redundant_pic_cnt_present_flag : 0
    transform_8x8_mode_flag : 1
    pic_scaling_matrix_present_flag : 0
    second_chroma_qp_index_offset : 16
    !! Found NAL at offset 21 (0x0015), size 480 (0x01E0)
    ==================== NAL ====================
    forbidden_zero_bit : 0
    nal_ref_idc : 2
    nal_unit_type : 1 ( Coded slice of a non-IDR picture )
    ======= Slice Header =======
    first_mb_in_slice : 0
    slice_type : 5 ( P slice only )
    pic_parameter_set_id : 0
    frame_num : 1
    field_pic_flag : 0
    bottom_field_flag : 0
    idr_pic_id : 0
    pic_order_cnt_lsb : 2
    delta_pic_order_cnt_bottom : 0
    redundant_pic_cnt : 0
    direct_spatial_mv_pred_flag : 0
    num_ref_idx_active_override_flag : 0
    num_ref_idx_l0_active_minus1 : 0
    num_ref_idx_l1_active_minus1 : 0
    cabac_init_idc : 0
    slice_qp_delta : -7
    sp_for_switch_flag : 0
    slice_qs_delta : 0
    disable_deblocking_filter_idc : 0
    slice_alpha_c0_offset_div2 : 0
    slice_beta_offset_div2 : 0
    slice_group_change_cycle : 0
    === Prediction Weight Table ===
    luma_log2_weight_denom : 0
    chroma_log2_weight_denom : 0
    luma_weight_l0_flag : 0
    chroma_weight_l0_flag : 0
    luma_weight_l1_flag : 0
    chroma_weight_l1_flag : 0
    === Ref Pic List Reordering ===
    ref_pic_list_reordering_flag_l0 : 0
    ref_pic_list_reordering_flag_l1 : 0
    === Decoded Ref Pic Marking ===
    no_output_of_prior_pics_flag : 0
    long_term_reference_flag : 0
    adaptive_ref_pic_marking_mode_flag : 0
    !! Found NAL at offset 504 (0x01F8), size 324 (0x0144)
    ==================== NAL ====================
    forbidden_zero_bit : 0
    nal_ref_idc : 2
    nal_unit_type : 1 ( Coded slice of a non-IDR picture )
    ======= Slice Header =======
    first_mb_in_slice : 0
    slice_type : 5 ( P slice only )
    pic_parameter_set_id : 0
    frame_num : 2
    field_pic_flag : 0
    bottom_field_flag : 0
    idr_pic_id : 0
    pic_order_cnt_lsb : 4
    delta_pic_order_cnt_bottom : 0
    redundant_pic_cnt : 0
    direct_spatial_mv_pred_flag : 0
    num_ref_idx_active_override_flag : 0
    num_ref_idx_l0_active_minus1 : 0
    num_ref_idx_l1_active_minus1 : 0
    cabac_init_idc : 0
    slice_qp_delta : -7
    sp_for_switch_flag : 0
    slice_qs_delta : 0
    disable_deblocking_filter_idc : 0
    slice_alpha_c0_offset_div2 : 0
    slice_beta_offset_div2 : 0
    slice_group_change_cycle : 0
    === Prediction Weight Table ===
    luma_log2_weight_denom : 0
    chroma_log2_weight_denom : 0
    luma_weight_l0_flag : 0
    chroma_weight_l0_flag : 0
    luma_weight_l1_flag : 0
    chroma_weight_l1_flag : 0
    === Ref Pic List Reordering ===
    ref_pic_list_reordering_flag_l0 : 0
    ref_pic_list_reordering_flag_l1 : 0
    === Decoded Ref Pic Marking ===
    no_output_of_prior_pics_flag : 0
    long_term_reference_flag : 0
    adaptive_ref_pic_marking_mode_flag : 0
    !! Found NAL at offset 831 (0x033F), size 300 (0x012C)
    ==================== NAL ====================
    forbidden_zero_bit : 0
    nal_ref_idc : 2
    nal_unit_type : 1 ( Coded slice of a non-IDR picture )
    ======= Slice Header =======
    first_mb_in_slice : 0
    slice_type : 5 ( P slice only )
    pic_parameter_set_id : 0
    frame_num : 3
    field_pic_flag : 0
    bottom_field_flag : 0
    idr_pic_id : 0
    pic_order_cnt_lsb : 6
    delta_pic_order_cnt_bottom : 0
    redundant_pic_cnt : 0
    direct_spatial_mv_pred_flag : 0
    num_ref_idx_active_override_flag : 0
    num_ref_idx_l0_active_minus1 : 0
    num_ref_idx_l1_active_minus1 : 0
    cabac_init_idc : 0
    slice_qp_delta : -7
    sp_for_switch_flag : 0
    slice_qs_delta : 0
    disable_deblocking_filter_idc : 0
    slice_alpha_c0_offset_div2 : 0
    slice_beta_offset_div2 : 0
    slice_group_change_cycle : 0
    === Prediction Weight Table ===
    luma_log2_weight_denom : 0
    chroma_log2_weight_denom : 0
    luma_weight_l0_flag : 0
    chroma_weight_l0_flag : 0
    luma_weight_l1_flag : 0
    chroma_weight_l1_flag : 0
    === Ref Pic List Reordering ===
    ref_pic_list_reordering_flag_l0 : 0
    ref_pic_list_reordering_flag_l1 : 0
    === Decoded Ref Pic Marking ===
    no_output_of_prior_pics_flag : 0
    long_term_reference_flag : 0
    adaptive_ref_pic_marking_mode_flag : 0
    !! Found NAL at offset 1134 (0x046E), size 825 (0x0339)
    ==================== NAL ====================
    forbidden_zero_bit : 0
    nal_ref_idc : 2
    nal_unit_type : 1 ( Coded slice of a non-IDR picture )
    ======= Slice Header =======
    first_mb_in_slice : 0
    slice_type : 5 ( P slice only )
    pic_parameter_set_id : 0
    frame_num : 4
    field_pic_flag : 0
    bottom_field_flag : 0
    idr_pic_id : 0
    pic_order_cnt_lsb : 8
    delta_pic_order_cnt_bottom : 0
    redundant_pic_cnt : 0
    direct_spatial_mv_pred_flag : 0
    num_ref_idx_active_override_flag : 0
    num_ref_idx_l0_active_minus1 : 0
    num_ref_idx_l1_active_minus1 : 0
    cabac_init_idc : 0
    slice_qp_delta : -9
    sp_for_switch_flag : 0
    slice_qs_delta : 0
    disable_deblocking_filter_idc : 0
    slice_alpha_c0_offset_div2 : 0
    slice_beta_offset_div2 : 0
    slice_group_change_cycle : 0
    === Prediction Weight Table ===
    luma_log2_weight_denom : 0
    chroma_log2_weight_denom : 0
    luma_weight_l0_flag : 0
    chroma_weight_l0_flag : 0
    luma_weight_l1_flag : 0
    chroma_weight_l1_flag : 0
    === Ref Pic List Reordering ===
    ref_pic_list_reordering_flag_l0 : 0
    ref_pic_list_reordering_flag_l1 : 0
    === Decoded Ref Pic Marking ===
    no_output_of_prior_pics_flag : 0
    long_term_reference_flag : 0
    adaptive_ref_pic_marking_mode_flag : 0
    !! Found NAL at offset 1962 (0x07AA), size 754 (0x02F2)
    ==================== NAL ====================
    forbidden_zero_bit : 0
    nal_ref_idc : 2
    nal_unit_type : 1 ( Coded slice of a non-IDR picture )
    ======= Slice Header =======
    first_mb_in_slice : 0
    slice_type : 5 ( P slice only )
    pic_parameter_set_id : 0
    frame_num : 5
    field_pic_flag : 0
    bottom_field_flag : 0
    idr_pic_id : 0
    pic_order_cnt_lsb : 10
    delta_pic_order_cnt_bottom : 0
    redundant_pic_cnt : 0
    direct_spatial_mv_pred_flag : 0
    num_ref_idx_active_override_flag : 0
    num_ref_idx_l0_active_minus1 : 0
    num_ref_idx_l1_active_minus1 : 0
    cabac_init_idc : 0
    slice_qp_delta : -9
    sp_for_switch_flag : 0
    slice_qs_delta : 0
    disable_deblocking_filter_idc : 0
    slice_alpha_c0_offset_div2 : 0
    slice_beta_offset_div2 : 0
    slice_group_change_cycle : 0
    === Prediction Weight Table ===
    luma_log2_weight_denom : 0
    chroma_log2_weight_denom : 0
    luma_weight_l0_flag : 0
    chroma_weight_l0_flag : 0
    luma_weight_l1_flag : 0
    chroma_weight_l1_flag : 0
    === Ref Pic List Reordering ===
    ref_pic_list_reordering_flag_l0 : 0
    ref_pic_list_reordering_flag_l1 : 0
    === Decoded Ref Pic Marking ===
    no_output_of_prior_pics_flag : 0
    long_term_reference_flag : 0
    adaptive_ref_pic_marking_mode_flag : 0
    !! Found NAL at offset 2719 (0x0A9F), size 824 (0x0338)
    ==================== NAL ====================
    forbidden_zero_bit : 0
    nal_ref_idc : 2
    nal_unit_type : 1 ( Coded slice of a non-IDR picture )
    ======= Slice Header =======
    first_mb_in_slice : 0
    slice_type : 5 ( P slice only )
    pic_parameter_set_id : 0
    frame_num : 6
    field_pic_flag : 0
    bottom_field_flag : 0
    idr_pic_id : 0
    pic_order_cnt_lsb : 12
    delta_pic_order_cnt_bottom : 0
    redundant_pic_cnt : 0
    direct_spatial_mv_pred_flag : 0
    num_ref_idx_active_override_flag : 0
    num_ref_idx_l0_active_minus1 : 0
    num_ref_idx_l1_active_minus1 : 0
    cabac_init_idc : 0
    slice_qp_delta : -9
    sp_for_switch_flag : 0
    slice_qs_delta : 0
    disable_deblocking_filter_idc : 0
    slice_alpha_c0_offset_div2 : 0
    slice_beta_offset_div2 : 0
    slice_group_change_cycle : 0
    === Prediction Weight Table ===
    luma_log2_weight_denom : 0
    chroma_log2_weight_denom : 0
    luma_weight_l0_flag : 0
    chroma_weight_l0_flag : 0
    luma_weight_l1_flag : 0
    chroma_weight_l1_flag : 0
    === Ref Pic List Reordering ===
    ref_pic_list_reordering_flag_l0 : 0
    ref_pic_list_reordering_flag_l1 : 0
    === Decoded Ref Pic Marking ===
    no_output_of_prior_pics_flag : 0
    long_term_reference_flag : 0
    adaptive_ref_pic_marking_mode_flag : 0
    !! Found NAL at offset 3546 (0x0DDA), size 628 (0x0274)
    ==================== NAL ====================
    [...]
  • Dreamcast Anniversary Programming

    10 septembre 2010, par Multimedia Mike — Game Hacking

    This day last year saw a lot of nostalgia posts on the internet regarding the Sega Dreamcast, launched 10 years prior to that day (on 9/9/99). Regrettably, none of the retrospectives that I read really seemed to mention the homebrew potential, which is the aspect that interested me. On the occasion of the DC’s 11th anniversary, I wanted to remind myself how to build something for the unit and do so using modern equipment and build tools.



    Background
    Like many other programmers, I initially gained interest in programming because I desired to program video games. Not content to just plunk out games on a PC, I always had a deep, abiding ambition to program actual video game hardware. That is, I wanted to program a purpose-built video game console. The Sega Dreamcast might be the most ideal candidate to ever emerge for that task. All that was required to run your own software on the unit was the console, a PC, some free software tools, and a special connectivity measure.

    The Equipment
    Here is the hardware required (ideally) to build software for the DC :

    • The console itself (I happen to have 3 of them laying around, as pictured above)
    • Some peripherals : Such as the basic DC controller, the DC keyboard (flagship title : Typing of the Dead), and the visual memory unit (VMU)


    • VGA box : The DC supported 480p gaming via a device that allowed you to connect the console straight to a VGA monitor via 15-pin D-sub. Not required for development, but very useful. I happen to have 3 of them from different third parties :


    • Finally, the connectivity measure for hooking the DC to the PC.
      There are 2 options here. The first is rare, expensive and relatively fast : A DC broadband adapter. The second is slower but much less expensive and relatively easy to come by– the DC coder’s cable. This was a DB-9 adapter on one end and a DC serial adapter on the other, and a circuit in the middle to monkey with voltage levels or some such ; I’m no electrical engineer. I procured this model from the notorious Lik Sang, well before that outfit was sued out of business.


    Dealing With Legacy
    Take a look at that coder’s cable again. DB-9 ? When was the last time you owned a computer with one of those ? And then think farther back to the last time to had occasion to plug something into one of those ports (likely a serial mouse).



    A few years ago, someone was about to toss out this Belkin USB to DB-9 serial converter when I intervened. I foresaw the day when I would dust off the coder’s cable. So now I can connect a USB serial cable to my Eee PC, which then connects via converter to a different serial cable, one which has its own conversion circuit that alters the connection to yet another type of serial cable.

    Bits is bits is bits as far as I’m concerned.



    Putting It All Together
    Now to assemble all the pieces (plus a monitor) into one development desktop :



    The monitor says “dcload 1.0.3, idle…”. That’s a custom boot CD-ROM that is patiently waiting to receive commands, code and data via the serial port.

    Getting The Software
    Back in the day, homebrew software development on the DC revolved around these components :

    • GNU binutils : for building base toolchains for the Hitachi SH-4 main CPU as well as the ARM7-based audio coprocessor
    • GNU gcc/g++ : for building compilers on top of binutils for the 2 CPUs
    • Newlib : a C library intended for embedded systems
    • KallistiOS : an open source, real-time OS developed for the DC

    The DC was my first exposure to building cross compilers. I developed some software for the DC in the earlier part of the decade. Now, I am trying to figure out how I did it, especially since I think I came up with a few interesting ideas at the time.

    Struggling With the Software Legacy
    The source for KallistiOS has gone untouched since about 2004 but is still around thanks to Sourceforge. The instructions for properly building the toolchain have been lost to time, or would be were it not for the Internet Archive’s copy of a site called Hangar Eleven. Also, KallistiOS makes reference to a program called ‘dc-tool’ which is needed on the client side for communicating with dcload. I was able to find this binary at the Boob ! site (well-known in DC circles).

    I was able to build the toolchain using binutils 2.20.1, gcc 4.5.1 and newlib 1.18.0. Building the toolchain is an odd process as it requires building the binutils, then building the C compiler, then newlib, and then building the C compiler again along with the C++ compiler because the C++ compiler depends on newlib.

    With some effort, I got the toolchain to build KallistiOS and most of its example programs. I documented most of the tweaks I had to make, several of them exactly the same as this one that I recently discovered while resurrecting a 10-year-old C program (common construct in C programming of old ?).

    Moment of Truth
    So I had some example programs built as ELF files. I told dc-tool to upload and run them on the waiting console. Unfortunately, the tool would just sort of stall, though some communication had evidently taken place. It has been many years since I have seen this in action but I recall that something more ought to be happening.

    Plan B (Hardware)
    This is the point that I remember that I have been holding onto one rather old little machine that still has a DB-9 serial port. It’s not especially ergonomic to set up. I have to run it on my floor because, to connect it to my network, I need to run a 25′ ethernet cable that just barely reaches from the other room. The machine doesn’t seem to like USB keyboards, which is a shame since I have long since ditched any PS/2 keyboards. Fortunately, the box still has an old Gentoo distro and is running sshd, a holdover from its former life as a headless box.



    Now when I run dc-tool, both the PC and DC report the upload progress while pretty overscan bars oscillate on the DC’s monitor. Now I’m back in business, until…

    Plan C (Software)
    None of these KallistiOS example programs are working. Some are even reporting catastrophic failures (register dumps) via the serial console. That’s when I remember that gcc can be a bit fickle on CPU architectures that are not, shall we say, first-class citizens. Back in the day, gcc 2.95 was a certified no-go for SH-4 development. 3.0.3 or 3.0.4 was called upon at the time. As I’m hosting this toolchain on x86_64 right now, gcc 3.0.4 can’t even be built (predates the architecture).

    One last option : As I searched through my old DC project directories, I found that I still have a lot of the resulting binaries, the ones I built 7-8 years ago. I upload a few of those and I finally see homebrew programming at work again, including this old program (described in detail here).

    Next Steps
    If I ever feel like revisiting this again, I suppose I can try some of the older 4.x series to see if they build valid programs. Alternatively, try building an x86_32-hosted 3.0.4 toolchain which ought to be a known good. And if that fails, search a little bit more to find that there are still active Dreamcast communities out there on the internet which probably have development toolchain binaries ready for download.