Re: Beaglebone - streaming issue - horizontal lines in output

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Beaglebone - streaming issue - horizontal lines in output

Philip Chisholm
Hi Carl

I have been working on my issue.
And testing out just an output to a mp3 file...
I am still getting the same problem.

The issue is the weird horizontal lines.
See attached video.
I am guess some sort of pixel indexing - issue...

Note - using debian on beaglebone green wifi

And I built ffmpeg (with --neon)


***

Command line used:

ffmpeg -video_size 320x240 -framerate 30 -i /dev/video0 -pix_fmt yuv422p -c:v libx264 testvd.mp4



***
debian@beaglebone:~/ffmpeg$ ffmpeg -video_size 320x240 -framerate 30 -i /dev/video0 -pix_fmt yuv422p -c:v libx264 testvd.mp4
ffmpeg version N-95495-gf7f4691f9f Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-shared --enable-libx264 --enable-gpl --enable-neon
  libavutil      56. 35.101 / 56. 35.101
  libavcodec     58. 59.102 / 58. 59.102
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 64.100 /  7. 64.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 95810.955189, bitrate: 36864 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
File 'testvd.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x2269580] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x2269580] profile High 4:2:2, level 1.3, 4:2:2, 8-bit
[libx264 @ 0x2269580] 264 - core 157 r2969 d4099dd - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'testvd.mp4':
  Metadata:
    encoder         : Lavf58.33.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv422p, 320x240, q=-1--1, 30 fps, 15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.59.102 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=   44 fps=0.0 q=29.0 size=       0kB time=00:00:00.00 bitrate=5907.7kbits/s dup=27 drop=0 speed=8.86e-05x frame=  128 fps=7.0 q=29.0 Lsize=     283kB time=00:00:04.16 bitrate= 556.6kbits/s dup=58 drop=0 speed=0.227x  
video:281kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.821830%
[libx264 @ 0x2269580] frame I:1     Avg QP:23.63  size: 21886
[libx264 @ 0x2269580] frame P:36    Avg QP:26.89  size:  5723
[libx264 @ 0x2269580] frame B:91    Avg QP:31.06  size:   648
[libx264 @ 0x2269580] consecutive B-frames:  0.8% 12.5%  2.3% 84.4%
[libx264 @ 0x2269580] mb I  I16..4:  1.7% 19.7% 78.7%
[libx264 @ 0x2269580] mb P  I16..4:  1.0%  1.6%  2.6%  P16..4: 43.2% 23.9% 16.3%  0.0%  0.0%    skip:11.3%
[libx264 @ 0x2269580] mb B  I16..4:  0.3%  0.0%  0.3%  B16..8: 23.8%  5.2%  1.4%  direct: 3.1%  skip:66.0%  L0:52.5% L1:36.3% BI:11.2%
[libx264 @ 0x2269580] 8x8 transform intra:23.1% inter:32.2%
[libx264 @ 0x2269580] coded y,uvDC,uvAC intra: 79.3% 95.6% 80.1% inter: 20.1% 21.2% 5.1%
[libx264 @ 0x2269580] i16 v,h,dc,p:  5% 79%  1% 15%
[libx264 @ 0x2269580] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 19% 18%  7%  7%  9%  8% 10%  8%
[libx264 @ 0x2269580] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 32% 20%  5%  4%  4%  5%  5%  5%
[libx264 @ 0x2269580] i8c dc,h,v,p: 48% 28% 16%  7%
[libx264 @ 0x2269580] Weighted P-Frames: Y:16.7% UV:13.9%
[libx264 @ 0x2269580] ref P L0: 40.6%  6.3% 32.3% 19.8%  1.0%
[libx264 @ 0x2269580] ref B L0: 54.0% 31.3% 14.7%
[libx264 @ 0x2269580] ref B L1: 94.6%  5.4%
[libx264 @ 0x2269580] kb/s:537.82
Exiting normally, received signal 2.



***
Camera info:

ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'YUYV'
        Name        : YUYV 4:2:2

And webcam works fine with skype and other programs...not horizontal lines.


Thanks so much!!

Phil








*************


Hi Carl

Thanks for info.
I am working on updated build with most current ffmpeg for Beaglebone board.
And will check again.

Cheers.

Phil



-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Carl Eugen Hoyos
Sent: Friday, October 4, 2019 6:26 PM
To: FFmpeg user questions <[hidden email]>
Subject: Re: [FFmpeg-user] Beaglebone - streaming issue - lines in output (and if someone is good with Beaglebone live streaming P2P... please let me know...)

Am Fr., 4. Okt. 2019 um 19:18 Uhr schrieb Philip Chisholm <[hidden email]>:

> debian@beaglebone:~$ ffmpeg -s 320x200 -r 10 -i /dev/video0 -c:v h264
> -pix_fmt yuv420p -an -sn -preset ultrafast -tune zerolatency -r 30 -f
> flv rtmp://165.22.232.61:1935/hls/movie

Should be "video_size" and "framerate" instead of "s" and "r".
(Doesn't matter for "s" iirc, can matter for "r".) More important (and sorry if you don't find this obvious):
Your command line does very different things and it is difficult for us to guess were the issue is - do you see the same problems with file output (and different options for v4l2)?

> ffmpeg version 3.2.14-1~deb9u1 Copyright (c) 2000-2019 the FFmpeg
> developers

Please understand that only current FFmpeg git head is supported.

It seems very unlikely to me that FFmpeg produces the lines.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

testvd.mp4 (387K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Beaglebone - streaming issue - horizontal lines in output

Moritz Barsnick
On Tue, Oct 22, 2019 at 18:06:29 +0000, Philip Chisholm wrote:
> The issue is the weird horizontal lines.
> See attached video.
> I am guess some sort of pixel indexing - issue...

Peculiar.

It is still extremely unlikely that it's ffmpeg's fault, unless v4l2
support is extremely broken. But who knows...

Have you tried playing or recording that video device with some other
tool, such as luvcview or guvcview, or camorama, or the likes?

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Beaglebone - streaming issue - horizontal lines in output

Philip Chisholm
Hi Moritz



I tried the same webcam on a ubuntu laptop (oppose to the beaglebone board).

The cam works fine - for both ffmpeg and just live view using cheese.

No lines.



But when I use it on the BBone board - I get the horizontal lines with ffmpeg.

Not sure how to get a live stream on BB without ffmpeg - since I need line commands (no gui UI interface on BB)

...plus only so much memory on board - and cannot install cheese (board runs out of memory – embedded devices are a killer!).



Hmmm....



When I build FFmpeg I follow this guide…



http://derekmolloy.ie/building-ffmpeg-for-beaglebone-from-source/

an enable these configure options



1
2
3
4
5
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-shared --prefix=/usr
make
make install


1
2
3
4
5
git clone git://git.videolan.org/ffmpeg.git
./configure --enable-shared --enable-libx264 --enable-gpl --enable-neon
git remote set-url origin git://source.ffmpeg.org/ffmpeg
make
make install



Should I enable anything else if I am pulling Pixel Format: 'YUYV' video out the webcam?

Would that be the problem?





Thanks.



Phil











-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Moritz Barsnick
Sent: Tuesday, October 22, 2019 5:10 PM
To: FFmpeg user discussions <[hidden email]>
Subject: Re: [FFmpeg-user] Beaglebone - streaming issue - horizontal lines in output



On Tue, Oct 22, 2019 at 18:06:29 +0000, Philip Chisholm wrote:

> The issue is the weird horizontal lines.

> See attached video.

> I am guess some sort of pixel indexing - issue...



Peculiar.



It is still extremely unlikely that it's ffmpeg's fault, unless v4l2 support is extremely broken. But who knows...



Have you tried playing or recording that video device with some other tool, such as luvcview or guvcview, or camorama, or the likes?



Cheers,

Moritz

_______________________________________________

ffmpeg-user mailing list

[hidden email]<mailto:[hidden email]>

https://ffmpeg.org/mailman/listinfo/ffmpeg-user



To unsubscribe, visit link above, or email [hidden email]<mailto:[hidden email]> with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

testvd.mp4 (387K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Beaglebone - streaming issue - horizontal lines in output

Philip Chisholm
In reply to this post by Moritz Barsnick
Hi

Still having weird horizontal lines...

So using a beaglebone board (similar to raspberry pi board..) with web cam attached.
Running Debian.

I also had to sync the frame framerate (input and output) since it was running super fast....and that seemed to help the speed issue
I tried -re but that didn't work...


From the video - looks like a frame index (or interlacing) problem...see attached video - if you look at the video full screen and pause - looks like every 40 lines or so I get a horizontal line (which is shifted left/right about 50%) then image is good again for a bit - then another horizontal line...


I tried using this command line:


ffmpeg -re -framerate 30 -video_size 320x240 -i /dev/video0 -pix_fmt yuv422p -c:v libx264 -r 30 -vf fieldorder=tff testvd.mp4

with a -vf fieldorder=tff   >>> and bff >>> but that didn't work.  11.70 fieldorder  https://www.ffmpeg.org/ffmpeg-filters.html#fieldorder 




Got this output (and the attached video):


debian@beaglebone:~/ffmpeg$ ffmpeg -re -framerate 30 -video_size 320x240 -i /dev/video0 -pix_fmt yuv422p -c:v libx264 -r 30 -vf fieldorder=tff testvd.mp4
ffmpeg version N-95495-gf7f4691f9f Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-shared --enable-libx264 --enable-gpl --enable-neon
  libavutil      56. 35.101 / 56. 35.101
  libavcodec     58. 59.102 / 58. 59.102
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 64.100 /  7. 64.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 13226.625336, bitrate: 36864 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
File 'testvd.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x7ae580] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x7ae580] profile High 4:2:2, level 1.3, 4:2:2, 8-bit
[libx264 @ 0x7ae580] 264 - core 157 r2969 d4099dd - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'testvd.mp4':
  Metadata:
    encoder         : Lavf58.33.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv422p, 320x240, q=-1--1, 30 fps, 15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.59.102 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 1042 fps= 11 q=29.0 Lsize=     732kB time=00:00:34.63 bitrate= 173.1kbits/s dup=784 drop=0 speed=0.367x
video:719kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.746207%
[libx264 @ 0x7ae580] frame I:5     Avg QP:21.03  size:  8585
[libx264 @ 0x7ae580] frame P:308   Avg QP:24.18  size:  2038
[libx264 @ 0x7ae580] frame B:729   Avg QP:27.52  size:    89
[libx264 @ 0x7ae580] consecutive B-frames:  0.9% 11.9% 17.0% 70.2%
[libx264 @ 0x7ae580] mb I  I16..4: 14.6% 36.3% 49.1%
[libx264 @ 0x7ae580] mb P  I16..4:  5.5%  1.7%  6.2%  P16..4: 34.1% 12.4%  7.5%  0.0%  0.0%    skip:32.6%
[libx264 @ 0x7ae580] mb B  I16..4:  0.4%  0.0%  0.1%  B16..8:  9.8%  0.5%  0.1%  direct: 0.2%  skip:89.0%  L0:41.2% L1:57.2% BI: 1.6%
[libx264 @ 0x7ae580] 8x8 transform intra:14.6% inter:46.3%
[libx264 @ 0x7ae580] coded y,uvDC,uvAC intra: 43.2% 64.6% 39.5% inter: 5.8% 11.8% 1.9%
[libx264 @ 0x7ae580] i16 v,h,dc,p:  4% 88%  1%  7%
[libx264 @ 0x7ae580] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 17% 21%  3%  6% 14%  4%  5%  6%
[libx264 @ 0x7ae580] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 42% 25%  2%  2%  3%  2%  2%  3%
[libx264 @ 0x7ae580] i8c dc,h,v,p: 52% 22% 19%  7%
[libx264 @ 0x7ae580] Weighted P-Frames: Y:3.6% UV:1.9%
[libx264 @ 0x7ae580] ref P L0: 57.3%  9.5% 18.3% 14.5%  0.4%
[libx264 @ 0x7ae580] ref B L0: 85.0% 11.1%  3.9%
[libx264 @ 0x7ae580] ref B L1: 97.1%  2.9%
[libx264 @ 0x7ae580] kb/s:169.45


Thanks!


Phil




-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Moritz Barsnick
Sent: Tuesday, October 22, 2019 5:10 PM
To: FFmpeg user discussions <[hidden email]>
Subject: Re: [FFmpeg-user] Beaglebone - streaming issue - horizontal lines in output

On Tue, Oct 22, 2019 at 18:06:29 +0000, Philip Chisholm wrote:
> The issue is the weird horizontal lines.
> See attached video.
> I am guess some sort of pixel indexing - issue...

Peculiar.

It is still extremely unlikely that it's ffmpeg's fault, unless v4l2 support is extremely broken. But who knows...

Have you tried playing or recording that video device with some other tool, such as luvcview or guvcview, or camorama, or the likes?

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

testvd.mp4 (1001K) Download Attachment