Re: [FFmpeg-user] Meaning of ffprobe output

2019-02-01 Thread Carl Eugen Hoyos
2019-02-02 0:43 GMT+01:00, Ulf Zibis :
>
> Am 01.02.19 um 23:25 schrieb Carl Eugen Hoyos:
>> 2019-02-01 23:14 GMT+01:00, Ulf Zibis :
>>> So now I understand (hopefully). My main interest was is to know,
>>> if my video is _encoded_ interlaced or not, and I still don't know it :-(
>> Debugging mpegvideo.c shows the video is encoded interlaced.
>> (Which was practically certain as the encoder couldn't know that
>> your content is progressive.)
>
> Do I understand right, that there is no way by ffprobe or some other
> option to know, if a video is _encoded_ interlaced or not?

I suspect there is but I may be wrong.
(It is not really helpful because users use it to decide if they
should de-interlace or not which is a bad idea.)

> You may remember my question and your answer:
> Am 15.01.19 um 12:54 schrieb Carl Eugen Hoyos:
>
>>> Which is the de-interlacing method, libx264 uses by default?
>> x264 is an encoder and knows nothing about de-interlacing,
>> it does not de-interlace.
>
> I meant, if libx264 does a re-encoding from interlaced
> encoding to progressive encoding?

libx264 does not encode "from interlaced encoding"
because it cannot know if the source was encoded
interlaced or progressive.

Please try to understand that we are only discussing
digital video here, and that all decoders only provide
frames (not fields) and all encoders expect frames
(not fields) - although all frames consist of two fields.
You can ask some encoders to encode the frames
in interlaced or progressive mode.

> That would mean, if I have an interlaced encoded vob
> stream I get a progressive encoded mp4 stream and
> the advantage of a better visual result of an interlacing
> display is lost with libx264. Am I right?

First:
There is no "interlacing display", in our context this does
not exist (anymore).
Second:
libx264 does support interlaced encoding (but not field
encoding because it does not help encoding efficiency).

Apart from that, it does severely hurt compressibility
if you don't set interlaced encoding for interlaced content.
(But the sample video you provided is not interlaced, it
is difficult to encode because of its abysmal quality.)

>>> If it is encoded interlaced, I can understand, that only a pair of
>>> lines can be cropped.
>> This is wrong, the output of the decoder is not different depending
>> on the used encoding method.
>
> So what is the technical reason, that I can't crop a single line for
> further processing?

This is a property (or a bug) of yuv420p and our crop filter
and not related to interlacing.

This is apart from the fact that the h.264 standard requires even
resolutions iirc.

Carl Eugen

PS: The hevc and the j2k decoder sometimes provide "fields"
(instead of frames) but this is completely unrelated: Because the
standards (luckily) do not support interlaced encoding, some
smart asses decided to send the two fields of an interlaced
frame as independent frames to the encoders and expect the
playback systems to reconstruct the original video.
This does not work with FFmpeg (out of the box).
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] Errors and discontinuities while GPU trancoding to H264

2019-02-01 Thread James E. Baird
Hello,

Looking for assistance on this issue I am struggling with. I am trying to take 
a live OTA stream (free-to-air broadcast) and transcode it (using Nvidia Quadro 
p2000 card) from mpeg2ts and ac3 to h264 and AAC. I need the output to be in 3 
separate bitrates and in UDP multicast format. Here is the source stream from 
ffprobe output (also gives you my version number for ffmpeg).

==Source:
gpu-transcoder:~$ ffprobe udp://@239.1.1.92:59092
ffprobe version N-93005-gd92f06e Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --prefix=/home/circle/ffmpeg_build --pkg-config-flags=--static 
--extra-cflags=-I/home/circle/ffmpeg_build/include 
--extra-ldflags=-L/home/circle/ffmpeg_build/lib --extra-libs='-lpthread -lm' 
--bindir=/home/circle/bin --enable-gpl --enable-libaom --enable-libass 
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus 
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 
--enable-nonfree --enable-nvenc
  libavutil  56. 26.100 / 56. 26.100
  libavcodec 58. 44.100 / 58. 44.100
  libavformat58. 26.100 / 58. 26.100
  libavdevice58.  6.101 / 58.  6.101
  libavfilter 7. 48.100 /  7. 48.100
  libswscale  5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc55.  4.100 / 55.  4.100
[mpeg2video @ 0x5582ad6afa40] Invalid frame dimensions 0x0.
Last message repeated 19 times
Input #0, mpegts, from 'udp://@239.1.1.92:59092':
  Duration: N/A, start: 73120.077033, bitrate: N/A
  Program 3
Stream #0:0[0x31]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), 
yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 
29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x34](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 
5.1(side), fltp, 384 kb/s
Stream #0:2[0x35](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 
stereo, fltp, 96 kb/s (visual impaired)


==So here is the command that I am using for the transcode:

ffmpeg -i 'udp://@239.1.1.92:59092?fifo_size=100_nonfatal=1' \
-c:v h264_nvenc -x264opts keyint=120:no-scenecut -b:v 6000k -minrate 6000k 
-maxrate 6000k -bufsize 12000k -profile:v high -level 4.0 -c:a aac -f mpegts 
udp://@239.129.2.220:59220 \
-c:v h264_nvenc -x264opts keyint=120:no-scenecut -b:v 3500k -minrate 3500k 
-maxrate 3500k -bufsize 9000k -profile:v high -level 4.0 -c:a aac -f mpegts 
udp://@239.129.2.221:59221 \
-c:v h264_nvenc -x264opts keyint=120:no-scenecut -b:v 1500k -minrate 1500k 
-maxrate 1500k -bufsize 3000k -profile:v high -level 4.0 -c:a aac -f mpegts 
udp://@239.129.2.222:59222


==Here is the output while the command is running:

gpu-transcoder:~$ ffmpeg -i 
'udp://@239.1.1.92:59092?fifo_size=100_nonfatal=1' -c:v h264_nvenc 
-x264opts keyint=120:no-scenecut -b:v 6000k -minrate 6000k -maxrate 6000k 
-bufsize 12000k -profile:v high -level 4.0 -c:a aac -f mpegts 
udp://@239.129.2.220:59220 -c:v h264_nvenc -x264opts keyint=120:no-scenecut 
-b:v 3500k -minrate 3500k -maxrate 3500k -bufsize 9000k -profile:v high -level 
4.0 -c:a aac -f mpegts udp://@239.129.2.221:59221 -c:v h264_nvenc -x264opts 
keyint=120:no-scenecut -b:v 1500k -minrate 1500k -maxrate 1500k -bufsize 3000k 
-profile:v high -level 4.0 -c:a aac -f mpegts udp://@239.129.2.222:59222
ffmpeg version N-93005-gd92f06e Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --prefix=/home/circle/ffmpeg_build --pkg-config-flags=--static 
--extra-cflags=-I/home/circle/ffmpeg_build/include 
--extra-ldflags=-L/home/circle/ffmpeg_build/lib --extra-libs='-lpthread -lm' 
--bindir=/home/circle/bin --enable-gpl --enable-libaom --enable-libass 
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus 
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 
--enable-nonfree --enable-nvenc
  libavutil  56. 26.100 / 56. 26.100
  libavcodec 58. 44.100 / 58. 44.100
  libavformat58. 26.100 / 58. 26.100
  libavdevice58.  6.101 / 58.  6.101
  libavfilter 7. 48.100 /  7. 48.100
  libswscale  5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc55.  4.100 / 55.  4.100
[mpeg2video @ 0x564c01e22f40] Invalid frame dimensions 0x0.
Last message repeated 29 times
Input #0, mpegts, from 
'udp://@239.1.1.92:59092?fifo_size=100_nonfatal=1':
  Duration: N/A, start: 73483.943033, bitrate: N/A
  Program 3
Stream #0:0[0x31]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), 
yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 
29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x34](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 
5.1(side), fltp, 384 kb/s
Stream #0:2[0x35](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 
stereo, fltp, 96 kb/s (visual impaired)
Codec AVOption x264opts (x264 options) specified for 

Re: [FFmpeg-user] Meaning of ffprobe output

2019-02-01 Thread Ulf Zibis

Am 01.02.19 um 20:00 schrieb Carl Eugen Hoyos:
> Yes, this is correct, yadif is able to nicely remove the interlace
> artefacts but I believe it leads to even more distortions in the
> rest of the video.

This matches to my experience. The best result I got was simply using
the atadenoise filter.

-Ulf

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Meaning of ffprobe output

2019-02-01 Thread Ulf Zibis

Am 01.02.19 um 23:25 schrieb Carl Eugen Hoyos:
> 2019-02-01 23:14 GMT+01:00, Ulf Zibis :
>> So now I understand (hopefully). My main interest was is to know,
>> if my video is _encoded_ interlaced or not, and I still don't know it :-(
> Debugging mpegvideo.c shows the video is encoded interlaced.
> (Which was practically certain as the encoder couldn't know that
> your content is progressive.)

Do I understand right, that there is no way by ffprobe or some other
option to know, if a video is _encoded_ interlaced or not?

You may remember my question and your answer:
Am 15.01.19 um 12:54 schrieb Carl Eugen Hoyos:

>> Which is the de-interlacing method, libx264 uses by default?
> x264 is an encoder and knows nothing about de-interlacing,
> it does not de-interlace.

I meant, if libx264 does a re-encoding from interlaced encoding to
progressive encoding?

That would mean, if I have an interlaced encoded vob stream I get a
progressive encoded mp4 stream and the advantage of a better visual
result of an interlacing display is lost with libx264. Am I right?

>> If it is encoded interlaced, I can understand, that only a pair of
>> lines can be cropped.
> This is wrong, the output of the decoder is not different depending
> on the used encoding method.

So what is the technical reason, that I can't crop a single line for
further processing?

Concerning my example I know, that I can use the fillborders filter, but
what to do if I want to do some other work with a single line?

-Ulf

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Meaning of ffprobe output

2019-02-01 Thread Ulf Zibis

Am 30.01.19 um 15:08 schrieb Carl Eugen Hoyos:
> Without interpolation, this is what all video players do if you disable
> all de-interlacing.
> The problem is what kind of "interpolation" you use, this is called
> de-interlacing, an endless number of algorithms exist.

OK, my understandig was, "de-interlacing" means to re-encode from
interlaced to progressive _and_ do some interpolation or whatever stuff.

-Ulf


___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Meaning of ffprobe output

2019-02-01 Thread Carl Eugen Hoyos
2019-02-01 23:14 GMT+01:00, Ulf Zibis :

> Am 31.01.19 um 13:48 schrieb Carl Eugen Hoyos:
>> DVD recorders can only produce interlaced files if the input
>> was interlaced, in this specific case, a file with progressive
>> content was produced (from progressive original).
>>
>> (Above of course only applies to the content of the file,
>> not the encoding. But when talking about de-interlacing
>> and the idet filter, only the content is relevant.)
>
> So now I understand (hopefully). My main interest was is to know,
> if my video is _encoded_ interlaced or not, and I still don't know it :-(

Debugging mpegvideo.c shows the video is encoded interlaced.
(Which was practically certain as the encoder couldn't know that
your content is progressive.)

> If it is encoded interlaced, I can understand, that only a pair of
> lines can be cropped.

This is wrong, the output of the decoder is not different depending
on the used encoding method.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Meaning of ffprobe output

2019-02-01 Thread Ulf Zibis
Hi,

again to my initial question ...

Am 31.01.19 um 13:48 schrieb Carl Eugen Hoyos:
> DVD recorders can only produce interlaced files if the input
> was interlaced, in this specific case, a file with progressive
> content was produced (from progressive original).
>
> (Above of course only applies to the content of the file,
> not the encoding. But when talking about de-interlacing
> and the idet filter, only the content is relevant.)
So now I understand (hopefully). My main interest was is to know, if my
video is _encoded_ interlaced or not, and I still don't know it :-(
If it is encoded interlaced, I can understand, that only a pair of lines
can be cropped.

I tried to crop a single line, but got an error:
$ ffmpeg -i CYD_6m_copy.vob -movflags faststart -vf
"split[in1][in2];[in1]crop=in_w:1:0:1[top];[in2]crop=in_w:in_h-1:0:1[main];[top][main]
vstack" -c:v libx264 -c:a copy CYD_6m_crop+copy-1l_H.264.mp4
ffmpeg version 4.1-static https://johnvansickle.com/ffmpeg/  Copyright
(c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
[]
Input #0, mpeg, from 'CYD_6m_copy.vob':
  Duration: 00:06:00.62, start: 0.50, bitrate: 7022 kb/s
    Stream #0:0[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg,
top first), 704x576 [SAR 12:11 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[Parsed_crop_1 @ 0x714df40] Invalid too big or non positive size for
width '704' or height '0'
[Parsed_crop_1 @ 0x714df40] Failed to configure input pad on Parsed_crop_1
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:1

What does it mean, that ffmpeg (ffprobe as same) says "top first"? Does
it mean, that my video is encoded interlaced?

If the content of my video is progressive, IHMO it would not harm to
re-encode it progressive, so I can crop single lines.

How can I do this?

-Ulf

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] ffmpeg ip cam stream with drawtext

2019-02-01 Thread Carl Eugen Hoyos
2019-01-28 19:39 GMT+01:00, frhun :
> Hi all
>
> I am new in the mail list.
> I from Hungary, I usualy helped sport competition, streaming to youtube...
>
> I hope someone helps me.
>
> I have a ip cam ( hikvision) , so far using only stream to youtube function.
>
> ( ffmpeg -re -rtsp_transport tcp -i
> rtsp://admin:x@192.168.2.25:554/Streaming/Channels/1 -tune
> zerolatency -vcodec libx264  -pix_fmt + -c:v copy -ac 1 -c:a aac -strict
> experimental -f flv rtmp://a.rtmp.youtube.com/live2/x-x-x-x )
>
> working as well,
> but now I want drawing text from dynamic text file.

Is the performance ok if you use a yuv420p image file
and use the overlay filter?
(If this works, you could try to update this file instead
of the text file.)
The overlay filter recently has seen optimizations and
I believe it is unlikely that you can get better than overlay.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Meaning of ffprobe output

2019-02-01 Thread Carl Eugen Hoyos
2019-02-01 19:40 GMT+01:00, Ulf Zibis :

> Am 31.01.19 um 00:18 schrieb Carl Eugen Hoyos:
>> This masterpiece (make sure you don't miss the imdb comment)
>> was most likely made with a film camera that knew nothing about
>> interlacing.
>
> I'm sure this is true at least for the opening credits, as there are
> flashing dropouts, typical for celluloid films. So here the
> masterpiece has progressive content, was telecined and in the
> end copied to VHS with interlaced signal.

Yes, this is correct, yadif is able to nicely remove the interlace
artefacts but I believe it leads to even more distortions in the
rest of the video.

> But for the rest of the video, I'm wondering that I nowhere notice such
> dropouts. IIRC I read, that the film was produced with a budget of
> 20.000 DM, which IMHO is not enough for a 76 min. celluloid film.

> Additionally in the turning camera scene from 2:34 I see comb
> artifacts, which are typical for interlaced video recordings (see
> attached extractions).

Definitely not interlaced (could be de-interlaced, but this doesn't
make much difference because of the other visual issues).

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Meaning of ffprobe output

2019-02-01 Thread Ulf Zibis
Hi again,

Am 31.01.19 um 00:18 schrieb Carl Eugen Hoyos:
> This masterpiece (make sure you don't miss the imdb comment)
> was most likely made with a film camera that knew nothing about
> interlacing.

I'm sure this is true at least for the opening credits, as there are
flashing dropouts, typical for celluloid films. So here the masterpiece
has progressive content, was telecined and in the end copied to VHS with
interlaced signal.
But for the rest of the video, I'm wondering that I nowhere notice such
dropouts. IIRC I read, that the film was produced with a budget of
20.000 DM, which IMHO is not enough for a 76 min. celluloid film.
Additionally in the turning camera scene from 2:34 I see comb artifacts,
which are typical for interlaced video recordings (see attached
extractions).

> The artefacts you see are afaict the result of the VHS drums not
> being able to keep 100% synchronization, 

This I would agree!

> Please avoid top-posting here, Carl Eugen

Sorry, what you mean by that?

-Ulf

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".