[Libav-user] libavcodec usage inside Cinelerra-GG [LONG]

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

[Libav-user] libavcodec usage inside Cinelerra-GG [LONG]

Andrew Randrianasulu
Hello, developers and users of libav!

I'm a bit of user (more tester than serious user) of video editing software called Cinelerra-GG

This is evolution of original Cinlerrra NLE, and current version uses ffmpeg/libavcodec 4.2

From manual available at https://cinelerra-gg.org/download/ (see CinelerraGG_manual_WIP.pdf)
I found important (IMO) passage I wish to share to relevant list:


p. 193:

Outstanding Issues with ffmpeg: There are some problems that need to be ad-
     dressed by the ffmpeg developer group that adversely affect Cinelerra. These
     are stated below with the hopes that that group will fix them as time permits.

• Make all the default parameters operational. When they are not, the
  Cinelerra plugins can’t be initialized since the initial state of the filter
  is not operational. If that is not possible, then provide a set of nominal
  parameters for each plugin, so that they can be used as the plugins
  initial default state.
• Make the filter config function project the new parameter data into
  the filter function at any point during filter operation. This is so that
  continuous updates can be done as the plugin operates.
• Improve seek codec restarts. The past predictor must be reset or recon-
  structed after a seek. The only documented way to seek is open/seek/-
  play. Reopening the format layer is very expensive.


I think I can also link in https://www.cinelerra-gg.org/bugtracker/view.php?id=330
because IMO it shows how wild timestamp can ruin synchro

I also found some other interesting areas of interaction between
libavcodec/libavformat and Cinelerra, for example timecode tracks in MOV container

I tested ffmpeg itself and it indeed was able to to put tcmd track into MOV,
while DV encapsulated in AVI (type 1) was not showing it at least from ffprobe.

So, I just extracted raw DV from AVI container, and tested this with ffprobe, and then
re-wrapped DV into mov (using example from ffmpeg's bugtracker)

ffmpeg -i  /home/guest/botva/Downloads/from_Vladimir/Leningrad\ dolphinarium\ 29\ 10\ 2004/UD\ 2004\ 10\ 29\ 01.avi -codec copy  DV.dv  

ffmpeg -i DV.dv -c copy  1.mov

ffmpeg -i 1.mov -metadata:s:v:0 reel_name=ABCDEF -codec copy 2.mov
ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --arch=i486 --target-os=linux --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --docdir=/usr/doc/ffmpeg-2.8.15 --enable-gpl --enable-version3 --disable-static --enable-shared --enable-runtime-cpudetect --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-ffserver --enable-doc --enable-avdevice --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-ladspa --enable-libass --enable-libbluray --disable-libbs2b --disable-libcaca --disable-libcelt --enable-libcdio --disable-libdc1394 --disable-libflite --enable-libfreetype --enable-libfribidi --disable-libgme --enable-libgsm --enable-libiec61883 --disable-libilbc --disable-libkvazaar --disable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --disable-libpulse --disable-libquvi --enable-librtmp --enable-libschroedinger --enable-libsmbclient --enable-libsnappy --disable-libsoxr --enable-libspeex --disable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-libzvbi --enable-lzma --enable-openal --enable-opengl --enable-sdl --enable-x11grab --enable-zlib --disable-debug
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.40.101
  Duration: 00:01:14.56, start: 0.000000, bitrate: 30337 kb/s
    Stream #0:0(eng): Video: dvvideo (dvcp / 0x70637664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 28800 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : DataHandler
      timecode        : 00:00:00:00
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : DataHandler
      timecode        : 00:00:00:00
[mov @ 0x8f395a0] Codec for stream 0 does not use global headers but container format requires global headers
[mov @ 0x8f395a0] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, mov, to '2.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.40.101
    Stream #0:0(eng): Video: dvvideo (dvcp / 0x70637664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=2-31, 28800 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
    Metadata:
      handler_name    : DataHandler
      timecode        : 00:00:00:00
      reel_name       : ABCDEF
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, 1536 kb/s (default)
    Metadata:
      handler_name    : DataHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1864 fps=0.0 q=-1.0 Lsize=  276121kB time=00:01:14.56 bitrate=30337.8kbits/s
video:262125kB audio:13980kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.005956%


guest@slax:/dev/shm$ ffprobe -show_stream 2.mov
ffprobe version 2.8.15 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --arch=i486 --target-os=linux --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --docdir=/usr/doc/ffmpeg-2.8.15 --enable-gpl --enable-version3 --disable-static --enable-shared --enable-runtime-cpudetect --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-ffserver --enable-doc --enable-avdevice --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-ladspa --enable-libass --enable-libbluray --disable-libbs2b --disable-libcaca --disable-libcelt --enable-libcdio --disable-libdc1394 --disable-libflite --enable-libfreetype --enable-libfribidi --disable-libgme --enable-libgsm --enable-libiec61883 --disable-libilbc --disable-libkvazaar --disable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --disable-libpulse --disable-libquvi --enable-librtmp --enable-libschroedinger --enable-libsmbclient --enable-libsnappy --disable-libsoxr --enable-libspeex --disable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-libzvbi --enable-lzma --enable-openal --enable-opengl --enable-sdl --enable-x11grab --enable-zlib --disable-debug
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Failed to set value '2.mov' for option 'show_stream': Option not found

guest@slax:/dev/shm$ ffprobe -show_format 2.mov
ffprobe version 2.8.15 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --arch=i486 --target-os=linux --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --docdir=/usr/doc/ffmpeg-2.8.15 --enable-gpl --enable-version3 --disable-static --enable-shared --enable-runtime-cpudetect --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-ffserver --enable-doc --enable-avdevice --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-ladspa --enable-libass --enable-libbluray --disable-libbs2b --disable-libcaca --disable-libcelt --enable-libcdio --disable-libdc1394 --disable-libflite --enable-libfreetype --enable-libfribidi --disable-libgme --enable-libgsm --enable-libiec61883 --disable-libilbc --disable-libkvazaar --disable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --disable-libpulse --disable-libquvi --enable-librtmp --enable-libschroedinger --enable-libsmbclient --enable-libsnappy --disable-libsoxr --enable-libspeex --disable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-libzvbi --enable-lzma --enable-openal --enable-opengl --enable-sdl --enable-x11grab --enable-zlib --disable-debug
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.40.101
  Duration: 00:01:14.56, start: 0.000000, bitrate: 30337 kb/s
    Stream #0:0(eng): Video: dvvideo (dvcp / 0x70637664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 28800 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : DataHandler
      timecode        : 00:00:00:00
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : DataHandler
      reel_name       : ABCDEF
      timecode        : 00:00:00:00
Unsupported codec with id 0 for input stream 2
[FORMAT]
filename=2.mov
nb_streams=3
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=74.560000
size=282748359
bit_rate=30337806
probe_score=100
TAG:major_brand=qt
TAG:minor_version=512
TAG:compatible_brands=qt
TAG:encoder=Lavf56.40.101
[/FORMAT]
guest@slax:/dev/shm$ rm 2.mov


guest@slax:/dev/shm$ ffmpeg -i 1.mov -timecode 01:02:03:04 -metadata:s:v:0 reel_name=ABCDEF -codec copy 2.mov
ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --arch=i486 --target-os=linux --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --docdir=/usr/doc/ffmpeg-2.8.15 --enable-gpl --enable-version3 --disable-static --enable-shared --enable-runtime-cpudetect --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-ffserver --enable-doc --enable-avdevice --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-ladspa --enable-libass --enable-libbluray --disable-libbs2b --disable-libcaca --disable-libcelt --enable-libcdio --disable-libdc1394 --disable-libflite --enable-libfreetype --enable-libfribidi --disable-libgme --enable-libgsm --enable-libiec61883 --disable-libilbc --disable-libkvazaar --disable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --disable-libpulse --disable-libquvi --enable-librtmp --enable-libschroedinger --enable-libsmbclient --enable-libsnappy --disable-libsoxr --enable-libspeex --disable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-libzvbi --enable-lzma --enable-openal --enable-opengl --enable-sdl --enable-x11grab --enable-zlib --disable-debug
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.40.101
  Duration: 00:01:14.56, start: 0.000000, bitrate: 30337 kb/s
    Stream #0:0(eng): Video: dvvideo (dvcp / 0x70637664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 28800 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : DataHandler
      timecode        : 00:00:00:00
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : DataHandler
      timecode        : 00:00:00:00
[mov @ 0x81334c0] Codec for stream 0 does not use global headers but container format requires global headers
[mov @ 0x81334c0] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, mov, to '2.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    timecode        : 01:02:03:04
    encoder         : Lavf56.40.101
    Stream #0:0(eng): Video: dvvideo (dvcp / 0x70637664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=2-31, 28800 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
    Metadata:
      handler_name    : DataHandler
      timecode        : 00:00:00:00
      reel_name       : ABCDEF
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, 1536 kb/s (default)
    Metadata:
      handler_name    : DataHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1864 fps=0.0 q=-1.0 Lsize=  276121kB time=00:01:14.56 bitrate=30337.8kbits/s
video:262125kB audio:13980kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.005956%

guest@slax:/dev/shm$ ffprobe -show_format 2.mov
ffprobe version 2.8.15 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --arch=i486 --target-os=linux --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --docdir=/usr/doc/ffmpeg-2.8.15 --enable-gpl --enable-version3 --disable-static --enable-shared --enable-runtime-cpudetect --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-ffserver --enable-doc --enable-avdevice --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-ladspa --enable-libass --enable-libbluray --disable-libbs2b --disable-libcaca --disable-libcelt --enable-libcdio --disable-libdc1394 --disable-libflite --enable-libfreetype --enable-libfribidi --disable-libgme --enable-libgsm --enable-libiec61883 --disable-libilbc --disable-libkvazaar --disable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --disable-libpulse --disable-libquvi --enable-librtmp --enable-libschroedinger --enable-libsmbclient --enable-libsnappy --disable-libsoxr --enable-libspeex --disable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-libzvbi --enable-lzma --enable-openal --enable-opengl --enable-sdl --enable-x11grab --enable-zlib --disable-debug
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.40.101
  Duration: 00:01:14.56, start: 0.000000, bitrate: 30337 kb/s
    Stream #0:0(eng): Video: dvvideo (dvcp / 0x70637664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 28800 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : DataHandler
      timecode        : 01:02:03:04
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : DataHandler
      reel_name       : ABCDEF
      timecode        : 01:02:03:04
Unsupported codec with id 0 for input stream 2
[FORMAT]
filename=2.mov
nb_streams=3
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=74.560000
size=282748359
bit_rate=30337806
probe_score=100
TAG:major_brand=qt
TAG:minor_version=512
TAG:compatible_brands=qt
TAG:encoder=Lavf56.40.101
[/FORMAT]


mediainfo 2.mov
General
Complete name                            : 2.mov
Format                                   : MPEG-4
Commercial name                          : DVCPRO
Format profile                           : QuickTime
Codec ID                                 : qt   0000.02 (qt  )
File size                                : 270 MiB
Duration                                 : 1 min 14 s
Overall bit rate                         : 30.3 Mb/s
Recorded date                            : 1970-01-01 00:00:00.000
Writing application                      : Lavf56.40.101

Video
ID                                       : 1
Format                                   : DV
Commercial name                          : DVCPRO
Codec ID                                 : dvcp
Duration                                 : 1 min 14 s
Bit rate mode                            : Constant
Bit rate                                 : 24.4 Mb/s
Encoded bit rate                         : 28.8 Mb/s
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Bottom Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 2.357
Time code of first frame                 : 00:00:00:00
Time code source                         : Subcode time code
Stream size                              : 217 MiB (81%)
Encoded stream size                      : 256 MiB (95%)
Encoding settings                        : ae mode=manual / wb mode=automatic / white balance= / fcm=manual focus
Language                                 : English

Audio #1
ID                                       : 2
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : sowt
Duration                                 : 1 min 14 s
Bit rate mode                            : Constant
Bit rate                                 : 1 536 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Stream size                              : 13.7 MiB (5%)
Language                                 : English
Default                                  : Yes
Alternate group                          : 1

Audio #2
ID                                       : 1-0
Format                                   : PCM
Muxing mode                              : DV
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 1 min 14 s
Bit rate mode                            : Constant
Bit rate                                 : 1 536 kb/s
Encoded bit rate                         : 0 b/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Delay relative to video                  : -1 h 2 min
Stream size                              : 13.7 MiB (5%)
Encoded stream size                      : 0.00 Byte (0%)

Other
ID                                       : 3
Type                                     : Time code
Format                                   : QuickTime TC
Duration                                 : 1 min 14 s
Time code of first frame                 : 01:02:03:04
Time code, striped                       : Yes
Title                                    : ABCDEF
Language                                 : English
Default                                  : No


guest@slax:/dev/shm$ ffprobe -show_streams 2.mov
ffprobe version 2.8.15 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --arch=i486 --target-os=linux --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --docdir=/usr/doc/ffmpeg-2.8.15 --enable-gpl --enable-version3 --disable-static --enable-shared --enable-runtime-cpudetect --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-ffserver --enable-doc --enable-avdevice --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-ladspa --enable-libass --enable-libbluray --disable-libbs2b --disable-libcaca --disable-libcelt --enable-libcdio --disable-libdc1394 --disable-libflite --enable-libfreetype --enable-libfribidi --disable-libgme --enable-libgsm --enable-libiec61883 --disable-libilbc --disable-libkvazaar --disable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --disable-libpulse --disable-libquvi --enable-librtmp --enable-libschroedinger --enable-libsmbclient --enable-libsnappy --disable-libsoxr --enable-libspeex --disable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-libzvbi --enable-lzma --enable-openal --enable-opengl --enable-sdl --enable-x11grab --enable-zlib --disable-debug
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.40.101
  Duration: 00:01:14.56, start: 0.000000, bitrate: 30337 kb/s
    Stream #0:0(eng): Video: dvvideo (dvcp / 0x70637664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 28800 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : DataHandler
      timecode        : 01:02:03:04
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : DataHandler
      reel_name       : ABCDEF
      timecode        : 01:02:03:04
Unsupported codec with id 0 for input stream 2
[STREAM]
index=0
codec_name=dvvideo
codec_long_name=DV (Digital Video)
profile=unknown
codec_type=video
codec_time_base=1/25
codec_tag_string=dvcp
codec_tag=0x70637664
width=720
height=576
coded_width=720
coded_height=576
has_b_frames=0
sample_aspect_ratio=16:15
display_aspect_ratio=4:3
pix_fmt=yuv420p
level=-99
color_range=N/A
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=topleft
timecode=N/A
refs=1
id=N/A
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/12800
start_pts=0
start_time=0.000000
duration_ts=954368
duration=74.560000
bit_rate=28800000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=1864
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
TAG:language=eng
TAG:handler_name=DataHandler
TAG:timecode=01:02:03:04
[/STREAM]
[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/48000
codec_tag_string=sowt
codec_tag=0x74776f73
sample_fmt=s16
sample_rate=48000
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/48000
start_pts=0
start_time=0.000000
duration_ts=3578880
duration=74.560000
bit_rate=1536000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=3578880
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
TAG:language=eng
TAG:handler_name=DataHandler
[/STREAM]
[STREAM]
index=2
codec_name=unknown
codec_long_name=unknown
profile=unknown
codec_type=data
codec_time_base=1/25
codec_tag_string=tmcd
codec_tag=0x64636d74
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/12800
start_pts=0
start_time=0.000000
duration_ts=954368
duration=74.560000
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=1
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
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
TAG:language=eng
TAG:handler_name=DataHandler
TAG:reel_name=ABCDEF
TAG:timecode=01:02:03:04
[/STREAM]

-----------

all this dance just for showing to myself this timecode thing actually exist in DV and can be embedded into MOV (at least)

use-case basically about normal timecode use - multi-camera synchronization, prescie cuts, and alike.

See https://www.cinelerra-gg.org/bugtracker/view.php?id=334 where I collected few links
(basically timecode used in EDL format CMX3600, and this format can be used
by other programs, like Blender, KDE's NLE, something else ..there are some bugs in CinGG
about frame accuracy ATM [https://www.cinelerra-gg.org/bugtracker/view.php?id=329], but after they are fixed ...

While I'm myself not developer enough for implementing new features
 - i usually dig into docs and come up with something developers can use.

I usually read ffmpeg-devel, but I'm not subscribed to it (due to rel. high traffic there)

I'll be happy to help in communication/testing between two projects.
_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Carl Eugen Hoyos-2
Am Sa., 2. Nov. 2019 um 23:32 Uhr schrieb Andrew Randrianasulu
<[hidden email]>:

> From manual available at https://cinelerra-gg.org/download/ (see CinelerraGG_manual_WIP.pdf)
> I found important (IMO) passage I wish to share to relevant list:
>
>
> p. 193:
>
> Outstanding Issues with ffmpeg: There are some problems that need to be ad-
>      dressed by the ffmpeg developer group that adversely affect Cinelerra. These
>      are stated below with the hopes that that group will fix them as time permits.
>
> • Make all the default parameters operational. When they are not, the
>   Cinelerra plugins can’t be initialized since the initial state of the filter
>   is not operational. If that is not possible, then provide a set of nominal
>   parameters for each plugin, so that they can be used as the plugins
>   initial default state.
> • Make the filter config function project the new parameter data into
>   the filter function at any point during filter operation. This is so that
>   continuous updates can be done as the plugin operates.
> • Improve seek codec restarts. The past predictor must be reset or recon-
>   structed after a seek. The only documented way to seek is open/seek/-
>   play. Reopening the format layer is very expensive.

Sadly, this is not how it works.

Feel free to open one reproducible (!) bug report against current
FFmpeg git head
on trac for one issue, pointing us to a pdf here will most likely not help.

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Carl Eugen Hoyos-2
In reply to this post by Andrew Randrianasulu
Am Sa., 2. Nov. 2019 um 23:32 Uhr schrieb Andrew Randrianasulu
<[hidden email]>:

> I think I can also link in https://www.cinelerra-gg.org/bugtracker/view.php?id=330
> because IMO it shows how wild timestamp can ruin synchro

I tested the following and the output file has fine noise, no "pulsed noise":
$ ffmpeg -ss 11:00 -i LD_160909_2.avi -qscale 2 out.avi

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Andrew Randrianasulu
В сообщении от Sunday 03 November 2019 09:01:42 Carl Eugen Hoyos написал(а):
> Am Sa., 2. Nov. 2019 um 23:32 Uhr schrieb Andrew Randrianasulu
> <[hidden email]>:
>
> > I think I can also link in https://www.cinelerra-gg.org/bugtracker/view.php?id=330
> > because IMO it shows how wild timestamp can ruin synchro
>
> I tested the following and the output file has fine noise, no "pulsed noise":
> $ ffmpeg -ss 11:00 -i LD_160909_2.avi -qscale 2 out.avi

Yeah, it should work in ffmpeg. This is why I posted this to Libav-user,
because Cinelerra _is_ libav user, from programmer's perspective ....

https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blob;f=cinelerra-5.1/cinelerra/ffmpeg.C;h=70098ca189c5267b3aeea8bfdb9de8ea19f051ff;hb=HEAD

function int FFStream::seek(int64_t no, double rate)

for some reason I saw timestamps even going negative.

Is it normal, for stream seek, or application must deal with this problem ?


AVRational time_base = st->time_base;
      int64_t tstmp = time_base.num > 0 ? secs * time_base.den/time_base.num : 0;

for some reason stream's time_base was going from 1/25 to 1/30000 after seek, and this confused everything....

>
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Carl Eugen Hoyos-2
Am So., 3. Nov. 2019 um 07:43 Uhr schrieb Andrew Randrianasulu
<[hidden email]>:

>
> В сообщении от Sunday 03 November 2019 09:01:42 Carl Eugen Hoyos написал(а):
> > Am Sa., 2. Nov. 2019 um 23:32 Uhr schrieb Andrew Randrianasulu
> > <[hidden email]>:
> >
> > > I think I can also link in https://www.cinelerra-gg.org/bugtracker/view.php?id=330
> > > because IMO it shows how wild timestamp can ruin synchro
> >
> > I tested the following and the output file has fine noise, no "pulsed noise":
> > $ ffmpeg -ss 11:00 -i LD_160909_2.avi -qscale 2 out.avi
>
> Yeah, it should work in ffmpeg. This is why I posted this to Libav-user,
> because Cinelerra _is_ libav user, from programmer's perspective ....
>
> https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blob;f=cinelerra-5.1/cinelerra/ffmpeg.C;h=70098ca189c5267b3aeea8bfdb9de8ea19f051ff;hb=HEAD
>
> function int FFStream::seek(int64_t no, double rate)
>
> for some reason I saw timestamps even going negative.

For some files, this is expected but I don't see the code checking
for AV_NOPTS_VALUE.

> Is it normal, for stream seek, or application must deal with this problem ?
>
>
> AVRational time_base = st->time_base;
>       int64_t tstmp = time_base.num > 0 ? secs * time_base.den/time_base.num : 0;
>
> for some reason stream's time_base was going from 1/25 to 1/30000
> after seek, and this confused everything....

Did you already check how ffmpeg.c deals with seeking in this file?

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Andrew Randrianasulu
В сообщении от Sunday 03 November 2019 13:15:27 Carl Eugen Hoyos написал(а):

> Am So., 3. Nov. 2019 um 07:43 Uhr schrieb Andrew Randrianasulu
> <[hidden email]>:
> >
> > В сообщении от Sunday 03 November 2019 09:01:42 Carl Eugen Hoyos написал(а):
> > > Am Sa., 2. Nov. 2019 um 23:32 Uhr schrieb Andrew Randrianasulu
> > > <[hidden email]>:
> > >
> > > > I think I can also link in https://www.cinelerra-gg.org/bugtracker/view.php?id=330
> > > > because IMO it shows how wild timestamp can ruin synchro
> > >
> > > I tested the following and the output file has fine noise, no "pulsed noise":
> > > $ ffmpeg -ss 11:00 -i LD_160909_2.avi -qscale 2 out.avi
> >
> > Yeah, it should work in ffmpeg. This is why I posted this to Libav-user,
> > because Cinelerra _is_ libav user, from programmer's perspective ....
> >
> > https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blob;f=cinelerra-5.1/cinelerra/ffmpeg.C;h=70098ca189c5267b3aeea8bfdb9de8ea19f051ff;hb=HEAD
> >
> > function int FFStream::seek(int64_t no, double rate)
> >
> > for some reason I saw timestamps even going negative.
>
> For some files, this is expected but I don't see the code checking
> for AV_NOPTS_VALUE.
>
> > Is it normal, for stream seek, or application must deal with this problem ?
> >
> >
> > AVRational time_base = st->time_base;
> >       int64_t tstmp = time_base.num > 0 ? secs * time_base.den/time_base.num : 0;
> >
> > for some reason stream's time_base was going from 1/25 to 1/30000
> > after seek, and this confused everything....
>
> Did you already check how ffmpeg.c deals with seeking in this file?

How to do this? I only printed both parts of time_base in this function ....
there was some commented out code probably doing seeking 'ffmpeg' way,
but I don't know what exactly was wrong with this code - Cinelerra can deal with things like
multiprogram .ts file from tuner and I have no such files ....

For what exactly I should look?

>
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Carl Eugen Hoyos-2
Am So., 3. Nov. 2019 um 11:53 Uhr schrieb Andrew Randrianasulu
<[hidden email]>:

> For what exactly I should look?

You claim that AVStream->time_base is changing (which sounds strange to me
but who know) on seeking, you could look (with printf's) how ffmpeg.c
deals with this.
I cannot know...

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Andrew Randrianasulu
В сообщении от Sunday 03 November 2019 13:56:09 Carl Eugen Hoyos написал(а):
> Am So., 3. Nov. 2019 um 11:53 Uhr schrieb Andrew Randrianasulu
> <[hidden email]>:
>
> > For what exactly I should look?
>
> You claim that AVStream->time_base is changing (which sounds strange to me
> but who know) on seeking, you could look (with printf's) how ffmpeg.c
> deals with this.
> I cannot know...

https://www.cinelerra-gg.org/bugtracker/view.php?id=330

after such mod:
int FFStream::seek(int64_t no, double rate)
{
// default ffmpeg native seek
int npkts = 1;
int64_t pos = no, pkt_pos = -1;
IndexMarks index_markers = get_markers();
if( index_markers && index_markers->size() > 1 ) {
IndexMarks &marks = index_markers;
int i = marks.find(pos);
int64_t n = i < 0 ? (i=0) : marks[i].no;
// if indexed seek point not too far away (<30 secs), use index
if( no-n < 30rate ) {
if( n < 0 ) n = 0;
pos = n;
if( i < marks.size() ) pkt_pos = marks[i].pos;
npkts = MAX_RETRY;
}
}
if( pos == curr_pos ) return 0;
double secs = pos < 0 ? 0. : pos / rate;
AVRational time_base = st->time_base;
AVRational time_base2 = av_inv_q(avctx->framerate);
fprintf(stderr, "Timebase from stream: %i,%i \n", time_base.num, time_base.den);
fprintf(stderr, "Timebase from codec: %i,%i \n", time_base2.num, time_base2.den);
int64_t tstmp = time_base.num > 0 ? secs time_base.den/time_base.num : 0;
int64_t tstmp2 = av_rescale_q(tstmp, time_base, AV_TIME_BASE_Q);
if (time_base.den != time_base2.den) {
//fprintf (stderr, "timebases for stream and code differ!\n");
//fprintf (stderr, "Timestamps tstmp, tstmp2: %jd,%jd \n", tstmp, tstmp2);
//fprintf (stderr, "using default 25 fps ones!\n");
//tstmp = secs * 25;
}

I see this output:

LANG=ru_RU.utf8 /dev/shm/tmp/cinelerra-goodguy-20191029/cinelerra-5.1/bin/cin
Cinelerra Infinity - built: Oct 29 2019 11:57:50
git://git.cinelerra-gg.org/goodguy/cinelerra.git
(c) 2006-2019 Heroine Virtual Ltd. by Adam Williams
(c) 2007-2019 cin5 derivative by W.P. Morrow aka goodguy
Cinelerra is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions. There is absolutely no warranty for Cinelerra.

FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
Device type none is not supported.
Available device types: vdpau cuda vaapi opencl
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
Device type none is not supported.
Available device types: vdpau cuda vaapi opencl
Timebase from stream: 1,25
Timebase from codec: 1,0
Timebase from stream: 1,25
Timebase from codec: 1,0
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
Device type none is not supported.
Available device types: vdpau cuda vaapi opencl
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
Timebase from stream: 1,25
Timebase from codec: 1,25
Timebase from stream: 1,25
Timebase from codec: 1,25
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Timebase from stream: 1,30000
Timebase from codec: 1,0
Session time: 0:00:47

You can try to build whole thing too :} (120Mb for git copy with -depth 1)

>
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Andrew Randrianasulu
In reply to this post by Carl Eugen Hoyos-2
В сообщении от Sunday 03 November 2019 13:56:09 Carl Eugen Hoyos написал(а):
> Am So., 3. Nov. 2019 um 11:53 Uhr schrieb Andrew Randrianasulu
> <[hidden email]>:
>
> > For what exactly I should look?
>
> You claim that AVStream->time_base is changing (which sounds strange to me
> but who know) on seeking, you could look (with printf's) how ffmpeg.c
> deals with this.
> I cannot know...

Update, just compiled CinelerraGG with ffmpeg.git

LANG=ru_RU.utf8 /dev/shm/tmp/cinelerra-goodguy-20191104/cinelerra-5.1/bin/cin
Cinelerra Infinity - built: Nov  4 2019 16:35:57
git://git.cinelerra-gg.org/goodguy/cinelerra.git
(c) 2006-2019 Heroine Virtual Ltd. by Adam Williams
(c) 2007-2019 cin5 derivative by W.P. Morrow aka goodguy
Cinelerra is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions. There is absolutely no warranty for Cinelerra.

FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
Device type none is not supported.
Available device types: vdpau cuda vaapi opencl
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
Device type none is not supported.
Available device types: vdpau cuda vaapi opencl
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
Device type none is not supported.
Available device types: vdpau cuda vaapi opencl
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,25
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
FFMPEG::open_decoder: some stream times estimated: /home/guest/botva/Downloads/from_Vladimir/Leningrad dolphinarium 16 09 2009/LD_160909_2.avi
Timebase from stream: 1,25
Timebase from stream: 1,25
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Timebase from stream: 1,30000
Session time: 0:00:19
Cpu time: user: 0:00:04.433 sys: 0:00:01.064

1,25 print was before I tried to seek in stream, but it jumped to 1,30000 after I tried to set playback cursor
to some 3 min into video.

Cinelerra git:
commit 83cdf330ba14342487a08d72e25ef29736d41100 (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: Good Guy <[hidden email]>
Date:   Sat Nov 2 19:32:42 2019 -0600

    correct last chkin dvd opts files

ffmpeg.git:
commit ec3d3fc65d06a9f7bc4d32b12b14a7c75e00484d (HEAD -> master, origin/master, origin/HEAD)
Author: Jun Zhao <[hidden email]>
Date:   Sat Jun 15 16:21:56 2019 +0800

    lavf/asfdec: Simplify the check conditions

    Simplify the check conditions

    Signed-off-by: Jun Zhao <[hidden email]>


my diff for ffmpeg.c:

diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
index 70098ca..3cf85a9 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
@@ -681,7 +681,11 @@ int FFStream::seek(int64_t no, double rate)
        }
        if( pos == curr_pos ) return 0;
        double secs = pos < 0 ? 0. : pos / rate;
-       AVRational time_base = st->time_base;
+// if user forced timebase to a specified stream
+       AVRational time_base = ffmpeg->force_timebase >= 0 ?
+               ffmpeg->fmt_ctx->streams[ffmpeg->force_timebase]->time_base :
+               st->time_base;
+               fprintf(stderr, "Timebase from stream: %i,%i \n", time_base.num, time_base.den);
        int64_t tstmp = time_base.num > 0 ? secs * time_base.den/time_base.num : 0;
        if( !tstmp ) {
                if( st->nb_index_entries > 0 ) tstmp = st->index_entries[0].timestamp;
@@ -1192,10 +1196,19 @@ int FFVideoStream::video_seek(int64_t pos)
        if( pos == curr_pos-1 && !seeked ) return 0;
 // if close enough, just read up to current
        int gop = avctx->gop_size;
-       if( gop < 4 ) gop = 4;
+       if( gop < 4 && gop != 0) gop = 4;
        if( gop > 64 ) gop = 64;
+       if( gop == 0 ) gop = 1;
+       //fprintf(stderr, "GOP: %i \n", gop);
        int read_limit = curr_pos + 3*gop;
        if( pos >= curr_pos && pos <= read_limit ) return 0;
+       // fixup for I-only codecs, not sure why it needed with ffmpeg 4.2
+       if (st->codecpar->codec_id == AV_CODEC_ID_DVVIDEO || st->codecpar->codec_id == AV_CODEC_ID_MJPEG ||
+       st->codecpar->codec_id == AV_CODEC_ID_FFVHUFF || st->codecpar->codec_id == AV_CODEC_ID_DNXHD ||
+       st->codecpar->codec_id ==AV_CODEC_ID_HUFFYUV ) {
+       gop = 1;
+       if( seek(pos - 2*gop, frame_rate) < 0 ) return -1;
+       }
 // guarentee preload more than 2*gop frames
        if( seek(pos - 3*gop, frame_rate) < 0 ) return -1;
        return 1;
@@ -1576,6 +1589,7 @@ FFMPEG::FFMPEG(FileBase *file_base)
        flow = 1;
        decoding = encoding = 0;
        has_audio = has_video = 0;
+       force_timebase = -1;
        opts = 0;
        opt_duration = -1;
        opt_video_filter = 0;
@@ -2271,6 +2285,8 @@ int FFMPEG::init_decoder(const char *filename)
                if( (tag=av_dict_get(opts, "format", NULL, 0)) != 0 ) {
                        ifmt = av_find_input_format(tag->value);
                }
+               if( (tag=av_dict_get(opts, "force_timebase", NULL, 0)) != 0 )
+                       force_timebase = atoi(tag->value);
        }
        else
                load_options("decode.opts", opts);

actually patch was mostly developed by CinelerraGG developer, I only added

 fprintf(stderr, "Timebase from stream: %i,%i \n", time_base.num, time_base.den);

(for testing I moved opts file I used to fix this stream away:

mv /home/guest/botva/Downloads/from_Vladimir/Leningrad\ dolphinarium\ 16\ 09\ 2009/LD_160909_2.opts \
/home/guest/botva/Downloads/from_Vladimir/Leningrad\ dolphinarium\ 16\ 09\ 2009/LD_160909_2___.opts )

Is this enough for demonstrating problem ?

>
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Carl Eugen Hoyos-2
Am Mo., 4. Nov. 2019 um 16:27 Uhr schrieb Andrew Randrianasulu
<[hidden email]>:

> my diff for ffmpeg.c:
>
> diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C

When I said in an earlier mail you check how ffmpeg.c deals with seeking in
your file, I did not mean cinelerra/ffmpeg.C but fftools/ffmpeg.c in the
FFmpeg sources...

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Andrew Randrianasulu
В сообщении от Monday 04 November 2019 20:51:06 Carl Eugen Hoyos написал(а):

> Am Mo., 4. Nov. 2019 um 16:27 Uhr schrieb Andrew Randrianasulu
> <[hidden email]>:
>
> > my diff for ffmpeg.c:
> >
> > diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
>
> When I said in an earlier mail you check how ffmpeg.c deals with seeking in
> your file, I did not mean cinelerra/ffmpeg.C but fftools/ffmpeg.c in the
> FFmpeg sources...

Ah. unfortunately, i think it will work just fine ...
(I'll check, but I have feeling my bug comes from quite complex
requirements of multitrack video editor, as opposed to mostly linear-forward ffmpeg)

Thanks for clarification.

>
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec usage inside Cinelerra-GG [LONG]

Andrew Randrianasulu
In reply to this post by Carl Eugen Hoyos-2
В сообщении от Monday 04 November 2019 20:51:06 Carl Eugen Hoyos написал(а):

> Am Mo., 4. Nov. 2019 um 16:27 Uhr schrieb Andrew Randrianasulu
> <[hidden email]>:
>
> > my diff for ffmpeg.c:
> >
> > diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
>
> When I said in an earlier mail you check how ffmpeg.c deals with seeking in
> your file, I did not mean cinelerra/ffmpeg.C but fftools/ffmpeg.c in the
> FFmpeg sources...

My naive search for 'seek' only resulted in

static int seek_to_start(InputFile *ifile, AVFormatContext *is) function..I'll try to understand what it does and compare ..

still, my whole file backward reading  caught this comment:


static void do_video_out(OutputFile *of,
                         OutputStream *ost,
                         AVFrame *next_picture,
                         double sync_ipts)

and down this function ....

case VSYNC_CFR:
            // FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c
            if (frame_drop_threshold && delta < frame_drop_threshold && ost->frame_number) {
                nb_frames = 0;
            } else if (delta < -1.1)
                nb_frames = 0;
            else if (delta > 1.1) {
                nb_frames = lrintf(delta);
                if (delta0 > 1.1)
                    nb0_frames = lrintf(delta0 - 0.6);
            }
            break;

are there still bugs in avidec.c ? Because, well, this CinelerraGG bug mainfest itself on AVI container ....
 

>
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".