C920 h264 ffmpeg empty output file

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

C920 h264 ffmpeg empty output file

arkwaw.spam@gmail.com
This post was updated on .
Hi!
I am trying to set up rtp stream from my camera C920 with ardware-based coder to h264.
The frist step was to save encoded h264 directly from camera:
setting camera for right format:
v4l2-ctl -d /dev/video1 --set-fmt-video=width=800,height=448,pixelformat=1
v4l2-ctl -d /dev/video1 --set-parm=30

launching ffmpeg
./ffmpeg -f v4l2 -input_format h264 -i /dev/video1 -c:v copy output.mkv

Output file contains no frames (its empty)
frame=    0 fps=0.0 q=-1.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A    
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead inf%
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

Full log below

arkwaw@ubuntu:~/obraz/ffmpeg$ ./ffmpeg -f v4l2 -input_format h264 -i /dev/video1 -c:v copy output.mkv  
ffmpeg version N-52847-g9276467 Copyright (c) 2000-2013 the FFmpeg developers
  built on May  7 2013 13:28:41 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration:
  libavutil      52. 30.100 / 52. 30.100
  libavcodec     55.  7.100 / 55.  7.100
  libavformat    55.  4.101 / 55.  4.101
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 63.101 /  3. 63.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
Input #0, video4linux2,v4l2, from '/dev/video1':
  Duration: N/A, start: 5376.522436, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p, 800x448 [SAR 1:1 DAR 25:14], -5 kb/s, 30 fps, 30 tbr, 1000k tbn, 60 tbc
File 'output.mkv' already exists. Overwrite ? [y/N] y
Output #0, matroska, to 'output.mkv':
  Metadata:
    encoder         : Lavf55.4.101
    Stream #0:0: Video: h264 (H264 / 0x34363248), yuvj420p, 800x448 [SAR 1:1 DAR 25:14], q=2-31, -5 kb/s, 30 fps, 1k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=-1.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A    
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead inf%
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
Reply | Threaded
Open this post in threaded view
|

Re: C920 h264 ffmpeg empty output file

Carl Eugen Hoyos
remicek <remicek <at> gmail.com> writes:

> ./ffmpeg -f v4l2 -input_format h264
> -i /dev/video1 -c:v copy output.mkv
>
> Log <http://pastebin.com/VnRRxLfu>

Please do not use external resources, always
post the complete, uncut console output here
on the mailing list.

Does playing with ffplay and transcoding to
another codec with ffmpeg work?

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: C920 h264 ffmpeg empty output file

arkwaw.spam@gmail.com
Well i guess it works, some frames are lost but it works.

log1
arkwaw@ubuntu:~/obraz/ffmpeg$ ./ffmpeg -f v4l2 -input_format h264 -i /dev/video1 -vcodec mjpeg a.mkv
ffmpeg version N-52847-g9276467 Copyright (c) 2000-2013 the FFmpeg developers
  built on May  7 2013 13:28:41 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration:
  libavutil      52. 30.100 / 52. 30.100
  libavcodec     55.  7.100 / 55.  7.100
  libavformat    55.  4.101 / 55.  4.101
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 63.101 /  3. 63.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
Input #0, video4linux2,v4l2, from '/dev/video1':
  Duration: N/A, start: 709.435112, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p, 800x448 [SAR 1:1 DAR 25:14], -5 kb/s, 30 fps, 30 tbr, 1000k tbn, 60 tbc
Output #0, matroska, to 'a.mkv':
  Metadata:
    encoder         : Lavf55.4.101
    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj420p, 800x448 [SAR 1:1 DAR 25:14], q=2-31, 200 kb/s, 1k tbn, 30 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
frame=    6 fps=0.0 q=0.0 size=     153kB time=00:00:00.33 bitrate=3756.9kbits/sframe=   13 fps= 13 q=0.0 size=     429kB time=00:00:00.73 bitrate=4790.4kbits/sframe=   20 fps= 13 q=0.0 size=     788kB time=00:00:01.40 bitrate=4608.5kbits/sframe=   28 fps= 14 q=0.0 size=    1228kB time=00:00:01.86 bitrate=5392.1kbits/sframe=   35 fps= 14 q=0.0 size=    1523kB time=00:00:02.26 bitrate=5505.7kbits/sframe=   43 fps= 14 q=0.0 size=    1778kB time=00:00:02.76 bitrate=5265.4kbits/sframe=   51 fps= 14 q=0.0 size=    1985kB time=00:00:03.56 bitrate=4559.7kbits/sframe=   58 fps= 14 q=0.0 size=    2137kB time=00:00:03.90 bitrate=4487.9kbits/sframe=   66 fps= 15 q=0.0 size=    2281kB time=00:00:04.36 bitrate=4279.0kbits/sframe=   73 fps= 14 q=0.0 size=    2396kB time=00:00:04.80 bitrate=4088.6kbits/sframe=   81 fps= 15 q=0.0 size=    2515kB time=00:00:05.26 bitrate=3911.2kbits/sframe=   88 fps= 15 q=0.0 size=    2612kB time=00:00:05.93 bitrate=3607.0kbits/sframe=   96 fps= 15 q=0.0 size=    2718kB time=00:00:06.40 bitrate=3478.3kbits/sframe=  104 fps= 15 q=0.0 size=    2823kB time=00:00:06.86 bitrate=3367.9kbits/sframe=  111 fps= 15 q=0.0 size=    2914kB time=00:00:07.30 bitrate=3269.8kbits/sframe=  113 fps= 15 q=0.0 Lsize=    2955kB time=00:00:07.46 bitrate=3241.9kbits/s dup=0 drop=2    
video:2950kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.165280%

Log 2

arkwaw@ubuntu:~/obraz/ffmpeg$ ffplay a.mkv
Reply | Threaded
Open this post in threaded view
|

Re: C920 h264 ffmpeg empty output file

Carl Eugen Hoyos
remicek <remicek <at> gmail.com> writes:

> Well i guess it works, some frames are lost
> but it works.

Things you can test (I unfortunately cannot):
-copyts
-copytb
other containers

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: C920 h264 ffmpeg empty output file

arkwaw.spam@gmail.com
This post was updated on .
I've tried all these options still no change :/.

I tried some other method using some soft which grab h264 stream from camera and put in on pipe so ffmpeg can read it:
i've got that soft from here

While using command:
./capture -f 640x480 -c 5000 -o | ffmpeg -an -i - -vcodec copy -f mpegts udp://192.168.1.151:10000
I am able to see streamed video but it is delayed like 2 or 3s. Which is sadly unacceptable for me...

Log

pi@raspberrypi ~/projekt/obraz_nowy/bonecam/capture $ ./capture -f 8000x600 -c 500 -o | ffmpeg -an -i - -vcodec copy -f mpegts udp://192.168.1.151:10000
Set H264
ffmpeg version N-52847-g9276467 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 10 2013 08:56:32 with gcc 4.6 (Debian 4.6.3-14+rpi1)
  configuration:
  libavutil      52. 30.100 / 52. 30.100
  libavcodec     55.  7.100 / 55.  7.100
  libavformat    55.  4.101 / 55.  4.101
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 63.101 /  3. 63.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
[h264 @ 0x16a4c70] max_analyze_duration 5000000 reached at 5000000 microseconds
Input #0, h264, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p, 640x480 [SAR 1:1 DAR 4:3], 30 fps, 30 tbr, 1200k tbn, 60 tbc
Output #0, mpegts, to 'udp://192.168.1.151:10000':
  Metadata:
    encoder         : Lavf55.4.101
    Stream #0:0: Video: h264, yuvj420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 30 fps, 90k tbn, 30 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
frame=  490 fps= 43 q=-1.0 size=    6557kB time=00:00:16.33 bitrate=3287.2kbits/s    
frame=  500 fps= 43 q=-1.0 Lsize=    6691kB time=00:00:16.67 bitrate=3287.7kbits/s