Recherche avancée

Médias (91)

Autres articles (56)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

Sur d’autres sites (3511)

  • Set timeout on ffmpeg process

    30 octobre 2013, par Thomas Vervik

    Sometims ffmpeg never completes, and thereby preventing conversions of other videos in the queue. Is it possible to set some sort of timeout in ffmpeg such that it terminates if it isnt finished within some given time, example 5 min

    My command looks like this today :

    ffmpeg -i /home/tomcat/bsafevideo/1efef9daa7f5000ed83d67f6fbd0e7d9/aad5adc307c4dd7e457509423a7f3734/69451c31cd592e86138423f6849d8141 -y -r 24 -ar 22050 -f mov -vf [in]transpose=1[rt0],[rt0]scale=iw*480/ih:480[sc0],[sc0]pad=640:480:140[pd0],movie=/srv/bsafe/tomcat7/webapps/ROOT/resources/images/logo_watermark.png [wm],[pd0][wm] overlay=W-w-140:0[out] /home/tomcat/bsafevideo/1efef9daa7f5000ed83d67f6fbd0e7d9/aad5adc307c4dd7e457509423a7f3734/69451c31cd592e86138423f6849d8141.mov -ar 22050 -b 1500k -vcodec libtheora -acodec libvorbis -f ogg -vf [in]transpose=1[rt0],[rt0]scale=iw*480/ih:480[sc0],[sc0]pad=640:480:140[pd0],movie=/srv/bsafe/tomcat7/webapps/ROOT/resources/images/logo_watermark.png [wm],[pd0][wm] overlay=W-w-140:0[out] /home/tomcat/bsafevideo/1efef9daa7f5000ed83d67f6fbd0e7d9/aad5adc307c4dd7e457509423a7f3734/69451c31cd592e86138423f6849d8141.ogg -ar 22050 -vcodec libx264 -profile baseline -vf [in]transpose=1[rt0],[rt0]scale=iw*480/ih:480[sc0],[sc0]pad=640:480:140[pd0],movie=/srv/bsafe/tomcat7/webapps/ROOT/resources/images/logo_watermark.png [wm],[pd0][wm] overlay=W-w-140:0[out] /home/tomcat/bsafevideo/1efef9daa7f5000ed83d67f6fbd0e7d9/aad5adc307c4dd7e457509423a7f3734/69451c31cd592e86138423f6849d8141_mp4.mp4

    UPDATE. Thanks LordNeckBerd, you pointed me in right direction !

    So I see now its kind of not ffmpeg really hanging, the issue is that my java code which reads the inputstream from the linux process will block since ffmpeg never returns a end of line, which I see now when Im running the command. This is the blocking line, it waits for more input from me.

    Press [q] to stop, [?] for help

    So its two issues here now. First is why this particular conversion is failing, and second, how to make sure ffmpeg is not making this (for my Java process) blocking command asking for more input.

    C:\Program Files (x86)\Console2>ffmpeg -i C:/projectsGit/bsafe-server/classes/test/bs-   base/video/ac7601e2bc3bc1545cd30ad3160f5232 -y -r 24 -ar 22050 -f mov C:/projectsGit/bsafe-server/classes/test/bs-base/video/ac7601e2bc3bc1545cd30ad3160f5232.mov -ar 22050 -b:v 1500k -vcodec libtheora -acodec libvorbis -f ogg C:/projectsGit/bsafe-server/classes/test/bs-base/video/ac7601e2bc3bc1545cd30ad3160f5232.ogg -ar 22050 -vcodec libx264 -profile:v baseline C:/projectsGit/bsafe-server/classes/test/bs-base/video/ac7601e2bc3bc1545cd30ad3160f5232_mp4.mp4
    ffmpeg version N-54762-g38b701a Copyright (c) 2000-2013 the FFmpeg developers
    built on Jul 15 2013 18:47:20 with gcc 4.7.3 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --  enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-  libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable- libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable- libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable- libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame - -enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable- libx264 --enable-libxavs --enable-libxvid --enable-zlib
    libavutil      52. 39.100 / 52. 39.100
    libavcodec     55. 18.102 / 55. 18.102
    libavformat    55. 12.102 / 55. 12.102
    libavdevice    55.  3.100 / 55.  3.100
    libavfilter     3. 81.101 /  3. 81.101
    libswscale      2.  3.100 /  2.  3.100
    libswresample   0. 17.102 /  0. 17.102
    libpostproc    52.  3.100 / 52.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:/projectsGit/bsafe-server/classes/test/bs-  base/video/ac7601e2bc3bc1545cd30ad3160f5232':
    Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 2013-01-15 05:46:02
    Duration: 00:00:10.03, start: 0.000000, bitrate: 394 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 640x480, 264 kb/s, SAR 65536:65536 DAR 4:3, 10.95 fps, 90k tbr, 90k tbn, 180k tbc
    Metadata:
     creation_time   : 2013-01-15 05:46:02
     handler_name    : VideoHandle
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 127 kb/s
    Metadata:
     creation_time   : 2013-01-15 05:46:02
     handler_name    : SoundHandle
    [ogg @ 00000000027d7860] Frame rate very high for a muxer not efficiently supporting it.
    Please consider specifying a lower framerate, a different muxer or -vsync 2
    [mp4 @ 00000000027dacc0] Frame rate very high for a muxer not efficiently supporting it.
    Please consider specifying a lower framerate, a different muxer or -vsync 2
    [libx264 @ 0000000003e6b9c0] using SAR=1/1
    [libx264 @ 0000000003e6b9c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0000000003e6b9c0] profile High, level 3.0
    [libx264 @ 0000000003e6b9c0] 264 - core 133 r2334 a3ac64b - H.264/MPEG-4 AVC codec -   Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3  deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1  me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1  chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1  interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0  direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40  intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69  qpstep=4 ip_ratio=1.40 aq=1:1.00
    [libx264 @ 00000000027db4a0] using SAR=1/1
    [libx264 @ 00000000027db4a0] MB rate (108000000) > level limit (2073600)
    [libx264 @ 00000000027db4a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 00000000027db4a0] profile Constrained Baseline, level 5.2
    [libx264 @ 00000000027db4a0] 264 - core 133 r2334 a3ac64b - H.264/MPEG-4 AVC codec -  Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=0 ref=3  deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1  me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1  chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1  interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250  keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0  qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mov, to 'C:/projectsGit/bsafe-server/classes/test/bs-  base/video/ac7601e2bc3bc1545cd30ad3160f5232.mov':
    Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    encoder         : Lavf55.12.102
    Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1  DAR 4:3], q=-1--1, 12288 tbn, 24 tbc
    Metadata:
     creation_time   : 2013-01-15 05:46:02
     handler_name    : VideoHandle
    Stream #0:1(eng): Audio: aac (libvo_aacenc) (mp4a / 0x6134706D), 22050 Hz, mono, s16, 128 kb/s
    Metadata:
     creation_time   : 2013-01-15 05:46:02
     handler_name    : SoundHandle
    Output #1, ogg, to 'C:/projectsGit/bsafe-server/classes/test/bs-base/video/ac7601e2bc3bc1545cd30ad3160f5232.ogg':
    Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    encoder         : Lavf55.12.102
    Stream #1:0(eng): Video: theora (libtheora), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 1500 kb/s, 90k tbn, 90k tbc
    Metadata:
     creation_time   : 2013-01-15 05:46:02
     handler_name    : VideoHandle
    Stream #1:1(eng): Audio: vorbis (libvorbis), 22050 Hz, mono, fltp
    Metadata:
     creation_time   : 2013-01-15 05:46:02
     handler_name    : SoundHandle
    Output #2, mp4, to 'C:/projectsGit/bsafe-server/classes/test/bs-base/video/ac7601e2bc3bc1545cd30ad3160f5232_mp4.mp4':
    Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    encoder         : Lavf55.12.102
    Stream #2:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 90k tbn, 90k tbc
    Metadata:
     creation_time   : 2013-01-15 05:46:02
     handler_name    : VideoHandle
    Stream #2:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 22050 Hz, mono, s16, 128 kb/s
    Metadata:
     creation_time   : 2013-01-15 05:46:02
     handler_name    : SoundHandle
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 -> libx264)
    Stream #0:1 -> #0:1 (aac -> libvo_aacenc)
    Stream #0:0 -> #1:0 (h264 -> libtheora)
    Stream #0:1 -> #1:1 (aac -> libvorbis)
    Stream #0:0 -> #2:0 (h264 -> libx264)
    Stream #0:1 -> #2:1 (aac -> libvo_aacenc)
    Press [q] to stop, [?] for help
  • Developing A Shader-Based Video Codec

    22 juin 2013, par Multimedia Mike — Outlandish Brainstorms

    Early last month, this thing called ORBX.js was in the news. It ostensibly has something to do with streaming video and codec technology, which naturally catches my interest. The hype was kicked off by Mozilla honcho Brendan Eich when he posted an article asserting that HD video decoding could be entirely performed in JavaScript. We’ve seen this kind of thing before using Broadway– an H.264 decoder implemented entirely in JS. But that exposes some very obvious limitations (notably CPU usage).

    But this new video codec promises 1080p HD playback directly in JavaScript which is a lofty claim. How could it possibly do this ? I got the impression that performance was achieved using WebGL, an extension which allows JavaScript access to accelerated 3D graphics hardware. Browsing through the conversations surrounding the ORBX.js announcement, I found this confirmation from Eich himself :

    You’re right that WebGL does heavy lifting.

    As of this writing, ORBX.js remains some kind of private tech demo. If there were a public demo available, it would necessarily be easy to reverse engineer the downloadable JavaScript decoder.

    But the announcement was enough to make me wonder how it could be possible to create a video codec which effectively leverages 3D hardware.

    Prior Art
    In theorizing about this, it continually occurs to me that I can’t possibly be the first person to attempt to do this (or the ORBX.js people, for that matter). In googling on the matter, I found various forums and Q&A posts where people asked if it were possible to, e.g., accelerate JPEG decoding and presentation using 3D hardware, with no answers. I also found a blog post which describes a plan to use 3D hardware to accelerate VP8 video decoding. It was a project done under the banner of Google’s Summer of Code in 2011, though I’m not sure which open source group mentored the effort. The project did not end up producing the shader-based VP8 codec originally chartered but mentions that “The ‘client side’ of the VP8 VDPAU implementation is working and is currently being reviewed by the libvdpau maintainers.” I’m not sure what that means. Perhaps it includes modifications to the public API that supports VP8, but is waiting for the underlying hardware to actually implement VP8 decoding blocks in hardware.

    What’s So Hard About This ?
    Video decoding is a computationally intensive task. GPUs are known to be really awesome at chewing through computationally intensive tasks. So why aren’t GPUs a natural fit for decoding video codecs ?

    Generally, it boils down to parallelism, or lack of opportunities thereof. GPUs are really good at doing the exact same operations over lots of data at once. The problem is that decoding compressed video usually requires multiple phases that cannot be parallelized, and the individual phases often cannot be parallelized. In strictly mathematical terms, a compressed data stream will need to be decoded by applying a function f(x) over each data element, x0 .. xn. However, the function relies on having applied the function to the previous data element, i.e. :

    f(xn) = f(f(xn-1))
    

    What happens when you try to parallelize such an algorithm ? Temporal rifts in the space/time continuum, if you’re in a Star Trek episode. If you’re in the real world, you’ll get incorrect, unusuable data as the parallel computation is seeded with a bunch of invalid data at multiple points (which is illustrated in some of the pictures in the aforementioned blog post about accelerated VP8).

    Example : JPEG
    Let’s take a very general look at the various stages involved in decoding the ubiquitous JPEG format :


    High level JPEG decoding flow

    What are the opportunities to parallelize these various phases ?

    • Huffman decoding (run length decoding and zig-zag reordering is assumed to be rolled into this phase) : not many opportunities for parallelizing the various Huffman formats out there, including this one. Decoding most Huffman streams is necessarily a sequential operation. I once hypothesized that it would be possible to engineer a codec to achieve some parallelism during the entropy decoding phase, and later found that On2′s VP8 codec employs the scheme. However, such a scheme is unlikely to break down to such a fine level that WebGL would require.
    • Reverse DC prediction : JPEG — and many other codecs — doesn’t store full DC coefficients. It stores differences in successive DC coefficients. Reversing this process can’t be parallelized. See the discussion in the previous section.
    • Dequantize coefficients : This could be very parallelized. It should be noted that software decoders often don’t dequantize all coefficients. Many coefficients are 0 and it’s a waste of a multiplication operation to dequantize. Thus, this phase is sometimes rolled into the Huffman decoding phase.
    • Invert discrete cosine transform : This seems like it could be highly parallelizable. I will be exploring this further in this post.
    • Convert YUV -> RGB for final display : This is a well-established use case for 3D acceleration.

    Crash Course in 3D Shaders and Humility
    So I wanted to see if I could accelerate some parts of JPEG decoding using something called shaders. I made an effort to understand 3D programming and its associated math throughout the 1990s but 3D technology left me behind a very long time ago while I got mixed up in this multimedia stuff. So I plowed through a few books concerning WebGL (thanks to my new Safari Books Online subscription). After I learned enough about WebGL/JS to be dangerous and just enough about shader programming to be absolutely lethal, I set out to try my hand at optimizing IDCT using shaders.

    Here’s my extremely high level (and probably hopelessly naive) view of the modern GPU shader programming model :


    Basic WebGL rendering pipeline

    The WebGL program written in JavaScript drives the show. It sends a set of vertices into the WebGL system and each vertex is processed through a vertex shader. Then, each pixel that falls within a set of vertices is sent through a fragment shader to compute the final pixel attributes (R, G, B, and alpha value). Another consideration is textures : This is data that the program uploads to GPU memory which can be accessed programmatically by the shaders).

    These shaders (vertex and fragment) are key to the GPU’s programmability. How are they programmed ? Using a special C-like shading language. Thought I : “C-like language ? I know C ! I should be able to master this in short order !” So I charged forward with my assumptions and proceeded to get smacked down repeatedly by the overall programming paradigm. I came to recognize this as a variation of the scientific method : Develop a hypothesis– in my case, a mental model of how the system works ; develop an experiment (short program) to prove or disprove the model ; realize something fundamental that I was overlooking ; formulate new hypothesis and repeat.

    First Approach : Vertex Workhorse
    My first pitch goes like this :

    • Upload DCT coefficients to GPU memory in the form of textures
    • Program a vertex mesh that encapsulates 16×16 macroblocks
    • Distribute the IDCT effort among multiple vertex shaders
    • Pass transformed Y, U, and V blocks to fragment shader which will convert the samples to RGB

    So the idea is that decoding of 16×16 macroblocks is parallelized. A macroblock embodies 6 blocks :


    JPEG macroblocks

    It would be nice to process one of these 6 blocks in each vertex. But that means drawing a square with 6 vertices. How do you do that ? I eventually realized that drawing a square with 6 vertices is the recommended method for drawing a square on 3D hardware. Using 2 triangles, each with 3 vertices (0, 1, 2 ; 3, 4, 5) :


    2 triangles make a square

    A vertex shader knows which (x, y) coordinates it has been assigned, so it could figure out which sections of coefficients it needs to access within the textures. But how would a vertex shader know which of the 6 blocks it should process ? Solution : Misappropriate the vertex’s z coordinate. It’s not used for anything else in this case.

    So I set all of that up. Then I hit a new roadblock : How to get the reconstructed Y, U, and V samples transported to the fragment shader ? I have found that communicating between shaders is quite difficult. Texture memory ? WebGL doesn’t allow shaders to write back to texture memory ; shaders can only read it. The standard way to communicate data from a vertex shader to a fragment shader is to declare variables as “varying”. Up until this point, I knew about varying variables but there was something I didn’t quite understand about them and it nagged at me : If 3 different executions of a vertex shader set 3 different values to a varying variable, what value is passed to the fragment shader ?

    It turns out that the varying variable varies, which means that the GPU passes interpolated values to each fragment shader invocation. This completely destroys this idea.

    Second Idea : Vertex Workhorse, Take 2
    The revised pitch is to work around the interpolation issue by just having each vertex shader invocation performs all 6 block transforms. That seems like a lot of redundant. However, I figured out that I can draw a square with only 4 vertices by arranging them in an ‘N’ pattern and asking WebGL to draw a TRIANGLE_STRIP instead of TRIANGLES. Now it’s only doing the 4x the extra work, and not 6x. GPUs are supposed to be great at this type of work, so it shouldn’t matter, right ?

    I wired up an experiment and then ran into a new problem : While I was able to transform a block (or at least pretend to), and load up a varying array (that wouldn’t vary since all vertex shaders wrote the same values) to transmit to the fragment shader, the fragment shader can’t access specific values within the varying block. To clarify, a WebGL shader can use a constant value — or a value that can be evaluated as a constant at compile time — to index into arrays ; a WebGL shader can not compute an index into an array. Per my reading, this is a WebGL security consideration and the limitation may not be present in other OpenGL(-ES) implementations.

    Not Giving Up Yet : Choking The Fragment Shader
    You might want to be sitting down for this pitch :

    • Vertex shader only interpolates texture coordinates to transmit to fragment shader
    • Fragment shader performs IDCT for a single Y sample, U sample, and V sample
    • Fragment shader converts YUV -> RGB

    Seems straightforward enough. However, that step concerning IDCT for Y, U, and V entails a gargantuan number of operations. When computing the IDCT for an entire block of samples, it’s possible to leverage a lot of redundancy in the math which equates to far fewer overall operations. If you absolutely have to compute each sample individually, for an 8×8 block, that requires 64 multiplication/accumulation (MAC) operations per sample. For 3 color planes, and including a few extra multiplications involved in the RGB conversion, that tallies up to about 200 MACs per pixel. Then there’s the fact that this approach means a 4x redundant operations on the color planes.

    It’s crazy, but I just want to see if it can be done. My approach is to pre-compute a pile of IDCT constants in the JavaScript and transmit them to the fragment shader via uniform variables. For a first order optimization, the IDCT constants are formatted as 4-element vectors. This allows computing 16 dot products rather than 64 individual multiplication/addition operations. Ideally, GPU hardware executes the dot products faster (and there is also the possibility of lining these calculations up as matrices).

    I can report that I actually got a sample correctly transformed using this approach. Just one sample, through. Then I ran into some new problems :

    Problem #1 : Computing sample #1 vs. sample #0 requires a different table of 64 IDCT constants. Okay, so create a long table of 64 * 64 IDCT constants. However, this suffers from the same problem as seen in the previous approach : I can’t dynamically compute the index into this array. What’s the alternative ? Maintain 64 separate named arrays and implement 64 branches, when branching of any kind is ill-advised in shader programming to begin with ? I started to go down this path until I ran into…

    Problem #2 : Shaders can only be so large. 64 * 64 floats (4 bytes each) requires 16 kbytes of data and this well exceeds the amount of shader storage that I can assume is allowed. That brings this path of exploration to a screeching halt.

    Further Brainstorming
    I suppose I could forgo pre-computing the constants and directly compute the IDCT for each sample which would entail lots more multiplications as well as 128 cosine calculations per sample (384 considering all 3 color planes). I’m a little stuck with the transform idea right now. Maybe there are some other transforms I could try.

    Another idea would be vector quantization. What little ORBX.js literature is available indicates that there is a method to allow real-time streaming but that it requires GPU assistance to yield enough horsepower to make it feasible. When I think of such severe asymmetry between compression and decompression, my mind drifts towards VQ algorithms. As I come to understand the benefits and limitations of GPU acceleration, I think I can envision a way that something similar to SVQ1, with its copious, hierarchical vector tables stored as textures, could be implemented using shaders.

    So far, this all pertains to intra-coded video frames. What about opportunities for inter-coded frames ? The only approach that I can envision here is to use WebGL’s readPixels() function to fetch the rasterized frame out of the GPU, and then upload it again as a new texture which a new frame processing pipeline could reference. Whether this idea is plausible would require some profiling.

    Using interframes in such a manner seems to imply that the entire codec would need to operate in RGB space and not YUV.

    Conclusions
    The people behind ORBX.js have apparently figured out a way to create a shader-based video codec. I have yet to even begin to reason out a plausible approach. However, I’m glad I did this exercise since I have finally broken through my ignorance regarding modern GPU shader programming. It’s nice to have a topic like multimedia that allows me a jumping-off point to explore other areas.

  • video after ffmpeg command conversion is not playing on windows

    10 décembre 2015, par Hemant Kumar

    I am stuck at a very weird and complex problem, hoping if anyone know the solution :

    I am converting user uploaded video using ffmpeg command on server and it was working fine as well. Today I found that if a video is recorded by a webcam from windows, is playing well in linux as well as on windows where as if user is creating a video by webcam from linux, is playing only on linux (any browser). On window it’s screen either show loading icon or black screen while audio is working fine.

    I am using following codec :

    ['-strict', '-2', '-preset slow', '-maxrate 500k', '-bufsize 1000k', vfOption, '-threads 0', '-ab 64k', '-movflags faststart','-vf scale=-1:480', '-metadata:s:v:0 rotate=0', '-vcodec libx264']

    I work on linux and using html5 player on my website. I am converting video in mp4 format.

    Input :

    ffmpeg -i /<server path="path">/stream_FE2AF05B-E630-1F7B-390B-37325B31B362.flv -strict -2 -vcodec libx264 -preset slow -vb 500k -maxrate 500k -bufsize 1000k -vf 'scale=-1:480 ' -threads 0 -ab 64k -s 640x480 -movflags faststart -metadata:s:v:0 rotate=0 /<server path="path">/testing.mp4
    </server></server>

    Output :

    ffmpeg version 2.2.5 Copyright (c) 2000-2014 the FFmpeg developers
     built on Aug  1 2014 09:24:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libtheora --enable-libx264 --enable-libvpx --enable-libmp3lame
     libavutil      52. 66.100 / 52. 66.100
     libavcodec     55. 52.102 / 55. 52.102
     libavformat    55. 33.100 / 55. 33.100
     libavdevice    55. 10.100 / 55. 10.100
     libavfilter     4.  2.100 /  4.  2.100
     libswscale      2.  5.102 /  2.  5.102
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, flv, from '/<server path="path">/stream_FE2AF05B-E630-1F7B-390B-37325B31B362.flv':
     Metadata:
       canSeekToEnd    : true
     Duration: 00:00:04.04, start: 0.000000, bitrate: 636 kb/s
       Stream #0:0: Video: flv1, yuv420p, 640x480, 1k tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: nellymoser, 44100 Hz, mono, flt
    [libx264 @ 0x23c5340] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x23c5340] profile High, level 5.2
    [libx264 @ 0x23c5340] 264 - core 142 r2453 ea0ca51 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=cbr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to '/<server path="path">/testing.mp4':
     Metadata:
       canSeekToEnd    : true
       encoder         : Lavf55.33.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480, q=-1--1, 500 kb/s, 16k tbn, 1k tbc
       Metadata:
         rotate          : 0
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 64 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (flv -> libx264)
     Stream #0:1 -> #0:1 (nellymoser -> aac)
    Press [q] to stop, [?] for help
    [mp4 @ 0x23c0200] Starting second pass: moving the moov atom to the beginning of the file2 drop=0    
    frame= 4020 fps=706 q=-1.0 Lsize=     355kB time=00:00:04.08 bitrate= 712.0kbits/s dup=3931 drop=0    
    video:271kB audio:32kB subtitle:0 data:0 global headers:0kB muxing overhead 16.957901%
    [libx264 @ 0x23c5340] frame I:17    Avg QP:27.55  size:  7119
    [libx264 @ 0x23c5340] frame P:1013  Avg QP:25.37  size:    88
    [libx264 @ 0x23c5340] frame B:2990  Avg QP:27.32  size:    22
    [libx264 @ 0x23c5340] consecutive B-frames:  0.8%  0.0%  0.1% 99.1%
    [libx264 @ 0x23c5340] mb I  I16..4: 42.0% 55.1%  2.9%
    [libx264 @ 0x23c5340] mb P  I16..4:  0.3%  0.4%  0.0%  P16..4:  0.6%  0.1%  0.0%  0.0%  0.0%    skip:98.6%
    [libx264 @ 0x23c5340] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.2%  0.0%  0.0%  direct: 0.0%  skip:99.8%  L0:35.7% L1:64.3% BI: 0.0%
    [libx264 @ 0x23c5340] 8x8 transform intra:55.0% inter:84.5%
    [libx264 @ 0x23c5340] direct mvs  spatial:87.6% temporal:12.4%
    [libx264 @ 0x23c5340] coded y,uvDC,uvAC intra: 33.4% 51.9% 0.7% inter: 0.0% 0.1% 0.0%
    [libx264 @ 0x23c5340] i16 v,h,dc,p: 26% 54% 15%  5%
    [libx264 @ 0x23c5340] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 16% 53%  3%  1%  2%  2%  3%  3%
    [libx264 @ 0x23c5340] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 20% 13% 14%  5%  7%  7% 11%  8%
    [libx264 @ 0x23c5340] i8c dc,h,v,p: 43% 31% 23%  3%
    [libx264 @ 0x23c5340] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x23c5340] ref P L0: 80.9%  9.0%  6.9%  2.6%  0.7%
    [libx264 @ 0x23c5340] ref B L0: 89.4%  8.6%  1.8%  0.2%
    [libx264 @ 0x23c5340] ref B L1: 91.0%  9.0%
    [libx264 @ 0x23c5340] kb/s:551.72
    </server></server>

    Outout from file recorded on window :

    Input :

    ffmpeg -i /<server path="path">/stream_window.flv -strict -2 -vcodec libx264 -preset slow -vb 500k -maxrate 500k -bufsize 1000k -vf 'scale=-1:480 ' -threads 0 -ab 64k -s 640x480 -movflags faststart -metadata:s:v:0 rotate=0 /<server path="path">/testing_1.mp4
    </server></server>

    Output :

    ffmpeg version 2.2.5 Copyright (c) 2000-2014 the FFmpeg developers
     built on Aug  1 2014 09:24:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libtheora --enable-libx264 --enable-libvpx --enable-libmp3lame
     libavutil      52. 66.100 / 52. 66.100
     libavcodec     55. 52.102 / 55. 52.102
     libavformat    55. 33.100 / 55. 33.100
     libavdevice    55. 10.100 / 55. 10.100
     libavfilter     4.  2.100 /  4.  2.100
     libswscale      2.  5.102 /  2.  5.102
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, flv, from '/<server path="path">/stream_window.flv':
     Metadata:
       canSeekToEnd    : true
     Duration: 00:00:09.22, start: 0.000000, bitrate: 420 kb/s
       Stream #0:0: Video: flv1, yuv420p, 640x480, 1k tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: nellymoser, 44100 Hz, mono, flt
    [libx264 @ 0x1e09fc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x1e09fc0] profile High, level 5.2
    [libx264 @ 0x1e09fc0] 264 - core 142 r2453 ea0ca51 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=cbr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to '/<server path="path">/testing_1.mp4':
     Metadata:
       canSeekToEnd    : true
       encoder         : Lavf55.33.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480, q=-1--1, 500 kb/s, 16k tbn, 1k tbc
       Metadata:
         rotate          : 0
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 64 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (flv -> libx264)
     Stream #0:1 -> #0:1 (nellymoser -> aac)
    Press [q] to stop, [?] for help
    [mp4 @ 0x1e06220] Starting second pass: moving the moov atom to the beginning of the file7 drop=0    
    frame= 8936 fps=703 q=-1.0 Lsize=     771kB time=00:00:09.26 bitrate= 681.5kbits/s dup=8907 drop=0    
    video:585kB audio:73kB subtitle:0 data:0 global headers:0kB muxing overhead 17.106213%
    [libx264 @ 0x1e09fc0] frame I:40    Avg QP:29.54  size:  7449
    [libx264 @ 0x1e09fc0] frame P:2248  Avg QP:30.88  size:    69
    [libx264 @ 0x1e09fc0] frame B:6648  Avg QP:39.17  size:    22
    [libx264 @ 0x1e09fc0] consecutive B-frames:  0.8%  0.0%  0.1% 99.1%
    [libx264 @ 0x1e09fc0] mb I  I16..4: 36.8% 60.7%  2.5%
    [libx264 @ 0x1e09fc0] mb P  I16..4:  0.2%  0.3%  0.0%  P16..4:  0.4%  0.0%  0.0%  0.0%  0.0%    skip:98.9%
    [libx264 @ 0x1e09fc0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.2%  0.0%  0.0%  direct: 0.0%  skip:99.8%  L0:34.2% L1:65.8% BI: 0.0%
    [libx264 @ 0x1e09fc0] 8x8 transform intra:60.6% inter:87.6%
    [libx264 @ 0x1e09fc0] direct mvs  spatial:72.8% temporal:27.2%
    [libx264 @ 0x1e09fc0] coded y,uvDC,uvAC intra: 36.3% 62.8% 4.7% inter: 0.0% 0.0% 0.0%
    [libx264 @ 0x1e09fc0] i16 v,h,dc,p: 33% 46% 15%  7%
    [libx264 @ 0x1e09fc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 19% 46%  3%  1%  1%  1%  2%  4%
    [libx264 @ 0x1e09fc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 17% 14%  9%  4%  4%  5%  5%  7%
    [libx264 @ 0x1e09fc0] i8c dc,h,v,p: 42% 31% 23%  4%
    [libx264 @ 0x1e09fc0] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x1e09fc0] ref P L0: 82.6%  9.9%  5.2%  1.7%  0.5%
    [libx264 @ 0x1e09fc0] ref B L0: 87.1% 11.0%  1.4%  0.4%
    [libx264 @ 0x1e09fc0] ref B L1: 90.3%  9.7%
    [libx264 @ 0x1e09fc0] kb/s:536.03
    </server></server>

    Can anyone figure what could be the problem ?

    @LordNeckbeard : Please find the command and its output above. Thanks