I want to download a video from a webpage. I found the m3u8 file and got the link, using them in FFmpeg, finally got something wrong.
Here is the capture of the beginning of the m3u8 file.
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:13
#EXTINF:10.080000,
https://ddcdn.jd.com/ddimg/jfs/t1/203028/24/17499/1876858/61a85ec0Ef32e255f/289bf6dd94343ed0.bmp
#EXTINF:10.000000,
https://ddcdn.jd.com/ddimg/jfs/t1/140366/35/22093/1147042/61a85ec0E850c8c8e/30b8a5e3032486ea.bmp
#EXTINF:10.000000,
https://ddcdn.jd.com/ddimg/jfs/t1/213475/10/6333/1554250/61a85ec0Ecc4703c3/39107a4d803fc188.bmp
#EXTINF:8.040000,
https://ddcdn.jd.com/ddimg/jfs/t1/205672/5/17259/1669682/61a85ec0Eff60ae58/fca014f8ef9bdcdc.bmp
#EXTINF:10.000000,
https://ddcdn.jd.com/ddimg/jfs/t1/217728/38/6334/1906374/61a85ec0Eeaf23ef5/d9ec645ad064f527.bmp
Here is what I input and output in the cmd.
Input
ffmpeg -i "https://hls.kmzhiqing.com/hls/m3u8/1452590c00595055de5750d1595519554f525372617d0d4061.m3u8" 1.mp4
Output
ffmpeg version N-100036-g3de3d2f5e2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3-win32 (GCC) 20200320
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-shared --disable-static --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --enable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
libavutil 56. 60.100 / 56. 60.100
libavcodec 58.113.100 / 58.113.100
libavformat 58. 64.100 / 58. 64.100
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 90.100 / 7. 90.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
[hls # 000001d87d857740] Skip ('#EXT-X-VERSION:3')
[hls # 000001d87d857740] Skip ('#EXT-X-ALLOW-CACHE:YES')
[hls # 000001d87d857740] Opening 'https://ddcdn.jd.com/ddimg/jfs/t1/203028/24/17499/1876858/61a85ec0Ef32e255f/289bf6dd94343ed0.bmp' for reading
[hls # 000001d87d857740] Opening 'https://ddcdn.jd.com/ddimg/jfs/t1/140366/35/22093/1147042/61a85ec0E850c8c8e/30b8a5e3032486ea.bmp' for reading
[hls # 000001d87d857740] Could not find codec parameters for stream 0 (Video: bmp, none): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, hls, from 'https://hls.kmzhiqing.com/hls/m3u8/1452590c00595055de5750d1595519554f525372617d0d4061.m3u8':
Duration: 00:24:24.60, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 0
Stream #0:0: Video: bmp, none, 25 tbr, 25 tbn, 25 tbc
Metadata:
variant_bitrate : 0
Output #0, mp4, to '1.mp4':
Output file #0 does not contain any stream
I found that the the link in the m3u8 file is a bmp file instead of mp4.
Does it matter????
Can anyone tell me how to download the mp4 video file?
Thank you for reading this!
Here try this:
-$ ffmpeg -i <http://url/.m3u8> -c copy -bsf:a aac_adtstoasc video_name.mp4
Related
Hi I am trying to capture desktop with ffmpeg gdigrab. I am using SSH connection to remotely use admin cmd on windows 10 pc. When i execute this command normally it works but remotely it doesnt.
ffmpeg -f gdigrab -framerate 30 -i desktop output.mkv
error message
ffmpeg version 4.4-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[gdigrab # 000001f3e781e600] Capturing whole desktop as 1024x768x32 at (0,0)
[gdigrab # 000001f3e781e600] Failed to capture image (error 5)
[gdigrab # 000001f3e781e600] Could not find codec parameters for stream 0 (Video: bmp, none, 754987 kb/s): unspecified size
Consider increasing the value for the 'analyzeduration' (15000000) and 'probesize' (70000000) options
Input #0, gdigrab, from 'desktop':
Duration: N/A, bitrate: 754987 kb/s
Stream #0:0: Video: bmp, none, 754987 kb/s, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
Output #0, matroska, to 'pipe:':
Output file #0 does not contain any stream
I tried to increase analyzeduration and probesize to max integer but it doesnt help.
While concatenating audio files with
ffmpeg -safe 0 -f concat
-segment_time_metadata 1
-i {m3u_file_name}
-vf select=concatdec_select
-af aselect=concatdec_select,aresample=async=1 {ogg_file_name}
I get the following output
ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, concat, from 'fm3u.m3u':
Duration: N/A, start: -0.006500, bitrate: N/A
Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
Stream mapping:
Stream #0:0 -> #0:0 (opus (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
Output #0, ogg, to 'fout.ogg':
Metadata:
encoder : Lavf57.83.100
Stream #0:0: Audio: vorbis (libvorbis), 48000 Hz, mono, fltp
Metadata:
encoder : Lavc57.107.100 libvorbis
[opus # 0x558b2c245400] Error parsing the packet header.
Error while decoding stream #0:0: Invalid data found when processing input
[opus # 0x558b2c245400] Error parsing the packet header.
Error while decoding stream #0:0: Invalid data found when processing input
[opus # 0x558b2c245400] Error parsing the packet header.
...
...
Error while decoding stream #0:0: Invalid data found when processing input
[opus # 0x558b2c245400] Error parsing the packet header.
Error while decoding stream #0:0: Invalid data found when processing input
size= 47kB time=00:00:10.84 bitrate= 35.2kbits/s speed=4.38x
video:0kB audio:42kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 10.251080%
/fout.ogg
The final audio sounds good.
ffprobe on the 2 participating files looks like
# ffprobe <FILE>
ffprobe version 3.4.8-0ubuntu0.2 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, ogg, from 'f1.ogg':
Duration: 00:00:01.08, start: 0.000000, bitrate: 34 kb/s
Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
# ffprobe <FILE>
ffprobe version 3.4.8-0ubuntu0.2 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, ogg, from 'f2.ogg':
Duration: 00:00:05.00, start: 0.000000, bitrate: 6 kb/s
Stream #0:0: Audio: vorbis, 48000 Hz, mono, fltp, 80 kb/s
Metadata:
ENCODER : Lavc57.107.100 libvorbis
What is the reason of the error?
As explained in this answer
"file-level concatenation (-f concat) requires all files in the listing to have the exact same codec parameters. "
In this case, the input files have codecs opus and vorbis.
To resolve the issue, I recreated some files (silence files) so they all have the same CODEC as the files I am mixing them with.
In particular, instead of creating them using:
ffmpeg -f lavfi -i anullsrc=r=48000:cl=mono -t 5.8 -c:a libvorbis silence-5.8.ogg
I use now (note libopus)
ffmpeg -f lavfi -i anullsrc=r=48000:cl=mono -t 5.8 -c:a libopus silence-5.8.ogg
And the "concat with ffmpeg" works without any problem.
I also tried
ffmpeg -f lavfi -i anullsrc=r=48000:cl=mono -t 5.8 -c:a opus silence-5.8.ogg
But that returns with
[opus # 0x5607f1765900] The encoder 'opus' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
[opus # 0x5607f1765900] Alternatively use the non experimental encoder 'libopus'.
So, libopus works just fine (no need for opus)
I have the raw video data from a video stream (no audio) and the duration when I play the raw video in VLC is ~67 seconds. When I convert the file to MP4 using FFMPEG the duration is 82.68 seconds.
Video is available here: https://www.filedropper.com/showdownload.php/67seconds
I am using FFMPEG/FFPROBE version git-2020-07-21-b5f1e05 on Windows.
Details of the raw video here:
ffprobe -i 67seconds.raw
ffprobe version git-2020-07-21-b5f1e05 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200621
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 55.100 / 56. 55.100
libavcodec 58. 97.100 / 58. 97.100
libavformat 58. 49.100 / 58. 49.100
libavdevice 58. 11.101 / 58. 11.101
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, h264, from '67seconds.raw':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc
The mp4 duration matches my ffprobe calculation against the raw file itself (2067/25 = 82.68 seconds):
ffprobe -show_entries stream=r_frame_rate,nb_read_frames -select_streams v -count_frames -of compact=p=0:nk=1 -v 0 67seconds.raw
25/1|2067
What would explain this difference in durations between the raw playback and the FFMPEG interpretation and how do I encode to the same duration for this and other stream data?
Here is the command I used and the output when I try and parse the .wav file into 30-second clips:
C:\Users\hmkur>ffmpeg -i C:\Users\hmkur\Desktop\Python\Transcribing_Audio\source\valve.wav -f segment -segment_time 30 -c copy parts/out%09d.wav
ffmpeg version git-2019-11-05-c54268c Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.2.1 (GCC) 20191010
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 35.101 / 56. 35.101
libavcodec 58. 60.100 / 58. 60.100
libavformat 58. 34.101 / 58. 34.101
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 66.100 / 7. 66.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
[wav # 0000023133098a00] Discarding ID3 tags because more suitable tags were found.
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'C:\Users\hmkur\Desktop\Python\Transcribing_Audio\source\valve.wav':
Metadata:
title : valve
encoder : Lavf58.20.100 (libsndfile-1.0.24)
Duration: 00:06:47.20, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
[segment # 00000231334d18c0] Opening 'parts/out000000000.wav' for writing
[segment # 00000231334d18c0] Failed to open segment 'parts/out000000000.wav'
Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Last message repeated 1 times
So, I have a directory full of files named motor_animate_000.gif, motor_animate_001.gif, etc.
I run:
ffmpeg -r 30 -i motor_animate_%03d.gif -r 30 motor.mpg
I expect to get a file called motor.mpg, but instead I get the usual bunch of printout, ending with:
motor_animate_%03d.gif: No such file or directory
What? This worked in Ubuntu 14.04, but doesn't work now. What I'm doing appears to be consistent with the ffmpeg man page. I'm now officially clueless. Thanks in advance.
Here's what I get when I try the alternate suggested below:
tim#Servo:~/Documents/Movies/dcmotor/animation$ ffmpeg -f image2 -framerate 30 -i motor_animate_%03d.gif motor.mpg
ffmpeg version 2.8.10-0ubuntu0.16.04.1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[image2 # 0x20bd420] Could not find codec parameters for stream 0 (Video: none, none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
motor_animate_%03d.gif: could not find codec parameters
Input #0, image2, from 'motor_animate_%03d.gif':
Duration: 00:00:04.03, start: 0.000000, bitrate: N/A
Stream #0:0: Video: none, none, 30 fps, 30 tbr, 30 tbn, 30 tbc
No decoder for stream #0:0, filtering impossible
Error opening filters!
The gif demuxer does not support a series of input files. You'll need to manually tell it to use the image file demuxer instead:
ffmpeg -f image2 -framerate 30 -i motor_animate_%03d.gif motor.mpg
The image file demuxer uses -framerate instead of -r.
You don't need to declare frame rate twice if you want to output to be the same as the input, so I removed the output -r.