Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
Re: [opensuse] Again, trying to find a suitable video editor . trying ffmpeg and failing
On 2017-06-15 09:20, Dave Plater wrote:


On 10/03/2016 15:00, Carlos E. R. wrote:
On 2016-03-10 11:11, Carlos E. R. wrote:
On 2016-03-10 09:22, Carlos E. R. wrote:
On 2016-03-05 19:39, Carlos E. R. wrote:
........****

Thanks for retaking this old problem, but... see below.

In this stream, things are correct till 00:15:30, then choppiness
starts.


Does that tell something? :-?

Using the codec "copy", I get more interesting info:

time ffmpeg -i "La pelicula de la semana Star Trek.mpeg" -ss
00:05:44.600 -map 0:0 -map 0:1 -map 0:2 -c:v copy -c:a copy
StarTrek-Copy.mkv
...
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)
Output #0, matroska, to 'StarTrek-Copy.mkv':
Metadata:
encoder : Lavf57.25.100
Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p, 1920x1080 [SAR
1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 1k tbn, 90k tbc
Stream #0:1(esp): Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo,
192 kb/s (clean effects)
Stream #0:2(AU2): Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo,
128 kb/s (clean effects)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
[matroska @ 0x25a47c0] Timestamps are unset in a packet for stream 0.
This is deprecated and will stop working in the future. Fix your code
to set the timestamps properly
[matroska @ 0x25a47c0] Non-monotonous DTS in output stream 0:0;
previous: 929720, current: 929680; changing to 929720. This may result
in incorrect timestamps in the output file.
[matroska @ 0x25a47c0] Non-monotonous DTS in output stream 0:0;
previous: 929720, current: 929680; changing to 929720. This may result
in incorrect timestamps in the output file.
[matroska @ 0x25a47c0] Non-monotonous DTS in output stream 0:0;
previous: 929720, current: 929680; changing to 929720. This may result
in incorrect timestamps in the output file.
[matroska @ 0x25a47c0] Non-monotonous DTS in output stream 0:0;
previous: 929720, current: 929680; changing to 929720. This may result
in incorrect timestamps in the output file.
[mpegts @ 0x259cea0] PES packet size mismatch
Last message repeated 1 times
[matroska @ 0x25a47c0] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
[matroska @ 0x25a47c0] Can't write packet with unknown timestamp
Error writing trailer of StarTrek-Copy.mkv: Invalid
argumentframe=23239 fps=2508 q=-1.0 Lsize= 1060888kB time=00:15:29.72
bitrate=9347.8kbits/s speed= 100x
video:1024132kB audio:36313kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.041773%
Conversion failed!

real 0m9.804s
user 0m4.904s
sys 0m2.079s
cer@Telcontar:~/Videos/Fusion/trabajo>


It crashes that instant that the video and sound starts to be choppy.

Try starting your ffmpeg with -fflags genpts before anything else.
Dave P

As this was a year ago, I'm unsure I still have that video file, the symlink is
broken. I have to try see if I renamed it.

cer@Telcontar:~/Videos/Fusion/trabajo> locate Star\ Trek.mpeg
/home_aux/cer/Fusion/Cine Star Trek.mpeg
/home_aux/cer/Fusion/Hacer/Trek/Cine Star Trek.mpeg
/home_aux/cer/Fusion/trabajo/La pelicula de la semana Star Trek.mpeg
/home_aux/cer/Fusion/trabajo/La pelicula de la semana Star Trek.mpeg.idx2
cer@Telcontar:~/Videos/Fusion/trabajo>

cer@Telcontar:~/Videos/Fusion/trabajo> l La\ pelicula\ de\ la\ semana\ \ Star\
Trek.mpeg
lrwxrwxrwx 1 cer users 79 Mar 13 2016 La pelicula de la semana Star Trek.mpeg
-> /home_aux/cer/Fusion/Hechos.originales/La pelicula de la semana Star
Trek.mpeg


The symlink is broken, ie, it seems I no longer have that video sample. Maybe I
already converted it and deleted the original.


It might be this one:


cer@Telcontar:~/Videos/Fusion/trabajo> time ffmpeg -i ../Cine\ \ Star\
Trek.mpeg -ss 00:05:44.600 -map 0:0 -map 0:1 -map 0:2 -c:v copy -c:a copy
StarTrek-Copy.mkv
...
Input #0, mpegts, from '../Cine Star Trek.mpeg':
Duration: 02:12:01.94, start: 1.118100, bitrate: 7901 kb/s
Program 1
Stream #0:0[0x1e1]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(tv, bt709, top first), 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](vo): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
stereo, s16p, 128 kb/s (clean effects)
Stream #0:3[0x246](esp): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)

It is not the same video, the old one was "Duration: 03:01:02.68, start:
1.017833, bitrate: 9902 kb/s "


The current one also crashes - but I haven't checked if the cut point and sizes
are correct for this video:

Output #0, matroska, to 'StarTrek-Copy.mkv':
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(tv, bt709, top
first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 1k tbn, 90k tbc
Stream #0:1(esp): Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p,
192 kb/s (clean effects)
Stream #0:2(vo): Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p,
128 kb/s (clean effects)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
[matroska @ 0x21c2b40] Timestamps are unset in a packet for stream 0. This is
deprecated and will stop working in the future. Fix your code to set the
timestamps properly
[matroska @ 0x21c2b40] Non-monotonous DTS in output stream 0:0; previous:
180480, current: 180440; changing to 180480. This may result in incorrect
timestamps in the output file.
[matroska @ 0x21c2b40] Non-monotonous DTS in output stream 0:0; previous:
180480, current: 180440; changing to 180480. This may result in incorrect
timestamps in the output file.
[matroska @ 0x21c2b40] Non-monotonous DTS in output stream 0:0; previous:
180480, current: 180440; changing to 180480. This may result in incorrect
timestamps in the output file.
[matroska @ 0x21c2b40] Non-monotonous DTS in output stream 0:0; previous:
180480, current: 180440; changing to 180480. This may result in incorrect
timestamps in the output file.
[matroska @ 0x21c2b40] Non-monotonous DTS in output stream 0:0; previous:
180480, current: 180440; changing to 180480. This may result in incorrect
timestamps in the output file.
[matroska @ 0x21c2b40] Non-monotonous DTS in output stream 0:0; previous:
180480, current: 180440; changing to 180480. This may result in incorrect
timestamps in the output file.
[matroska @ 0x21c2b40] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
[matroska @ 0x21c2b40] Can't write packet with unknown timestamp
Error writing trailer of StarTrek-Copy.mkv: Invalid argument
frame= 4518 fps=2759 q=-1.0 Lsize= 161519kB time=00:03:00.92
bitrate=7313.5kbits/s speed= 110x
video:154874kB audio:7046kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
Conversion failed!


This message worries me:

┬źTimestamps are unset in a packet for stream 0. This is deprecated and will
stop working in the future. Fix your code to set the timestamps properly┬╗

It is impossible to "fix the code", as the video is a stream directly copied
from digital TV. Ie, it is what the broadcasters use.



From a conversation off-list about the original problem the solution then was
to use "-copyts". Like this:

time nice ffmpeg -i "La pelicula de la semana Star Trek.mpeg" -copyts -ss
00:05:45 -t 01:52:45.92 -map 0:0 -map 0:1 -map 0:2 -c:v libx264 -preset medium
-vf crop=19
20:804:0:138 -c:a copy StarTrek.mkv


--
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)

< Previous Next >
References