Re: [FFmpeg-user] Question on Segment TImes

2020-04-05 Thread Colin Bitterfield
The tape deck is a Sony DSR-45 (not the “A” model).

The tapes are pre-recorded studio dubbing masters. When I do ffprobe with 
avfoundation it produces this output:


    Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 8:9 DAR 4:3], 25000 
kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream #0:1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Stream #0:2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s

I was unable to map anything resemble 0:1 or 0:a:0 coming in from the deck. 
Once it was in an DV file, it worked as expected.

I had not thought of this before, but perhaps I can map 0:v:1 to audio? Maybe 
it sees it all as a video.


On Apr 4, 2020, 8:33 PM -0700, FFmpeg user questions , 
wrote:
>
> think this has to do with AVFoundation’s “raw data” option and how audio and 
> video is stored on the actual metallic sublimate tape (iirc, the 
> video/audio/timecode “streams” do not exist as discrete entities, but they 
> are all interleaved into an atomic “DV” tape-format (hence the 1M reported 
> tbn). I’m not sure how AVFoundation splits them up or isolates the detected 
> timecode or decide to join all the streams together, but I presume it’s 
> similar to the audio fixup menu options in FCPX import media window.
>
> I’m curious if this would work, but have you tried artificially increasing 
> the video size (via framerate, frame size, etc) to make it into what would be 
> considered HDV, or even DVCPRO and try adding the audio streams then? 
> Apparently it supports multiple streams (DVCPRO50, that is)
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Question on Segment TImes

2020-04-04 Thread Ted Park
Hi,

> OK: That solved the timestamp problem and created a missing stream.
> 
> Does anyone one know the magic option for getting all three streams into MOV.
> 
> If I use this to create a DV file (from DVR-DV) it works and creates this 
> file:

> Input #0, dv, from ‘output.dv’:
>   Metadata:
> timecode : 00:00:00:00
>   Duration: 00:00:10.01, start: 0.00, bitrate: 28771 kb/s
> Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 8:9 DAR 4:3], 25000 
> kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
> Stream #0:1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
> Stream #0:2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
> 
> Three streams
> 
> If I just change the container to “.mov”

> 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.00, 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
I think this has to do with AVFoundation’s “raw data” option and how audio and 
video is stored on the actual metallic sublimate tape (iirc, the 
video/audio/timecode “streams” do not exist as discrete entities, but they are 
all interleaved into an atomic “DV” tape-format (hence the 1M reported tbn). 
I’m not sure how AVFoundation splits them up or isolates the detected timecode 
or decide to join all the streams together, but I presume it’s similar to the 
audio fixup menu options in FCPX import media window.

I’m curious if this would work, but have you tried artificially increasing the 
video size (via framerate, frame size, etc) to make it into what would be 
considered HDV, or even DVCPRO and try adding the audio streams then? 
Apparently it supports multiple streams (DVCPRO50, that is)


> I have tried every variation of -map.
> If I send the output to pipe and then to a file, all of the streams are their 
> for DV
> 
> 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.

I don't know if -map will work as usual with dv from a tape deck. Also I don't 
know how AVFoundation actually archives the data, I would really get a build 
with native IEEE1394 device control/communication library support, since if you 
use AVFoundation then I doubt the problems in FCPX are going to go away, or at 
least not all of them.



> On Apr 4, 2020, 2:11 AM -0700, Gyan Doshi , wrote:
>> 
>> 
>> On 04-04-2020 11:59 am, Colin Bitterfield wrote:
>>> I am trying to segment split a stream coming in from AVFOUNDATION
>>> 
>>> ffmpeg -benchmark_all -stats -loglevel debug -copyts \
>>>  -f avfoundation -capture_raw_data true -pix_fmt 0rgb -i DV-VCR -q 0 \
>>>  -map 0 -c:v copy -c:a copy -segment_time 00:00:10 \
>>>  -f segment  374_%03d.dv -y
>>> 
>>> _ I have tried various combinations of “-increment_tc” and 
>>> "-reset_timestamps 0"
>>> 
>>> The video splits flawless at the time requ
>> 
>> .dv is a bare bones container and does not support timestamps. Try MOV.

I am under the understanding that DV timestamps/timecodes are pretty much the 
same thing since they use either LTC or VITC on the tape that encodes the date 
(timestamp) as well as the timecodes, in a “striped” tape anyway. It’s how your 
deck knows when one shot ends and another begins. So it doesn't support 
timestamps as metadata but I don't think they are lost, just embedded in the dv 
stream in a way that’s just a little harder to access.


Regards,
Ted Park

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Question on Segment TImes

2020-04-04 Thread Colin Bitterfield
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.00, 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.02
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 , 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.00, 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 

Re: [FFmpeg-user] Question on Segment TImes

2020-04-04 Thread Moritz Barsnick
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.00, 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.00, 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.00Z
>       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.00Z
>       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.00Z
>       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@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Question on Segment TImes

2020-04-04 Thread Colin Bitterfield
OK: That solved the timestamp problem and created a missing stream.

Does anyone one know the magic option for getting all three streams into MOV.

If I use this to create a DV file (from DVR-DV) it works and creates this file:

ffmpeg  -capture_raw_data true -f avfoundation -i DV-VCR -map 0 \
-map_metadata 0 \
-c:v copy \
-c:a copy \
-c copy \
-t 10 output.dv -y

Input #0, dv, from ‘output.dv’:
  Metadata:
    timecode : 00:00:00:00
  Duration: 00:00:10.01, start: 0.00, bitrate: 28771 kb/s
    Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 8:9 DAR 4:3], 25000 
kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream #0:1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Stream #0:2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s

Three streams

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 \
-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.00, 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


I have tried every variation of -map.
If I send the output to pipe and then to a file, all of the streams are their 
for DV

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.

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './2020-03-26/1999-07-31 13_43_37.mov’:
  Metadata:
    major_brand : qt
    minor_version : 0
    compatible_brands: qt
    creation_time : 2020-03-27T04:07:28.00Z
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: MacBookPro14,3
    com.apple.quicktime.software: Mac OS X 10.15.3 (19D76)
    com.apple.quicktime.creationdate: 2020-03-26T20:57:12-0700
  Duration: 00:00:42.34, start: 0.00, 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.00Z
      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.00Z
      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.00Z
      handler_name : Core Media Audio
Unsupported codec with id 0 for input stream 1

On Apr 4, 2020, 2:11 AM -0700, Gyan Doshi , wrote:
>
>
> On 04-04-2020 11:59 am, Colin Bitterfield wrote:
> > I am trying to segment split a stream coming in from AVFOUNDATION
> >
> > ffmpeg -benchmark_all -stats -loglevel debug -copyts \
> >  -f avfoundation -capture_raw_data true -pix_fmt 0rgb -i DV-VCR -q 0 \
> >  -map 0 -c:v copy -c:a copy -segment_time 00:00:10 \
> >  -f segment  374_%03d.dv -y
> >
> > _ I have tried various combinations of “-increment_tc” and 
> > "-reset_timestamps 0"
> >
> > The video splits flawless at the time requ
>
> .dv is a bare bones container and does not support timestamps. Try MOV.
>
> Gyan
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Question on Segment TImes

2020-04-04 Thread Colin Bitterfield
Thanks,

That solved it.
On Apr 4, 2020, 2:11 AM -0700, Gyan Doshi , wrote:
>
>
> On 04-04-2020 11:59 am, Colin Bitterfield wrote:
> > I am trying to segment split a stream coming in from AVFOUNDATION
> >
> > ffmpeg -benchmark_all -stats -loglevel debug -copyts \
> >  -f avfoundation -capture_raw_data true -pix_fmt 0rgb -i DV-VCR -q 0 \
> >  -map 0 -c:v copy -c:a copy -segment_time 00:00:10 \
> >  -f segment  374_%03d.dv -y
> >
> > _ I have tried various combinations of “-increment_tc” and 
> > "-reset_timestamps 0"
> >
> > The video splits flawless at the time requ
>
> .dv is a bare bones container and does not support timestamps. Try MOV.
>
> Gyan
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Question on Segment TImes

2020-04-04 Thread Gyan Doshi



On 04-04-2020 11:59 am, Colin Bitterfield wrote:

I am trying to segment split a stream coming in from AVFOUNDATION

ffmpeg -benchmark_all -stats -loglevel debug -copyts \
  -f avfoundation -capture_raw_data true -pix_fmt 0rgb -i DV-VCR -q 0 \
  -map 0 -c:v copy -c:a copy -segment_time 00:00:10 \
  -f segment  374_%03d.dv -y

_ I have tried various combinations of “-increment_tc” and "-reset_timestamps 0"

The video splits flawless at the time requ


.dv is a bare bones container and does not support timestamps. Try MOV.

Gyan
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".