1

I have two files, rec.avi and audio_edited.wav, and what I'm trying to do is take the parts 00:30:50–01:42:56 and 02:16:55–04:03:10 of each file, concatenate those and encode them into an WebM file. My current command is partly copy-pasted from other questions here and looks like that:

ffmpeg -i rec.avi -i audio_edited.wav -filter_complex \
"[0:v]trim=start=1805:end=6176,setpts=PTS-STARTPTS[bv];\
 [1:a]atrim=start=1805:end=6176,asetpts=PTS-STARTPTS[ba];\
 [0:v]trim=start=8215:end=14590,setpts=PTS-STARTPTS[dv];\
 [1:a]atrim=start=8215:end=14590,asetpts=PTS-STARTPTS[da];\
 [bv][ba][dv][da]concat=n=2:v=1:a=1[outv][outa]" \
 -map [outv] -map [outa] -c:v libvpx -crf 10 -b:v 5M -c:a libvorbis out.webm

But when I try to run it, ffmpeg just stops at

frame=    0 fps=0.0 q=0.0 Lsize=       4kB time=00:00:00.00 bitrate=35808.0kbits/s    

and when I quit the command, I get the following messages:

[libvorbis @ 0x2549a60] Trying to remove 128 samples, but the queue is empty
[webm @ 0x243c820] Encoder did not produce proper pts, making some up.

Can someone give me a pointer? I'm at my wit's end.

Full output:

$ ./convert.sh
ffmpeg version 2.1.7 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  3 2015 22:57:36 with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-7)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[avi @ 0x23ff400] non-interleaved AVI
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, avi, from 'rec.avi':
  Duration: 04:05:14.04, start: 0.000000, bitrate: 104136 kb/s
    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc), 1920x1080, 102584 kb/s, 25 tbr, 25 tbn, 25 tbc
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, wav, from 'audio_edited.wav':
  Metadata:
    encoder         : Lavf55.19.104 (libsndfile-1.0.24)
  Duration: 04:05:14.04, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
File 'out.webm' already exists. Overwrite ? [y/N] y
[swscaler @ 0x2422680] deprecated pixel format used, make sure you did set range correctly
[libvpx @ 0x243a800] v1.3.0
Output #0, webm, to 'out.webm':
  Metadata:
    encoder         : Lavf55.19.104
    Stream #0:0: Video: vp8 (libvpx), yuv420p, 1920x1080, q=-1--1, 5000 kb/s, 1k tbn, 25 tbc (default)
    Stream #0:1: Audio: vorbis (libvorbis), 48000 Hz, stereo, fltp (default)
Stream mapping:
  Stream #0:0 (mjpeg) -> trim
  Stream #0:0 (mjpeg) -> trim
  Stream #1:0 (pcm_s16le) -> atrim
  Stream #1:0 (pcm_s16le) -> atrim
  concat:out:v0 -> Stream #0:0 (libvpx)
  concat:out:a0 -> Stream #0:1 (libvorbis)
Press [q] to stop, [?] for help
[libvorbis @ 0x2549a60] Trying to remove 128 samples, but the queue is empty
[webm @ 0x243c820] Encoder did not produce proper pts, making some up.
frame=    0 fps=0.0 q=0.0 Lsize=       4kB time=00:00:00.00 bitrate=35808.0kbits/s    
video:0kB audio:0kB subtitle:0 global headers:4kB muxing overhead 13.201821%
  • Trying a recent build is the first step when encountering issues. You can download a static build of ffmpeg. – llogan Mar 27 '15 at 0:48
  • I tried the git version, it didn't help unfortunately. – larsfu Mar 27 '15 at 16:59
0

I solved it: There is no problem at all with that command. It apparently just takes some time until ffmpeg has seeked through my AVI until it found the spot where I want it to begin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.