Re: [FFmpeg-user] concat with differing tbn in h264 streams

2016-09-16 Thread S Andreason

Carl Eugen Hoyos wrote:

The correct value is "-r 3/1001" and you should probably use it
on all three sources.
  


Perfect, thank you.

___
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] concat with differing tbn in h264 streams

2016-09-16 Thread Carl Eugen Hoyos
2016-09-16 19:08 GMT+02:00 S Andreason :
> Carl Eugen Hoyos wrote:
>>
>> The input streams have different frame rates, use the -r option when
>> encoding the input files (or use setpts if you prefer not to drop /
>> duplicate
>> frames).
>
> Right, I used -r on file# 3:

The correct value is "-r 3/1001" and you should probably use it
on all three sources.

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] concat with differing tbn in h264 streams

2016-09-16 Thread S Andreason

Carl Eugen Hoyos wrote:

The input streams have different frame rates, use the -r option when
encoding the input files (or use setpts if you prefer not to drop / duplicate
frames).


Hi Carl,
Right, I used -r on file# 3:

~/camera/solar/editing$ ffmpeg -i 
20160916_0601_Conpus-250A-stressTest_trips-90.5A-14m_rec_0828_c315t5.MOV 
-c:v h264 -s 640x360 -r 29.97 -pix_fmt yuvj420p -c:a pcm_s16le -ar 48000 
-ac 2  
20160916_0601_Conpus-250A-stressTest_trips-90.5A-14m_rec_0828_c315t5-h640x360.mov

Input #0,
  Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
1920x1080, 17599 kb/s, 30 fps, 30 tbr, 30k tbn, 60k tbc (default)

Output #0, mov,
  Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), 
yuvj420p(pc), 640x360, q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc (default)


Okay I'll try setpts:

~/camera/solar/editing$ ffmpeg -i 
20160916_0601_Conpus-250A-stressTest_trips-90.5A-14m_rec_0828_c315t5.MOV 
-c:v h264 -s 640x360 -r 29.97 -pix_fmt yuvj420p -vf 'setpts=N/(25*TB)' 
-c:a pcm_s16le -ar 48000 -ac 2  
20160916_0601_Conpus-250A-stressTest_trips-90.5A-14m_rec_0828_c315t5-h640x360.mov

ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
 built with gcc 4.9.2 (Debian 4.9.2-10)
 configuration: --prefix=/usr/local --enable-gpl --enable-postproc 
--enable-swscale --enable-libmp3lame --enable-libvorbis --enable-libx264 
--enable-pthreads --enable-libopenjpeg --enable-nonfree 
--disable-ffserver --disable-network --enable-libfreetype 
--enable-libfontconfig --disable-doc --disable-htmlpages 
--disable-podpages --enable-shared --enable-libvpx 
--extra-cflags=-I/usr/include --extra-ldflags=-L/usr/lib/i386-linux-gnu

 libavutil  55. 28.100 / 55. 28.100
 libavcodec 57. 48.101 / 57. 48.101
 libavformat57. 41.100 / 57. 41.100
 libavdevice57.  0.101 / 57.  0.101
 libavfilter 6. 47.100 /  6. 47.100
 libswscale  4.  1.100 /  4.  1.100
 libswresample   2.  1.100 /  2.  1.100
 libpostproc54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 
'20160916_0601_Conpus-250A-stressTest_trips-90.5A-14m_rec_0828_c315t5.MOV':

 Metadata:
   major_brand : qt 
   minor_version   : 512
   compatible_brands: qt 
   encoder : Lavf57.41.100

   comment : HDDVR-Mobius
   comment-eng : HDDVR-Mobius
 Duration: 00:00:05.00, start: 0.00, bitrate: 18116 kb/s
   Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
1920x1080, 17599 kb/s, 30 fps, 30 tbr, 30k tbn, 60k tbc (default)

   Metadata:
 handler_name: DataHandler
 encoder : h264
   Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 32000 Hz, 
mono, s16, 512 kb/s (default)

   Metadata:
 handler_name: DataHandler
File 
'20160916_0601_Conpus-250A-stressTest_trips-90.5A-14m_rec_0828_c315t5-h640x360.mov' 
already exists. Overwrite ? [y/N] y
[swscaler @ 0xa02a600] deprecated pixel format used, make sure you did 
set range correctly

[libx264 @ 0x9f9f600] using cpu capabilities: none!
[libx264 @ 0x9f9f600] profile High, level 3.0
[libx264 @ 0x9f9f600] 264 - core 142 r2431 a5831aa - 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=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
[mov @ 0x9fc0380] Using AVStream.codec to pass codec parameters to 
muxers is deprecated, use AVStream.codecpar instead.

   Last message repeated 1 times
Output #0, mov, to 
'20160916_0601_Conpus-250A-stressTest_trips-90.5A-14m_rec_0828_c315t5-h640x360.mov':

 Metadata:
   major_brand : qt 
   minor_version   : 512
   compatible_brands: qt 
   comment-eng : HDDVR-Mobius

   comment : HDDVR-Mobius
   encoder : Lavf57.41.100
   Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), 
yuvj420p(pc), 640x360, q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc (default)

   Metadata:
 handler_name: DataHandler
 encoder : Lavc57.48.101 libx264
   Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
   Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 
stereo, s16, 1536 kb/s (default)

   Metadata:
 handler_name: DataHandler
 encoder : Lavc57.48.101 pcm_s16le
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
frame=  180 fps=4.6 q=29.0 Lsize=1075kB time=00:00:05.90 
bitrate=1491.2kbits/s dup=30 drop=0 speed=0.151x   
video:133kB audio:93

Re: [FFmpeg-user] concat with differing tbn in h264 streams

2016-09-16 Thread Carl Eugen Hoyos
2016-09-16 18:28 GMT+02:00 S Andreason :

>  Duration: 00:01:55.42, start: 0.00, bitrate: 24865 kb/s
>Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661),
> yuvj420p(pc, bt709), 1280x720, 23320 kb/s, 29.97 fps, 29.97 tbr, 30k tbn,
> 60k tbc (default)

>Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
> 1920x1080, 17599 kb/s, 30 fps, 30 tbr, 30k tbn, 60k tbc (default)

The input streams have different frame rates, use the -r option when
encoding the input files (or use setpts if you prefer not to drop / duplicate
frames).

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".

[FFmpeg-user] concat with differing tbn in h264 streams

2016-09-16 Thread S Andreason

Hi,
I am getting problems creating a single video from different cameras. I 
first convert each to the desired size and codecs, so that the concat 
function will work. But the video codecs are still not exactly the same, 
and thus the output is getting errors and dropped video frames with time 
stamp errors.


Short question, how do I force a specific 30k tbn instead of 11988 tbn 
to get them the same?


Long version with complete output:
$ ffmpeg -i 20160916_0531_Conpus-250A_tripped_3299.MOV -t 11 -c:v h264 
-s 640x360 -c:a copy 
20160916_0531_Conpus-250A_beginTest_3299_c0t11-h640x360.mov

ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
 built with gcc 4.9.2 (Debian 4.9.2-10)
 configuration: --prefix=/usr/local --enable-gpl --enable-postproc 
--enable-swscale --enable-libmp3lame --enable-libvorbis --enable-libx264 
--enable-pthreads --enable-libopenjpeg --enable-nonfree 
--disable-ffserver --disable-network --enable-libfreetype 
--enable-libfontconfig --disable-doc --disable-htmlpages 
--disable-podpages --enable-shared --enable-libvpx 
--extra-cflags=-I/usr/include --extra-ldflags=-L/usr/lib/i386-linux-gnu

 libavutil  55. 28.100 / 55. 28.100
 libavcodec 57. 48.101 / 57. 48.101
 libavformat57. 41.100 / 57. 41.100
 libavdevice57.  0.101 / 57.  0.101
 libavfilter 6. 47.100 /  6. 47.100
 libswscale  4.  1.100 /  4.  1.100
 libswresample   2.  1.100 /  2.  1.100
 libpostproc54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 
'20160916_0531_Conpus-250A_tripped_3299.MOV':

 Metadata:
   major_brand : qt 
   minor_version   : 537331968

   compatible_brands: qt  CAEP
   com.apple.quicktime.make: Canon
   com.apple.quicktime.model: Canon PowerShot SX260 HS
   com.apple.quicktime.rating.user: 0.00
   creation_time   : 2016-09-16 12:31:55
 Duration: 00:01:55.42, start: 0.00, bitrate: 24865 kb/s
   Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 
0x31637661), yuvj420p(pc, bt709), 1280x720, 23320 kb/s, 29.97 fps, 29.97 
tbr, 30k tbn, 60k tbc (default)

   Metadata:
 creation_time   : 2016-09-16 12:31:55
   Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 
stereo, s16, 1536 kb/s (default)

   Metadata:
 creation_time   : 2016-09-16 12:31:55
[swscaler @ 0x970b220] deprecated pixel format used, make sure you did 
set range correctly

No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x96b1c00] using cpu capabilities: none!
[libx264 @ 0x96b1c00] profile High, level 3.0
[libx264 @ 0x96b1c00] 264 - core 142 r2431 a5831aa - 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=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
[mov @ 0x96b0ee0] Using AVStream.codec to pass codec parameters to 
muxers is deprecated, use AVStream.codecpar instead.

   Last message repeated 1 times
Output #0, mov, to 
'20160916_0531_Conpus-250A_tripped_3299_c0t11-h640x360.mov':

 Metadata:
   major_brand : qt 
   minor_version   : 537331968

   compatible_brands: qt  CAEP
   com.apple.quicktime.make: Canon
   com.apple.quicktime.model: Canon PowerShot SX260 HS
   com.apple.quicktime.rating.user: 0.00
   encoder : Lavf57.41.100
   Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), 
yuvj420p(pc), 640x360, q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)

   Metadata:
 creation_time   : 2016-09-16 12:31:55
 encoder : Lavc57.48.101 libx264
   Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
   Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 
stereo, 1536 kb/s (default)

   Metadata:
 creation_time   : 2016-09-16 12:31:55
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  330 fps=2.6 q=29.0 Lsize=3064kB time=00:00:11.00 
bitrate=2281.3kbits/s speed=0.0883x   
video:990kB audio:2063kB subtitle:0kB other streams:0kB global 
headers:0kB muxing overhead: 0.350168%

[libx264 @ 0x96b1c00] frame I:2 Avg QP:23.35  size: 12112
[libx264 @ 0x96b1c00] frame P:160   Avg QP:25.88  size:  5179
[libx264 @ 0x96b1c00] frame B:168   Avg QP:28.30  size:   955
[libx264 @ 0x96b1c00] consecutive B-frames: 16.4% 35.8% 34.5% 13.3%
[libx264 @ 0x96b1c00] mb I  I16..4: 12.4% 77.2% 10.4%
[libx264 @ 0x96b1c00] mb P  I16..4:  3.1%  9.0%  0.6%  P16..4: 50.2% 
18.3%  7.