[FFmpeg-user] Question on Segment TImes
Colin Bitterfield
colin at bitterfield.com
Sun Apr 5 04:31:06 EEST 2020
Is there a way to consolidate this to one command?
The goal is to import of DV-TAPE with the best quality in a single pass on the tape. Sometimes I have go back and parts from FCPX imports. The tapes are old and sometimes FCPX doesn’t like them.
I was able to get it going with a PIPE: (and 30 experiments on time coding and segment timing)
export TITLE="284_test"; \
ffmpeg -benchmark_all -stats -loglevel debug \
-c dvvideo -pix_fmt 0rgb -capture_raw_data true -f avfoundation -i DV-VCR \
-c: copy -f dv pipe: | ffmpeg -i pipe: -c:v dvvideo -c:a:0 pcm_s16le \
-strftime 1 \
-copyts \
-timecode "00:00:00;00" \
-increment_tc 1 \
-reset_timestamps 1 \
-segment_time 00:05:00 -f segment "${TITLE}_%H-%M-%S.mov" -y
This yields the following:
bash-3.2$ ffprobe -show_streams -select_streams a 284_test_004_18-00-51.mov
ffprobe version 4.2.git Copyright (c) 2007-2020 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox --enable-sdl2 --disable-securetransport --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-x86asm --enable-libx265 --enable-libdc1394 --enable-librtmp --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-version3 --enable-libsmbclient --enable-nonfree --enable-libfdk-aac
libavutil 56. 38.100 / 56. 38.100
libavcodec 58. 65.102 / 58. 65.102
libavformat 58. 35.101 / 58. 35.101
libavdevice 58. 9.102 / 58. 9.102
libavfilter 7. 70.101 / 7. 70.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '284_test_004_18-00-51.mov’:
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf58.35.101
Duration: 00:05:00.00, start: 0.000000, bitrate: 29798 kb/s
Stream #0:0: Video: dvvideo (dvc / 0x20637664), yuv411p(bottom coded first (swapped)), 720x480 [SAR 8:9 DAR 4:3], 28771 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 29.97 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.65.102 dvvideo
timecode : 00:34:59;28
Stream #0:1: Audio: pcm_s16le (sowt / 0x74776F73), 32000 Hz, stereo, s16, 1024 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
Metadata:
handler_name : TimeCodeHandler
timecode : 00:34:59;28
Unsupported codec with id 0 for input stream 2
[STREAM]
index=1
codec_name=pcm_s16le
codec_long_name=PCM signed 16-bit little-endian
profile=unknown
codec_type=audio
codec_time_base=1/32000
codec_tag_string=sowt
codec_tag=0x74776f73
sample_fmt=s16
sample_rate=32000
channels=2
channel_layout=stereo
bits_per_sample=16
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/32000
start_pts=640
start_time=0.020000
duration_ts=9599632
duration=299.988500
bit_rate=1024000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=9599632
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:handler_name=SoundHandler
[/STREAM]
On Apr 4, 2020, 5:26 PM -0700, Moritz Barsnick <barsnick at gmx.net>, wrote:
> On Sat, Apr 04, 2020 at 13:48:37 -0700, Colin Bitterfield wrote:
> > Does anyone one know the magic option for getting all three streams into MOV.
> [...]
> > If I just change the container to “.mov”
> > ffmpeg -capture_raw_data true -f avfoundation -i DV-VCR -map 0 \
> > -map_metadata 0 \
> > -c:v copy \
> > -c:a copy \
> > -c copy \
>
> "-c copy" implies "-c:a copy" and "-c:v copy", by the way.
>
> > -t 10 output.mov -y
>
> > I get one stream:
> >
> > nput #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘output.mov’:
> > Metadata:
> > major_brand : qt
> > minor_version : 512
> > compatible_brands: qt
> > encoder : Lavf58.35.101
> > Duration: 00:00:10.01, start: 0.000000, bitrate: 28773 kb/s
> > Stream #0:0: Video: dvvideo (dvc / 0x20637664), yuv411p, 720x480 [SAR 8:9 DAR 4:3], 28771 kb/s, 29.97 fps, 29.97 tbr, 1000k tbn, 29.97 tbc (default)
> > Metadata:
> > handler_name : VideoHandler
>
> You need to show us the *complete*, uncut console output of your ffmpeg
> conversion command. It contains a lot of useful information, and will
> help us to analyze the issue.
>
> > If I do the import with Final Cut Pro X then I get this from the file. Also, FCPX seems to be able to find the original timestamp from when the media was created.
> [...]
> > Duration: 00:00:42.34, start: 0.000000, bitrate: 31057 kb/s
> > Stream #0:0(und): Video: dvvideo (dvc / 0x20637664), yuv411p(smpte170m/smpte170m/bt709, bottom coded first (swapped)), 720x480 [SAR 8:9 DAR 4:3], 28771 kb/s, SAR 10:11 DAR 15:11, 29.97 fps, 29.97 tbr, 30k tbn, 29.97 tbc (default)
> > Metadata:
> > creation_time : 2020-03-27T04:07:28.000000Z
> > handler_name : Core Media Video
> > encoder : DV/DVCPRO - NTSC
> > timecode : 00:10:04;23
> > Stream #0:1(und): Data: none (tmcd / 0x64636D74), 0 kb/s
> > Metadata:
> > creation_time : 2020-03-27T04:07:28.000000Z
> > handler_name : Core Media Time Code
> > timecode : 00:10:04;23
> > Stream #0:2(und): Audio: pcm_s16le (lpcm / 0x6D63706C), 32000 Hz, 4 channels, s16, 2048 kb/s (default)
> > Metadata:
> > creation_time : 2020-03-27T04:07:28.000000Z
> > handler_name : Core Media Audio
> > Unsupported codec with id 0 for input stream 1
>
> So, Final Cut Pro X combines the two audio tracks into one four-channel
> track? Is that okay? (Just wondering.)
>
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-user
mailing list