Merging Two .webm Files in Node.js using ffmpeg/mkvmerge

1,957 views
Skip to first unread message

ashok....@stuxbot.co.uk

unread,
Aug 27, 2013, 2:33:57 AM8/27/13
to webm-d...@webmproject.org
I tried to merge two .webm files in Node.js using ffmpeg and mkvmerge.
the webm files are made by whammy.js which uses an array of webp images in a given fps rate.

the ffmpeg doesnot give an error but the final output is only one of the file.

$ ffmpeg -i concat:"one.webm|two.webm" -codec copy output.webm
ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 31 2013 21:55:33 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[matroska,webm @ 0x7ffb63829c00] Unknown entry 0x63C5
Input #0, matroska,webm, from 'concat:one.webm|two.webm':
  Duration: 00:01:02.00, start: 0.000000, bitrate: 306 kb/s
    Stream #0:0: Video: vp8, yuv420p, 426x245, SAR 1:1 DAR 426:245, 2 tbr, 1k tbn, 1k tbc (default)
Output #0, webm, to 'output.webm':
  Metadata:
    encoder         : Lavf54.63.104
    Stream #0:0: Video: vp8, yuv420p, 426x245 [SAR 1:1 DAR 426:245], q=2-31, 1k tbn, 1k tbc (default)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[matroska,webm @ 0x7ffb63829c00] Unknown entry 0x1A45DFA3
[matroska,webm @ 0x7ffb63829c00] Unknown entry 0x18538067
frame=  124 fps=0.0 q=-1.0 Lsize=    1163kB time=00:01:01.50 bitrate= 154.9kbits/s    
video:1158kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.445548%


where as when i use mkv merge, it produces an error

$ mkvmerge -o output.webm one.webm +two.webm 
mkvmerge v5.8.0 ('No Sleep / Pillow') built on Aug 26 2013 13:58:43
Automatically enabling WebM compliance mode due to output file name extension.
Error: matroska_reader: A track is missing its track UID.
 
any suggestions would be helpful.

Vignesh Venkatasubramanian

unread,
Aug 27, 2013, 6:18:10 PM8/27/13
to webm-d...@webmproject.org
This should work: 
ffmpeg -f concat -i <(echo -e "file '$(pwd)/one.webm'\nfile '$(pwd)/two.webm'") -c copy -y output.webm

The -f concat was recently added, so make sure you have the latest version of ffmpeg (from their git repo).
 


where as when i use mkv merge, it produces an error

$ mkvmerge -o output.webm one.webm +two.webm 
mkvmerge v5.8.0 ('No Sleep / Pillow') built on Aug 26 2013 13:58:43
Automatically enabling WebM compliance mode due to output file name extension.
Error: matroska_reader: A track is missing its track UID.

This looks like an issue with whammy's Muxer. Looks like it isn't putting a track UID on one of the tracks.
 
 
any suggestions would be helpful.

--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.
To post to this group, send email to webm-d...@webmproject.org.
Visit this group at http://groups.google.com/a/webmproject.org/group/webm-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/groups/opt_out.



--
Vignesh Venkat | Software Engineer | vign...@google.com | 650-861-1330

Ashok Poudel

unread,
Aug 28, 2013, 12:17:20 AM8/28/13
to webm-d...@webmproject.org
Thanks, it worked like magic !!! :)

Swift Shawen

unread,
Nov 5, 2020, 1:15:56 AM11/5/20
to WebM Discussion, ashok....@stuxbot.co.uk
Share an easier way to merge two WebM files, using Joyoshare video joiner. I tried it myself. It helps me merge multiple WebM files into one in losslessly quality within 3 steps.
Reply all
Reply to author
Forward
0 new messages