[FFmpeg-user] Could not write header for output file #0 (incorrect codec parameters ?)

MrNice wxcvbn2006 at iol.ie
Fri Jul 24 10:17:12 CEST 2015


On 20/07/15 16:02, Carl Eugen Hoyos wrote:
> MrNice <wxcvbn2006 <at> iol.ie> writes:
> 
>> [video4linux2,v4l2  <at>  0x1d33fa0] Thread 
>> message queue blocking; consider raising the 
>> thread_queue_size option (current value: 8)
> 
>> Thread message queue blocking;
>> What does this warning mean? 
> 
>> How to remove it?
> 
> Are you sure that you read the message?
> 
>> The objective is to get lossless audio and video 
> 
> Just to make sure: Do you mean video and 
> lossless audio?
> 
>> from what the Dazzle DVC100 provide.
> 
>> AFAIK, yuyv422 is better than yuv420p. I tried to 
>> use yuyv422 but I have the error:
>> Incompatible pixel format 'yuyv422' for codec 
>> 'mpeg4', auto-selecting format 'yuv420p'
>>
>> What is the codec I could use the get 422?
> 
> -vcodec mpeg2video supports 4:2:2 subsampling.
> 
>> Is my ffmpeg command good to get the best quality?
> 
> No, it is missing -qscale 2 -mbd 2
> (if you don't want to use libx264).
> 
> Carl Eugen


>> Thread message queue blocking;
>> What does this warning mean?
With some trails, I found the limit at 20. On site forums, they set at
512 or 1024. So I try at 512 but I don't know the up limit. What do you
think?

> (if you don't want to use libx264).
I installed libx264.
So here my new command, unfortunately with errors.

**********************************************************
./ffmpeg -debug 1 -f pulse -ar 44100 -ac 2 -channel_layout stereo
-thread_queue_size 512 -i alsa_input.pci-0000_00_14.2.analog-stereo -f
v4l2 -channel 1 -pix_fmt yuyv422 -thread_queue_size 512 -i /dev/video0
-c:v libx264 -pix_fmt yuv422p -c:a pcm_s16le /Store3/Test/t_`date
+%Y%m%d_%H%M`.mkv
ffmpeg version N-73832-g736a386 Copyright (c) 2000-2015 the FFmpeg
developers
  built with gcc 5.1.1 (GCC) 20150618 (Red Hat 5.1.1-4)
  configuration: --enable-libpulse --enable-gpl --enable-libx264
  libavutil      54. 28.100 / 54. 28.100
  libavcodec     56. 49.101 / 56. 49.101
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 25.100 /  5. 25.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
 matched as AVOption 'debug' with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with
argument 'pulse'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate
(in Hz)) with argument '44100'.
Reading option '-ac' ... matched as option 'ac' (set number of audio
channels) with argument '2'.
Reading option '-channel_layout' ... matched as option 'channel_layout'
(set channel layout) with argument 'stereo'.
Reading option '-thread_queue_size' ... matched as option
'thread_queue_size' (set the maximum number of queued packets from the
demuxer) with argument '512'.
Reading option '-i' ... matched as input file with argument
'alsa_input.pci-0000_00_14.2.analog-stereo'.
Reading option '-f' ... matched as option 'f' (force format) with
argument 'v4l2'.
Reading option '-channel' ... matched as AVOption 'channel' with
argument '1'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel
format) with argument 'yuyv422'.
Reading option '-thread_queue_size' ... matched as option
'thread_queue_size' (set the maximum number of queued packets from the
demuxer) with argument '512'.
Reading option '-i' ... matched as input file with argument '/dev/video0'.
Reading option '-c:v' ... matched as option 'c' (codec name) with
argument 'libx264'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel
format) with argument 'yuv422p'.
Reading option '-c:a' ... matched as option 'c' (codec name) with
argument 'pcm_s16le'.
Reading option '/Store3/Test/t_20150724_0849.mkv' ... matched as output
file.
Finished splitting the commandline.
Parsing a group of options: global .
Successfully parsed a group of options.
Parsing a group of options: input file
alsa_input.pci-0000_00_14.2.analog-stereo.
Applying option f (force format) with argument pulse.
Applying option ar (set audio sampling rate (in Hz)) with argument 44100.
Applying option ac (set number of audio channels) with argument 2.
Applying option channel_layout (set channel layout) with argument stereo.
Applying option thread_queue_size (set the maximum number of queued
packets from the demuxer) with argument 512.
Successfully parsed a group of options.
Opening an input file: alsa_input.pci-0000_00_14.2.analog-stereo.
[pulse @ 0x2db1200] All info found
Input #0, pulse, from 'alsa_input.pci-0000_00_14.2.analog-stereo':
  Duration: N/A, start: 1437724175.042321, bitrate: 1411 kb/s
    Stream #0:0, 1, 1/1000000: Audio: pcm_s16le, 44100 Hz, stereo, s16,
1411 kb/s
Successfully opened the file.
Parsing a group of options: input file /dev/video0.
Applying option f (force format) with argument v4l2.
Applying option pix_fmt (set pixel format) with argument yuyv422.
Applying option thread_queue_size (set the maximum number of queued
packets from the demuxer) with argument 512.
Successfully parsed a group of options.
Opening an input file: /dev/video0.
[video4linux2,v4l2 @ 0x2dba6e0] fd:6 capabilities:85220001
[video4linux2,v4l2 @ 0x2dba6e0] Selecting input_channel: 1
[video4linux2,v4l2 @ 0x2dba6e0] Current input_channel: 1, input_name:
S-Video, input_std: ffffff
[video4linux2,v4l2 @ 0x2dba6e0] Querying the device for the current
frame size
[video4linux2,v4l2 @ 0x2dba6e0] Setting frame size to 720x576
[video4linux2,v4l2 @ 0x2dba6e0] The V4L2 driver is using the interlaced mode
[video4linux2,v4l2 @ 0x2dba6e0] Current standard: PAL, id: ff,
frameperiod: 1/25
[video4linux2,v4l2 @ 0x2dba6e0] All info found
Input #1, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1349.084272, bitrate: 165888 kb/s
    Stream #1:0, 1, 1/1000000: Video: rawvideo, 1 reference frame (YUY2
/ 0x32595559), yuyv422, 720x576, 1/1000000, 165888 kb/s, 25 fps, 25 tbr,
1000k tbn, 1000k tbc
Successfully opened the file.
Parsing a group of options: output file /Store3/Test/t_20150724_0849.mkv.
Applying option c:v (codec name) with argument libx264.
Applying option pix_fmt (set pixel format) with argument yuv422p.
Applying option c:a (codec name) with argument pcm_s16le.
Successfully parsed a group of options.
Opening an output file: /Store3/Test/t_20150724_0849.mkv.
Successfully opened the file.
detected 8 logical cores
[graph 0 input from stream 1:0 @ 0x2db0e60] Setting 'video_size' to
value '720x576'
[graph 0 input from stream 1:0 @ 0x2db0e60] Setting 'pix_fmt' to value '1'
[graph 0 input from stream 1:0 @ 0x2db0e60] Setting 'time_base' to value
'1/1000000'
[graph 0 input from stream 1:0 @ 0x2db0e60] Setting 'pixel_aspect' to
value '0/1'
[graph 0 input from stream 1:0 @ 0x2db0e60] Setting 'sws_param' to value
'flags=2'
[graph 0 input from stream 1:0 @ 0x2db0e60] Setting 'frame_rate' to
value '25/1'
[graph 0 input from stream 1:0 @ 0x2db0e60] w:720 h:576 pixfmt:yuyv422
tb:1/1000000 fr:25/1 sar:0/1 sws_param:flags=2
[format @ 0x2dc0a40] compat: called with args=[yuv422p]
[format @ 0x2dc0a40] Setting 'pix_fmts' to value 'yuv422p'
[auto-inserted scaler 0 @ 0x2d9db00] Setting 'flags' to value '0x4'
[auto-inserted scaler 0 @ 0x2d9db00] w:iw h:ih flags:'0x4' interl:0
[format @ 0x2dc0a40] auto-inserting filter 'auto-inserted scaler 0'
between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x2d92a40] query_formats: 4 queried, 2 merged, 1
already done, 0 delayed
[auto-inserted scaler 0 @ 0x2d9db00] w:720 h:576 fmt:yuyv422 sar:0/1 ->
w:720 h:576 fmt:yuv422p sar:0/1 flags:0x4
[graph 1 input from stream 0:0 @ 0x2d9d8a0] Setting 'time_base' to value
'1/44100'
[graph 1 input from stream 0:0 @ 0x2d9d8a0] Setting 'sample_rate' to
value '44100'
[graph 1 input from stream 0:0 @ 0x2d9d8a0] Setting 'sample_fmt' to
value 's16'
[graph 1 input from stream 0:0 @ 0x2d9d8a0] Setting 'channel_layout' to
value '0x3'
[graph 1 input from stream 0:0 @ 0x2d9d8a0] tb:1/44100 samplefmt:s16
samplerate:44100 chlayout:0x3
[audio format for output stream 0:1 @ 0x2d97a40] Setting 'sample_fmts'
to value 's16'
[AVFilterGraph @ 0x2d9c700] query_formats: 4 queried, 9 merged, 0
already done, 0 delayed
[libx264 @ 0x2dbd7c0] using mv_range_thread = 24
[libx264 @ 0x2dbd7c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX XOP FMA4 LZCNT
[libx264 @ 0x2dbd7c0] profile High 4:2:2, level 3.0, 4:2:2 8-bit
[libx264 @ 0x2dbd7c0] 264 - core 142 r2495 6a301b6 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2014 - 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=12 lookahead_threads=2 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, matroska, to '/Store3/Test/t_20150724_0849.mkv':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0, 0, 1/1000: Video: h264 (libx264), -1 reference frame
(H264 / 0x34363248), yuv422p, 720x576, 1/25, q=-1--1, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.49.101 libx264
    Stream #0:1, 0, 1/1000: Audio: pcm_s16le ([1][0][0][0] / 0x0001),
44100 Hz, stereo, s16, 1411 kb/s
    Metadata:
      encoder         : Lavc56.49.101 pcm_s16le
Stream mapping:
  Stream #1:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Cliping frame in rate conversion by 0.000008
Cliping frame in rate conversion by 0.199638
Cliping frame in rate conversion by 0.397591
Cliping frame in rate conversion by 0.399467
Cliping frame in rate conversion by 0.599464
Past duration 0.799110 too large
Past duration 0.800117 too large
*** dropping frame 10 from stream 0 at ts 8
Past duration 0.999794 too large
Past duration 0.802467 too large      1kB time=00:00:00.00 bitrate=N/A
dup=0 drop=1
*** dropping frame 15 from stream 0 at ts 13
Past duration 0.801689 too large
*** dropping frame 20 from stream 0 at ts 18
Past duration 0.802315 too large
*** dropping frame 25 from stream 0 at ts 23
Past duration 0.804741 too large      1kB time=00:00:00.00 bitrate=N/A
dup=0 drop=4
*** dropping frame 30 from stream 0 at ts 28
Past duration 0.803642 too large
*** dropping frame 35 from stream 0 at ts 33
Past duration 0.804710 too large      1kB time=00:00:00.00 bitrate=N/A
dup=0 drop=6
*** dropping frame 40 from stream 0 at ts 38
Past duration 0.805550 too large
*** dropping frame 45 from stream 0 at ts 43
Past duration 0.806267 too large
*** dropping frame 50 from stream 0 at ts 48
Past duration 0.806847 too large      1kB time=00:00:00.00 bitrate=N/A
dup=0 drop=9
*** dropping frame 55 from stream 0 at ts 53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[libx264 @ 0x2dbd7c0] frame=   0 QP=23.16 NAL=3 Slice:I Poc:0   I:1620
P:0    SKIP:0    size=2985 bytes
[libx264 @ 0x2dbd7c0] frame=   1 QP=23.07 NAL=2 Slice:P Poc:2   I:0
P:7    SKIP:1613 size=58 bytes
[libx264 @ 0x2dbd7c0] frame=   2 QP=20.00 NAL=2 Slice:P Poc:4   I:0
P:4    SKIP:1616 size=33 bytes
[libx264 @ 0x2dbd7c0] frame=   3 QP=20.00 NAL=2 Slice:P Poc:6   I:0
P:0    SKIP:1620 size=28 bytes
[matroska @ 0x2dbc1a0] Writing block at offset 781, size 3675, pts 0,
dts -80, duration 40, keyframe 1
[matroska @ 0x2dbc1a0] Writing block at offset 4464, size 58, pts 40,
dts -40, duration 40, keyframe 0
[matroska @ 0x2dbc1a0] Writing block at offset 4528, size 33, pts 80,
dts 0, duration 40, keyframe 0
[matroska @ 0x2dbc1a0] Writing block at offset 4567, size 1768, pts 0,
dts 0, duration 10, keyframe 1
[matroska @ 0x2dbc1a0] Writing block at offset 6342, size 1784, pts 10,
dts 10, duration 10, keyframe 1
[matroska @ 0x2dbc1a0] Writing block at offset 8133, size 1792, pts 20,
dts 20, duration 10, keyframe 1
[matroska @ 0x2dbc1a0] Writing block at offset 9932, size 1788, pts 30,
dts 30, duration 10, keyframe 1
[matroska @ 0x2dbc1a0] Writing block at offset 11727, size 28, pts 120,
dts 40, duration 40, keyframe 0

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Past duration 0.809395 too large
*** dropping frame 60 from stream 0 at ts 58
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[libx264 @ 0x2dbd7c0] frame=   4 QP=20.00 NAL=2 Slice:P Poc:8   I:0
P:3    SKIP:1617 size=35 bytes
[matroska @ 0x2dbc1a0] Writing block at......[cut]
***********************************************************

0-
>> The objective is to get lossless audio and video
>
> Just to make sure: Do you mean video and
> lossless audio?
Yes of course. This was a short way (in a wrong order indeed) to say
"...to get and keep the best Dazzle can provide without adding artefacts".

1- I read the video stream with -pix_fmt yuyv422 then write with
-pix_fmt yuv422p. No choice, as you wrote,
“As said, you cannot use PIX_FMT_YUYV422 because no encoder supports it.”
I think there is no lost but only a different way to organise. Do you agree?

2- There are clipping and drops (Highlighted by ++++++++++++++++++++). I
don't know why. Could you help?

3- With libx264 are there some options I could add to improve the
quality? (libx264 has a lot of options hard for me to understand)


More information about the ffmpeg-user mailing list