Giter Club home page Giter Club logo

Comments (12)

bgrins avatar bgrins commented on July 19, 2024

Does this command work when you run it on a normal ffmpeg install?

from videoconverter.js.

dazlious avatar dazlious commented on July 19, 2024

Yes, it works. Also some other commands work with filter_complex. But not parameterized in JS.

In my opinion the arguments are cutted at the " or '

May you have an idea?

from videoconverter.js.

bgrins avatar bgrins commented on July 19, 2024

Yeah maybe it's a bug in the command parsing on the demo? Does it work if you change the worker.postMessage call to not split all of the fliter_complex stuff into it's own args:

                "-i",
                "big_buck_bunny.mp4",
                "-i",
                "big_buck_bunny_new.mp4",
                "-filter_complex",
                "[0:v] [0:a:0] [1:v] [1:a:0] concat=n=2:v=1:a=1 [v] [a]",
                "-map",
                "'[v]'",
                "-map" ,
                "'[a]'",
                "output.mp4"

You could also try removing the single quotes around the map parameters if that doesn't work.

from videoconverter.js.

dazlious avatar dazlious commented on July 19, 2024

Always receiving below error if executing in your demo at: http://bgrins.github.io/videoconverter.js/demo/
with command:

-i input.webm -i input.webm -filter_complex '[0:v] [0:a:0] [1:v] [1:a:0] concat=n=2:v=1:a=1 [v] [a]' -map '[v]' -map '[a]' output.mp4

with AND without single quotes

Worker has received command
Received command: -i input.webm -i input.webm -filter_complex '[0:v] [0:a:0] [1:v] [1:a:0] concat=n=2:v=1:a=1 [v] [a]' -map [v] -map [a] output.mp4.  Processing with 268435456 bits.
ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jun  9 2014 20:24:32 with emcc (Emscripten GCC-like replacement) 1.12.0 (commit 6960d2296299e96d43e694806f5d35799ef8d39c)
  configuration: --cc=emcc --prefix=/Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist --extra-cflags='-I/Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist/include -v' --enable-cross-compile --target-os=none --arch=x86_32 --cpu=generic --disable-ffplay --disable-ffprobe --disable-ffserver --disable-asm --disable-doc --disable-devices --disable-pthreads --disable-w32threads --disable-network --disable-hwaccels --disable-parsers --disable-bsfs --disable-debug --disable-protocols --disable-indevs --disable-outdevs --enable-protocol=file --enable-libvpx --enable-gpl --extra-libs='/Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist/lib/libx264.a /Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist/lib/libvpx.a'
  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
[vp8 @ 0xf03510] Warning: not compiled with thread support, using thread emulation
[vorbis @ 0xf03c20] Warning: not compiled with thread support, using thread emulation
Input #0, matroska,webm, from 'input.webm':
  Metadata:
    encoder         : Lavf53.21.0
  Duration: 00:00:33.01, start: 0.000000, bitrate: 570 kb/s
    Stream #0:0: Video: vp8, yuv420p, 640x356, SAR 1:1 DAR 160:89, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
    Stream #0:1: Audio: vorbis, 44100 Hz, stereo, fltp (default)
[vp8 @ 0xf050d0] Warning: not compiled with thread support, using thread emulation
[vorbis @ 0xf05750] Warning: not compiled with thread support, using thread emulation
Input #1, matroska,webm, from 'input.webm':
  Metadata:
    encoder         : Lavf53.21.0
  Duration: 00:00:33.01, start: 0.000000, bitrate: 570 kb/s
    Stream #1:0: Video: vp8, yuv420p, 640x356, SAR 1:1 DAR 160:89, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
    Stream #1:1: Audio: vorbis, 44100 Hz, stereo, fltp (default)
[AVFilterGraph @ 0xf977a0] No such filter: '[0:v]'
Error configuring filters.
Finished processing (took 176ms)

Also when entering it in my own application, where i don't use your split-function I receive this error

from videoconverter.js.

bgrins avatar bgrins commented on July 19, 2024

Here is a command that should work:

-i input.webm -i input.webm -v debug -strict -2 -filter_complex "[0:v] [0:a:0] [1:v] [1:a:0] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" output.mp4

from videoconverter.js.

bgrins avatar bgrins commented on July 19, 2024

(basically, the demo app is only treating double quoted strings as a single argument)

from videoconverter.js.

dazlious avatar dazlious commented on July 19, 2024

THANK YOU! That worked. Awesome

from videoconverter.js.

hyiso avatar hyiso commented on July 19, 2024

Got the same error when using arguments like this:

arguments: 
[
  "-i", 
  "sample1.mp4", 
  "-i", 
  "sample2.mp4", 
  "-filter_complex", 
  "\"[0:0] [1:0] concat=n=2:v=1:a=0 [v]\"", 
  "-map",
   "\"[v]\"",
   "concat.mp4"
]

and the error: Invalid stream specifier: "[v]". Stream map '"[v]"' matches no streams.
While this could run successfully in Terminal with normal ffmpeg.
btw, these two *.mp4 files don't have audio stream.

from videoconverter.js.

hyiso avatar hyiso commented on July 19, 2024

Update:
after changing my command to -i sample1.mp4 -i sample2.mp4 -filter_complex "[0:0] [1:0] concat=n=2:v=1 [v]" -map "[v]" output.mp4, the error becomesInvalid input colorspace Video encoding failed, and the output.mp4 can not be played

from videoconverter.js.

dazlious avatar dazlious commented on July 19, 2024

This sounds like an damaged mp4. Have you tried to use big buck bunny test-video? Only to check, if your testvideos are correct

from videoconverter.js.

hyiso avatar hyiso commented on July 19, 2024

Thx for quick reply.
Both the sample1.mp4 and sample2.mp4 are normal mp4 file.
When I tried this command in terminal with ffmpeg, the ouput.mp4 can be played.

It seems that their defference begins with:
in browser:

[libx264 @ 0xf7c480] using cpu capabilities: none!

in terminal:

[libx264 @ 0x7fa0c9802400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2

More stdout message in browser:

[h264 @ 0xede2d0] Warning: not compiled with thread support, using thread emulation
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    creation_time   : 2017-07-12 15:46:08
  Duration: 00:00:17.64, start: 0.000000, bitrate: 737 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540, 735 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
[h264 @ 0xee2ed0] Warning: not compiled with thread support, using thread emulation
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'sample2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    creation_time   : 2017-07-12 22:14:17
  Duration: 00:00:11.56, start: 0.000000, bitrate: 770 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540, 767 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
[libx264 @ 0xf7c480] Warning: not compiled with thread support, using thread emulation
[libx264 @ 0xf7c480] using cpu capabilities: none!
[libx264 @ 0xf7c480] profile High, level 3.1
[libx264 @ 0xf7c480] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyright 2003-2014 - 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=1 lookahead_threads=1 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=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
[h264 @ 0xede2d0] Warning: not compiled with thread support, using thread emulation
[h264 @ 0xee2ed0] Warning: not compiled with thread support, using thread emulation
Output #0, mp4, to 'output/output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    encoder         : Lavf55.33.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 960x540, q=-1--1, 12800 tbn, 25 tbc (default)
Stream mapping:
  Stream #0:0 (h264) -> concat:in0:v0
  Stream #1:0 (h264) -> concat:in1:v0
  concat -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
[libx264 @ 0xf7c480] Invalid input colorspace
Video encoding failed
Finished processing (took 1332ms)

And in terminal:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    creation_time   : 2017-07-12T15:46:08.000000Z
  Duration: 00:00:17.64, start: 0.000000, bitrate: 737 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540, 735 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'sample2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    creation_time   : 2017-07-12T22:14:17.000000Z
  Duration: 00:00:11.56, start: 0.000000, bitrate: 770 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540, 767 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 (h264) -> concat:in0:v0
  Stream #1:0 (h264) -> concat:in1:v0
  concat -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[libx264 @ 0x7fa0c9802400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fa0c9802400] profile High, level 3.1
[libx264 @ 0x7fa0c9802400] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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=6 lookahead_threads=1 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=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, mp4, to 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    encoder         : Lavf57.71.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 960x540, q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc57.89.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=  730 fps= 67 q=-1.0 Lsize=    3127kB time=00:00:29.08 bitrate= 880.8kbits/s speed=2.65x
video:3117kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.300754%
[libx264 @ 0x7fa0c9802400] frame I:4     Avg QP:17.28  size:109847
[libx264 @ 0x7fa0c9802400] frame P:199   Avg QP:20.52  size: 10709
[libx264 @ 0x7fa0c9802400] frame B:527   Avg QP:25.36  size:  1178
[libx264 @ 0x7fa0c9802400] consecutive B-frames:  1.2%  6.8%  2.1% 89.9%
[libx264 @ 0x7fa0c9802400] mb I  I16..4: 14.0% 54.3% 31.7%
[libx264 @ 0x7fa0c9802400] mb P  I16..4:  0.5%  1.0%  0.3%  P16..4: 35.1% 15.0% 11.2%  0.0%  0.0%    skip:36.9%
[libx264 @ 0x7fa0c9802400] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 34.8%  1.8%  0.4%  direct: 0.6%  skip:62.4%  L0:44.7% L1:53.0% BI: 2.3%
[libx264 @ 0x7fa0c9802400] 8x8 transform intra:55.5% inter:62.1%
[libx264 @ 0x7fa0c9802400] coded y,uvDC,uvAC intra: 67.8% 73.8% 42.6% inter: 7.9% 6.9% 0.3%
[libx264 @ 0x7fa0c9802400] i16 v,h,dc,p: 12% 52% 11% 26%
[libx264 @ 0x7fa0c9802400] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 14% 26%  6%  7%  7%  8%  7% 10%
[libx264 @ 0x7fa0c9802400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 14% 15%  8%  9%  8% 10%  8% 12%
[libx264 @ 0x7fa0c9802400] i8c dc,h,v,p: 56% 25% 13%  6%
[libx264 @ 0x7fa0c9802400] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fa0c9802400] ref P L0: 64.5% 21.5% 10.8%  3.1%
[libx264 @ 0x7fa0c9802400] ref B L0: 89.8%  8.5%  1.7%
[libx264 @ 0x7fa0c9802400] ref B L1: 97.2%  2.8%
[libx264 @ 0x7fa0c9802400] kb/s:874.33

from videoconverter.js.

hyiso avatar hyiso commented on July 19, 2024

So strange !!
I tried this command in the demo page with -i input.webm -i input.webm -strict -2 -filter_complex "[0:0][0:1] [1:0][1:1] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" output.mp4 and the output.mp4 is correct.

Maybe my mp4 file have lost some info...

from videoconverter.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.