On 2016-03-05 19:39, Carlos E. R. wrote:
Hi,
I simply can't find a suitable video editor that works.
My goal is to extract the interesting parts of a TV recording. Ie, mark
the start of the movie, the end, the commercials inside, and dump all
that into a single file, perhaps recoding.
Well, taking info from several posts here, I'm trying with ffmpeg in the CLI. I use
avidemux to find the cut points and the crop values. In the sample I'm testing, I have
to remove 138 lines top and bottom. The filter says that it is cropping from
"1920x1080 ==> 1920*804"
Thus the CLI option for ffmpeg has then to be "-vf crop=1920:804:0:138"
For start and end times, also use avidemux.
It starts on 00:05:44.600 and ends on 01:58:30.520.
The parameter for ffmpeg is start and duration, so calculate the duration in LO calc. It
becomes "-ss 00:05:44.600 -t 01:52:45.92"
I include "-maps" for all streams, and I add "-async" to protect
against sync errors. The full line becomes:
ffmpeg -i "Star Trek.mpeg" \
-ss 00:05:44.600 -t 01:52:45.92 \
-map 0:0 -map 0:1 -map 0:2 \
-q:v 4 -q:a 1 -async 1 -vcodec libxvid \
-vf crop=1920:804:0:138 \
-acodec libmp3lame StarTrek.avi
However, the movie ends short: the timestamps in the resulting video does not match those
in the input. I had to convert the entire input file, after failing on 3 earlier attempts
that also ended short. The stop point in the output is 3:14:25, which is absurd. The
problem may be different.
(It would be nice to be able to do a fast and dirty conversion for these tests, instead of
waiting an hour or two for each test, but I don't know how)
The problem is that sound is choppy, but not at the start, but since the point 15:30.
There is a chirp, then the sound plays and mutes every second. Maybe those silent periods
every second are adding to the total play time. As it is, of course, the movie is
unwatchable.
The full output on the CLI is:
cer@Telcontar:~/Videos/Fusion/trabajo> ffmpeg -i "La pelicula de la semana Star
Trek.mpeg" -ss 00:05:44.600 -map 0:0 -map 0:1 -map 0:2 -q:v 4 -q:a 1 -async 1
-vcodec libxvid -vf crop=1920:804:0:138 -acodec libmp3lame StarTrek.avi
ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8 (SUSE Linux)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
--incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches
-fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables
-fasynchronous-unwind-tables -g' --optflags='-fmessage-length=0
-grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables
-fasynchronous-unwind-tables -g' --disable-htmlpages --enable-pic --disable-stripping
--enable-shared --disable-static --enable-runtime-cpudetect --enable-gpl --disable-openssl
--enable-avresample --enable-libcdio --enable-gnutls --enable-ladspa --enable-libass
--enable-libbluray --enable-libcelt --enable-libcdio --enable-libdc1394
--enable-libfreetype --enable-libgsm --enable-libopenjpeg --enable-libopus
--enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libvorbis --enable-libvpx --enable-libwebp --enable-pic --enable-pthreads
--enable-vaapi --enable-vdpau --disable-decoder=dca --
enable-libdcadec --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-version3 --enable-libtwolame --enable-libx264 --enable-libx265 --enable-libxvid
--enable-x11grab
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
[h264 @ 0x703280] mmco: unref short failure
[h264 @ 0x703280] Increasing reorder buffer to 2
[h264 @ 0x703280] Increasing reorder buffer to 3
[h264 @ 0x703280] mmco: unref short failure
Input #0, mpegts, from 'La pelicula de la semana Star Trek.mpeg':
Duration: 03:01:02.68, start: 1.017833, bitrate: 9902 kb/s
Program 1
Stream #0:0[0x1e1]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709),
1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1e2](esp): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p,
192 kb/s (clean effects)
Stream #0:2[0x1e3](AU2): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p,
128 kb/s (clean effects)
File 'StarTrek.avi' already exists. Overwrite ? [y/N] y
-async is forwarded to lavfi similarly to -af
aresample=async=1:min_hard_comp=0.100000:first_pts=0.
Last message repeated 1 times
Output #0, avi, to 'StarTrek.avi':
Metadata:
ISFT : Lavf57.25.100
Stream #0:0: Video: mpeg4 (libxvid) (xvid / 0x64697678), yuv420p, 1920x804 [SAR 1:1
DAR 160:67], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc57.24.102 libxvid
Stream #0:1(esp): Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo,
s16p (clean effects)
Metadata:
encoder : Lavc57.24.102 libmp3lame
Stream #0:2(AU2): Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo,
s16p (clean effects)
Metadata:
encoder : Lavc57.24.102 libmp3lame
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (libxvid))
Stream #0:1 -> #0:1 (mp2 (native) -> mp3 (libmp3lame))
Stream #0:2 -> #0:2 (mp2 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[h264 @ 0x25fa5e0] mmco: unref short failure
[h264 @ 0x26cf940] mmco: unref short failure
[h264 @ 0x25a1300] mmco: unref short failureme=00:15:29.44 bitrate=5716.4kbits/s
speed=0.858x
[mpegts @ 0x6feee0] PES packet size mismatch
Last message repeated 1 times
[mp2 @ 0x705e80] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
[mp2 @ 0x706340] Header missing
Error while decoding stream #0:2: Invalid data found when processing input
[h264 @ 0x2688800] mmco: unref short failure
[h264 @ 0x25fa5e0] left block unavailable for requested intra mode at 0 12bits/s dup=0
drop=10 speed=1.08x
[h264 @ 0x25fa5e0] error while decoding MB 0 12, bytestream 2428
[h264 @ 0x25fa5e0] concealing 6769 DC, 6769 AC, 6769 MV errors in I frame
[h264 @ 0x26416c0] reference picture missing during reorder
Last message repeated 1 times
[h264 @ 0x26416c0] Missing reference picture, default is 65608
Last message repeated 1 times
[h264 @ 0x2688800] mmco: unref short failure
[h264 @ 0x26cf940] co located POCs unavailable=00:25:51.08 bitrate=4344.6kbits/s dup=0
drop=10 speed=1.08x
[h264 @ 0x25a1300] co located POCs unavailable
[h264 @ 0x25fa5e0] mmco: unref short failure
[h264 @ 0x2688800] Reference 2 >= 22864kB time=00:25:51.84 bitrate=4343.8kbits/s dup=0
drop=10 speed=1.08x
[h264 @ 0x2688800] error while decoding MB 73 18, bytestream 13349
[h264 @ 0x2688800] concealing 5976 DC, 5976 AC, 5976 MV errors in B frame
[h264 @ 0x26cf940] co located POCs unavailable
[h264 @ 0x25fa5e0] mmco: unref short failureme=00:25:52.89 bitrate=4344.7kbits/s dup=0
drop=10 speed=1.09x
[h264 @ 0x26cf940] mmco: unref short failure
[h264 @ 0x25a1300] left block unavailable for requested intra mode at 0 22bits/s dup=0
drop=10 speed= 1.3x
[h264 @ 0x25a1300] error while decoding MB 0 22, bytestream 46017
[h264 @ 0x25a1300] concealing 5569 DC, 5569 AC, 5569 MV errors in P frame
[h264 @ 0x25fa5e0] co located POCs unavailable
[h264 @ 0x26416c0] co located POCs unavailable
[h264 @ 0x25a1300] co located POCs unavailable=00:57:47.72 bitrate=3501.0kbits/s dup=0
drop=10 speed= 1.3x
[h264 @ 0x2688800] reference picture missing during reorder
Last message repeated 1 times
[h264 @ 0x2688800] Missing reference picture, default is 65550
Last message repeated 1 times
[h264 @ 0x26416c0] mmco: unref short failure
[mpegts @ 0x6feee0] PES packet size mismatchme=00:57:49.20 bitrate=3499.9kbits/s dup=0
drop=10 speed= 1.3x
[h264 @ 0x25fa5e0] concealing 960 DC, 960 AC, 960 MV errors in B frame
[h264 @ 0x26416c0] co located POCs unavailable
[h264 @ 0x2688800] number of reference frames (0+5) exceeds max (4; probably corrupt
input), discarding one
[mp2 @ 0x705e80] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0x2688800] co located POCs unavailable
[h264 @ 0x25fa5e0] co located POCs unavailable
[h264 @ 0x25a1300] mmco: unref short failure
[h264 @ 0x2688800] mmco: unref short failureme=00:57:51.57 bitrate=3497.5kbits/s dup=0
drop=10 speed= 1.3x
Past duration 0.999992 too large 3016122kB time=02:05:30.28 bitrate=3281.2kbits/s dup=0
drop=10 speed=1.19x
Last message repeated 3 times
Past duration 0.999992 too large 3016455kB time=02:05:30.56 bitrate=3281.4kbits/s dup=0
drop=10 speed=1.19x
Last message repeated 6 times
Past duration 0.999992 too large 3016510kB time=02:05:30.84 bitrate=3281.3kbits/s dup=0
drop=10 speed=1.19x
Last message repeated 1 times
[mpegts @ 0x6feee0] PES packet size mismatchime=02:08:40.64 bitrate=3253.7kbits/s dup=0
drop=10 speed= 1.2x
[mp2 @ 0x705e80] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0x25fa5e0] concealing 1880 DC, 1880 AC, 1880 MV errors in I frame
[h264 @ 0x26416c0] co located POCs unavailable
[h264 @ 0x2688800] co located POCs unavailable
[h264 @ 0x25fa5e0] co located POCs unavailable
[h264 @ 0x26cf940] reference picture missing during reorder
[h264 @ 0x26cf940] Missing reference picture, default is 65646
[h264 @ 0x25a1300] mmco: unref short failure
[h264 @ 0x26416c0] reference picture missing during reorder
[h264 @ 0x26416c0] Missing reference picture, default is 65662
[h264 @ 0x2688800] mmco: unref short failure
[h264 @ 0x25a1300] left block unavailable for requested intra mode at 0 32kbits/s dup=0
drop=10 speed= 1.2x
[h264 @ 0x25a1300] error while decoding MB 0 32, bytestream 32731
[h264 @ 0x25a1300] concealing 4369 DC, 4369 AC, 4369 MV errors in I frame
[h264 @ 0x25fa5e0] co located POCs unavailable
[h264 @ 0x26416c0] co located POCs unavailable
[h264 @ 0x2688800] co located POCs unavailable
[mpegts @ 0x6feee0] PES packet size mismatch
[h264 @ 0x26cf940] co located POCs unavailable
[mp2 @ 0x706340] Header missing
Error while decoding stream #0:2: Invalid data found when processing input
[h264 @ 0x25fa5e0] reference picture missing during reorder
Last message repeated 1 times
[h264 @ 0x25fa5e0] Missing reference picture, default is 65566
Last message repeated 1 times
[h264 @ 0x25a1300] mmco: unref short failure
[h264 @ 0x26cf940] left block unavailable for requested intra4x4 mode -1 at 0 18s dup=0
drop=10 speed=1.23x
[h264 @ 0x26cf940] error while decoding MB 0 18, bytestream 10738
[h264 @ 0x26cf940] concealing 6049 DC, 6049 AC, 6049 MV errors in I frame
[h264 @ 0x25a1300] co located POCs unavailable
[h264 @ 0x26416c0] reference picture missing during reorder bitrate=3216.8kbits/s dup=0
drop=10 speed=1.23x
Last message repeated 1 times
[h264 @ 0x26416c0] Missing reference picture, default is 65646
Last message repeated 1 times
[h264 @ 0x2688800] mmco: unref short failure
[h264 @ 0x25fa5e0] mmco: unref short failureime=02:24:43.32 bitrate=3215.8kbits/s dup=0
drop=10 speed=1.23x
[h264 @ 0x26cf940] concealing 4464 DC, 4464 AC, 4464 MV errors in B frame7kbits/s dup=0
drop=10 speed=1.23x
[h264 @ 0x25a1300] co located POCs unavailable
[h264 @ 0x25fa5e0] co located POCs unavailable
[h264 @ 0x26cf940] co located POCs unavailablee=02:24:44.60 bitrate=3216.2kbits/s dup=0
drop=10 speed=1.23x
[mpegts @ 0x6feee0] PES packet size mismatch
[mp2 @ 0x705e80] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0x26416c0] reference picture missing during reorder
Last message repeated 1 times
[h264 @ 0x26416c0] Missing reference picture, default is 65550
Last message repeated 1 times
[h264 @ 0x25a1300] reference picture missing during reorder
[h264 @ 0x25a1300] Missing reference picture, default is 65566
[h264 @ 0x25fa5e0] mmco: unref short failure
[h264 @ 0x26cf940] concealing 2131 DC, 2131 AC, 2131 MV errors in B frame7kbits/s dup=0
drop=10 speed=1.25x
[mpegts @ 0x6feee0] DTS 633356805 < 633587205 out of order
[h264 @ 0x25a1300] co located POCs unavailable
[h264 @ 0x25fa5e0] co located POCs unavailable
[mpegts @ 0x6feee0] PES packet size mismatch
[mp2 @ 0x706340] Header missing= 4510495kB time=03:12:06.40 bitrate=3205.7kbits/s dup=0
drop=10 speed=1.25x
Error while decoding stream #0:2: Invalid data found when processing input
[h264 @ 0x26416c0] co located POCs unavailable
[h264 @ 0x2688800] co located POCs unavailable
[h264 @ 0x25a1300] reference picture missing during reorder
Last message repeated 1 times
[h264 @ 0x25a1300] Missing reference picture, default is 65710
Last message repeated 1 times
[h264 @ 0x26cf940] mmco: unref short failure
[h264 @ 0x26cf940] Reference 2 >= 210806kB time=03:12:09.02 bitrate=3205.2kbits/s dup=0
drop=10 speed=1.25x
[h264 @ 0x26cf940] error while decoding MB 11 46, bytestream 93852
[h264 @ 0x26cf940] concealing 2678 DC, 2678 AC, 2678 MV errors in B frame
[h264 @ 0x25a1300] co located POCs unavailable
[h264 @ 0x25fa5e0] number of reference frames (0+5) exceeds max (4; probably corrupt
input), discarding one
[h264 @ 0x25a1300] Reference 2 >= 272955kB time=03:43:53.40 bitrate=3093.6kbits/s dup=0
drop=10 speed=1.27x
[h264 @ 0x25a1300] error while decoding MB 99 38, bytestream 189042
[h264 @ 0x25a1300] concealing 3550 DC, 3550 AC, 3550 MV errors in P frame
[h264 @ 0x25fa5e0] co located POCs unavailable
[h264 @ 0x2688800] reference picture missing during reorder bitrate=3093.5kbits/s dup=0
drop=10 speed=1.27x
Last message repeated 1 times
[h264 @ 0x2688800] Missing reference picture, default is 65694
Last message repeated 1 times
[h264 @ 0x26cf940] mmco: unref short failure
[h264 @ 0x26416c0] mmco: unref short failureime=03:43:54.68 bitrate=3093.5kbits/s dup=0
drop=10 speed=1.27x
[mpegts @ 0x6feee0] PES packet size mismatchime=03:43:55.28 bitrate=3093.7kbits/s dup=0
drop=10 speed=1.27x
[h264 @ 0x2688800] Reference 3 >= 2
[h264 @ 0x2688800] error while decoding MB 58 28, bytestream 67150
[h264 @ 0x2688800] concealing 4791 DC, 4791 AC, 4791 MV errors in B frame
[h264 @ 0x26cf940] co located POCs unavailable
[h264 @ 0x25a1300] number of reference frames (0+5) exceeds max (4; probably corrupt
input), discarding one
[mp2 @ 0x706340] Header missing
Error while decoding stream #0:2: Invalid data found when processing input
[h264 @ 0x25fa5e0] co located POCs unavailable
[mpegts @ 0x6feee0] PES packet size mismatchime=03:59:51.86 bitrate=3030.2kbits/s dup=0
drop=10 speed=1.29x
Last message repeated 1 times
[mp2 @ 0x706340] Header missing
Error while decoding stream #0:2: Invalid data found when processing input
[h264 @ 0x25fa5e0] Reference 2 >= 2
[h264 @ 0x25fa5e0] error while decoding MB 77 62, bytestream 34200
[h264 @ 0x25fa5e0] concealing 692 DC, 692 AC, 692 MV errors in B frame
[h264 @ 0x26416c0] co located POCs unavailable
[h264 @ 0x2688800] co located POCs unavailable
[mp2 @ 0x705e80] Header missing= 5323692kB time=03:59:52.96 bitrate=3030.1kbits/s dup=0
drop=10 speed=1.29x
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0x26cf940] co located POCs unavailable
[h264 @ 0x25a1300] co located POCs unavailable
[h264 @ 0x25fa5e0] co located POCs unavailable
[h264 @ 0x2688800] reference picture missing during reorder
Last message repeated 1 times
[h264 @ 0x2688800] Missing reference picture, default is 65614
Last message repeated 1 times
[h264 @ 0x26416c0] mmco: unref short failure
[mpegts @ 0x6feee0] PES packet size mismatch
[h264 @ 0x25a1300] concealing 2151 DC, 2151 AC, 2151 MV errors in B frame
[h264 @ 0x26416c0] co located POCs unavailable
[mp2 @ 0x705e80] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0x25a1300] mmco: unref short failure
[mpegts @ 0x6feee0] PES packet size mismatchime=04:47:32.48 bitrate=3106.2kbits/s dup=0
drop=10 speed=1.31x
[h264 @ 0x25a1300] Reference 2 >= 2
[h264 @ 0x25a1300] error while decoding MB 18 6, bytestream 1959
[h264 @ 0x25a1300] concealing 7471 DC, 7471 AC, 7471 MV errors in B frame
[h264 @ 0x25fa5e0] co located POCs unavailablee=04:47:33.20 bitrate=3106.3kbits/s dup=0
drop=10 speed=1.31x
[h264 @ 0x26416c0] co located POCs unavailable
[h264 @ 0x2688800] co located POCs unavailable
[h264 @ 0x26cf940] co located POCs unavailable
[h264 @ 0x25a1300] co located POCs unavailable
[mp2 @ 0x706340] Header missing
Error while decoding stream #0:2: Invalid data found when processing input
[h264 @ 0x2688800] mmco: unref short failure
[h264 @ 0x25fa5e0] mmco: unref short failure
[mpegts @ 0x6feee0] PES packet size mismatch
[h264 @ 0x25a1300] cabac decode of qscale diff failed at 2 25
[h264 @ 0x25a1300] error while decoding MB 2 24, bytestream 20871
[h264 @ 0x25a1300] concealing 5327 DC, 5327 AC, 5327 MV errors in B frame
[mp2 @ 0x705e80] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0x25fa5e0] co located POCs unavailable
[h264 @ 0x2688800] mmco: unref short failure
[h264 @ 0x25fa5e0] mmco: unref short failureime=04:47:41.60 bitrate=3104.8kbits/s dup=0
drop=10 speed=1.31x
frame=262498 fps= 19 q=4.0 Lsize= 7090588kB time=05:09:59.08 bitrate=3123.1kbits/s dup=0
drop=10 speed=1.33x
video:6468443kB audio:586667kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead: 0.502870%
cer@Telcontar:~
I converted 3 other movies, without stop point, for further verification:
a) Same choppy sound after 00:17:46 (different TV channel)
b) Same choppy sound after 00:40:02 (same channel as 'a')
c) Same choppy sound after 00:48:15 (different TV channel). With a commercial in the
middle.
So, unless I find an option to ffmpeg that corrects the choppiness, conversion is
impossible.
--
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 "Bottle" at Telcontar)