I am trying to cut a small section of a video using the following sentence:
ffmpeg.exe -i video.wmv -ss 00:20:02 -to 00:20:09 -crf 22 "C:\test.mp4" -y
However, ffmpeg hangs showing messages like:
[asf # 03327b00] too long payload 0kB time=00:00:00.00 bitrate=N/A speed= 0x
Last message repeated 352 times
[asf # 03327b00] too long payload 0kB time=00:00:00.00 bitrate=N/A speed= 0x
Last message repeated 331 times
I have waited for more than 30 minutes and ffmpeg did not finish the cutting. Does anyone have any idea how to solve this?
Any suggestion will be appreciated
PD. the ffprobe output of the source file is the following:
ffprobe version N-81831-g97e7f03 Copyright (c) 2007-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 32.100 / 55. 32.100
libavcodec 57. 60.101 / 57. 60.101
libavformat 57. 51.102 / 57. 51.102
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 63.100 / 6. 63.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 2.100 / 2. 2.100
libpostproc 54. 0.100 / 54. 0.100
[asf # 03b7afe0] too long payload
Last message repeated 159 times
Input #0, asf, from 'F:\video.wmv':
Metadata:
WMFSDKVersion : 11.0.5721.5145
WMFSDKNeeded : 0.0.0.0000
IsVBR : 0
DeviceConformanceTemplate: M
Duration: 01:41:25.95, start: 0.000000, bitrate: 1649 kb/s
Stream #0:0(eng): Video: wmv2 (WMV2 / 0x32564D57), yuv420p, 640x480, 1500 kb/s, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc
Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, 2 channels, fltp, 128 kb/s
Related
I am new to ffmpeg and trying to figure out how to convert .MOD files to any generally readable format.
So far I was trying to
ffmpeg -i MOV00A.MOD -vcodec libx264 -acodec aac out.mp4
Result video is readable and has correct ratio aspect is correct but with artefacts like those horizontal lines:
My guess is that I might be using wrong codec but I do not understand which one to choose ?
Running ffmprobe on .MOD results:
ffprobe version 5.1.2 Copyright (c) 2007-2022 the FFmpeg developers
built with Apple clang version 14.0.0 (clang-1400.0.29.202)
configuration: --prefix=/usr/local/Cellar/ffmpeg/5.1.2_4 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, mpeg, from 'MOV00A.MOD':
Duration: 00:00:41.28, start: 0.262222, bitrate: 5285 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn
Side data:
cpb: bitrate max/min/avg: 9286000/0/0 buffer size: 1835008 vbv_delay: N/A
Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 256 kb/s
I have a VOB file holding an MPEG-2 video track with an AC-3 audio track. The video track of that VOB file consists of a single frame, which when played in a DVD player, holds that still frame until the audio track has finished.
How can I (with FFMPEG ideally), loop that frame to make a "normal" video track that lasts for the length of the audio track, rather than just a single frame?
ffmpeg version N-91999-g148a21611d Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20180813
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --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-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 19.101 / 56. 19.101
libavcodec 58. 30.100 / 58. 30.100
libavformat 58. 18.102 / 58. 18.102
libavdevice 58. 4.103 / 58. 4.103
libavfilter 7. 32.100 / 7. 32.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Input #0, mpeg, from '.\SINGLEFRAME.VOB':
Duration: 00:00:47.94, start: 0.336711, bitrate: 439 kb/s
Stream #0:0: Data: dvd_nav_packet
Stream #0:1: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 16:15 DAR 4:3], 8000 kb/s, 25 tbr, 90k tbn, 50 tbc
Stream #0:2: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
I try to record on RasperryPI from usb Cam (/dev/video0) using segments to obtain sliced video.
The command I'm using is:
ffmpeg -input_format mjpeg -video_size 640x480 -i /dev/video0 -y -y -f v4l2 -an -pix_fmt yuv420p -codec copy -f segment -segment_time 60 -segment_wrap 10 -t 180 stream/looper%02d.avi
I got an error after 2 minutes about skipped frames (see later for detail).
Is I run the same command without segmentation is working.
I tested on different HW, with different segment parameters, with different usb cam but the situation still the same.
Here there is the output:
ffmpeg version 4.1.4-1+rpt1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
configuration: --prefix=/usr --extra-version='1+rpt1~deb10u1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 40185.241073, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 640x480, 25 fps, 25 tbr, 1000k tbn, 1000k tbc
[segment # 0x9800b0] Opening 'stream/looper00.avi' for writing
Output #0, segment, to 'stream/looper%02d.avi':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 640x480, q=2-31, 25 fps, 25 tbr, 600 tbn, 1000k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[segment # 0x9800b0] Opening 'stream/looper01.avi' for writing/A speed=1.01x
[segment # 0x9800b0] Opening 'stream/looper02.avi' for writing/A speed=1.01x
[avi # 0x9822a0] Too large number of skipped frames 72034 > 60000speed=1.01x
av_interleaved_write_frame(): Invalid argument
[avi # 0x9822a0] Too large number of skipped frames 72034 > 60000
frame= 3011 fps= 25 q=-1.0 Lsize=N/A time=00:02:00.06 bitrate=N/A speed=1.01x
I did not find any suggestion to solve it.
Could you help me?
Thanks
Dario
I am extracting a clip from an mpg video using the following command.
ffmpeg.exe -i 271b.mpg -ss 00:00:05.000 -t 00:00:03.200 -c copy out_271b.mpg
I am using the copy parameter to avoid reencoding the clip.
The resulting mpg file only has the audio track, no video.
The following is the FFMpeg screen dump.
C:\ffmpeg-20170615\bin>ffmpeg.exe -i 271b.mpg -ss 00:00:05.000 -t 00:00:03.200 -c copy out_271b.mpg
ffmpeg version N-86482-gbc40674 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 66.100 / 55. 66.100
libavcodec 57. 99.100 / 57. 99.100
libavformat 57. 73.100 / 57. 73.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 92.100 / 6. 92.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, mpeg, from '271b.mpg':
Duration: 00:01:11.44, start: 0.460000, bitrate: 2154 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg, progressive), 640x480 [SAR 1:1 DAR 4:3], 2000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, mono, s16p, 128 kb/s
[mpeg # 0000000000666aa0] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'out_271b.mpg':
Metadata:
encoder : Lavf57.73.100
Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bt470bg, progressive), 640x480 [SAR 1:1 DAR 4:3], q=2-31, 2000 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0:1: Audio: mp2, 44100 Hz, mono, s16p, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 74 fps=0.0 q=-1.0 Lsize= 786kB time=00:00:03.17 bitrate=2027.2kbits/s speed= 198x
video:730kB audio:50kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.843343%
Thanks
Addition: I tried to open the generated clip file with ffplay and got the following results. Note that ffplay was able to open and play the original mpg file.
ffplay.exe out_271b.mpg
ffplay version N-86482-gbc40674 Copyright (c) 2003-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 66.100 / 55. 66.100
libavcodec 57. 99.100 / 57. 99.100
libavformat 57. 73.100 / 57. 73.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 92.100 / 6. 92.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
[mpeg # 00000000023cde80] probed stream 2 failedB sq= 0B f=0/0
[mpeg # 00000000023cde80] start time for stream 0 is not set in estimate_timings_from_pts
[mpeg # 00000000023cde80] Could not find codec parameters for stream 2 (Video: none, none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpeg, from 'out_271bb.mpg':
Duration: 00:00:03.22, start: 0.500000, bitrate: 2068 kb/s
Stream #0:0[0x1bf]: Data: dvd_nav_packet 0KB sq= 0B f=0/0
Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, mono, s16p, 128 kb/s
Stream #0:2[0x1e0]: Video: none, none, 25 fps, 25 tbr, 90k tbn
SDL_OpenAudio (1 channels, 44100 Hz): DirectSoundCreate: No audio device found
No more combinations to try, audio open failed
No codec could be found with id 0
Failed to open file 'out_271b.mpg' or configure filtergraph
I have written cygwin based shell script to concate 2 .mkv files as below,
#!/bin/sh
ffmpeg -f concat -i concat.txt -codec copy out.mkv
concat.txt contains path to 2 mkv files to be concatenated
file '../temp/1'
file '../temp/2'
when I run script from cygwin terminal I get following error
Rishi#Rishikesh /cygdrive/i/video/Interface_code/Testing_function/bin
$ . script.sh
ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 30 2014 17:13:24 with gcc 4.9.2 (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-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --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-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 13.100 / 56. 13.100
libavformat 56. 15.102 / 56. 15.102
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, concat, from 'concat.txt':
Duration: N/A, start: 0.000000, bitrate: 1536 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 720x576 [SAR 1:1 DAR 5:4], 25 fps, 25 tbr, 1k tbn, 50 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
'NULL # 04780280] Unable to find a suitable output format for 'out.mkv
: Invalid argument
another thing to add, if I run this command from cygwin terminal directly(instead of calling it through script) it runs correctly and creates concatenated output .mkv file
Applying dos2unix command on shell script file solved my problem. Hope it helps someone.