VideoHelp Forum
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. Hello.

    I was recentely dumping miniDV tapes with two audio tracks, Scenalyzer outputs stereo AVI and second audio track as WAV, so I thought of using ffmpeg to merge them:
    Code:
    ffmpeg -i input_video_with_audio.avi -i new_audio.wav -map 0 -map 1 -codec copy output_video.avi
    And the
    Code:
    -codec copy
    somehow changes the interlaced video type to progressive, as inspected in mediainfo.
    Below the info from the original file:
    Code:
    Video
    ID                                       : 0
    Format                                   : DV
    Commercial name                          : DVCPRO
    Codec ID                                 : dvsd
    Codec ID/Hint                            : Sony
    Duration                                 : 7 min 10 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:01
    Time code source                         : Subcode time code
    Stream size                              : 1.44 GiB (96%)
    Encoding settings                        : wb mode= / white balance= / fcm=auto focus
    And here is the output:
    Code:
    Video
    ID                                       : 0
    Format                                   : DV
    Commercial name                          : DVCPRO
    Codec ID                                 : dvsd
    Codec ID/Hint                            : Sony
    Duration                                 : 7 min 10 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                                : Progressive
    Original scan type                       : Interlaced
    Original scan order                      : Bottom Field First
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 2.357
    Time code of first frame                 : 00:00:00:01
    Time code source                         : Subcode time code
    Stream size                              : 1.44 GiB (93%)
    Encoding settings                        : wb mode= / white balance= / fcm=auto focus
    Why is the scan type changed?
    And how to get ffmpeg to simply add the second audio stream without changing any parameter of the video and audio streams?
    Quote Quote  
  2. haven't done this in a while, but iirc you need to add:
    Code:
    -top 0
    for bff signaling
    see: https://www.ffmpeg.org/ffmpeg-all.html#Advanced-Video-option
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Originally Posted by Selur View Post
    haven't done this in a while, but iirc you need to add:
    Code:
    -top 0
    for bff signaling
    see: https://www.ffmpeg.org/ffmpeg-all.html#Advanced-Video-option
    thank you, but that didn't change anything.

    While i'm at it maybe i should change sample aspect ratio fro default and incorrect 16:15 to proper 128/117, ut i'd need to go through all the other tapes as well...

    From what i can see it affects the input video:
    https://www.ffmpeg.org/ffmpeg-all.html#toc-Options-1

    I think I'm one step closer, the option
    Code:
    field_order field_order (video)
    might be the solution, but for bottom field first there is a switch where bff is encoded first and tff is encoded first, i would assume it's the bottom showed and encoded first, right?
    Last edited by SF01; 28th Mar 2020 at 13:03.
    Quote Quote  
  4. you can try if:
    Code:
    -flags +ildct+ilme
    helps.

    Cu Selur

    Ps.: if you share a short sample of the source I can reproduce and try to check the flags myself.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  5. Originally Posted by Selur View Post
    you can try if:
    Code:
    -flags +ildct+ilme
    helps.

    Cu Selur

    Ps.: if you share a short sample of the source I can reproduce and try to check the flags myself.
    I already tried it, it does not have the effect.

    But the one I mentioned above seems to work, I am however not certain if it's correct, DV has bottom field displayed first, but I cannot find any niformation of the bottom or top is coded first.
    Quote Quote  
  6. Been there, tried that, results as in first post.

    What I tried and worked i have describes later, but i don't know which switch to use for that, as there are 4.
    Quote Quote  
  7. Originally Posted by SF01 View Post
    I think I'm one step closer, the option
    Code:
    field_order field_order (video)
    might be the solution, but for bottom field first there is a switch where bff is encoded first and tff is encoded first, i would assume it's the bottom showed and encoded first, right?
    'bb' appears to be correct.
    Quote Quote  
  8. What's about -vf 'interlace=scan=tff:lowpass=complex' -flags +ildct?
    Quote Quote  
  9. Originally Posted by ProWo View Post
    What's about -vf 'interlace=scan=tff:lowpass=complex' -flags +ildct?
    Code:
    Filtergraph ''interlace=scan=tff:lowpass=complex'' was defined for video output stream 0:0 but codec copy was selected.
    Filtering and streamcopy cannot be used together.
    Not an option. like I said, it must be the one I mentioned before, but the question is it's either bottom shown first and encoded first, or bottom whoed first, but top encoded first. And I cannot find any information which one is encoded first in DV specification.
    Quote Quote  
  10. I found the solution. It's the avi muxer from FFmpeg that sets the progressive flag. You have to use the mkv muxer instead like this:
    ffmpeg -i input_video_with_audio.avi -i new_audio.wav -map 0 -map 1 -codec copy output_video.mkv
    Then use mkvcleaver to extract the avi file.
    Quote Quote  
  11. I compared the output of a DV AVI created by VirtualDub, AviDemux, and ffmpeg. MediaInfo reports

    Code:
    Scan type                                : Interlaced
    Scan order                               : Bottom Field First
    for the VirtualDub, AviDemux, and ffmpeg with -field_order bb videos. But with -field_order tb it reports:

    Code:
    Scan type                                : Interlaced
    Scan order                               : Top Field First
    Original scan order                      : Bottom Field First
    All the files played properly in the media players I tried. Even ffmpeg created videos with -field_order tt and bt (which are definitely wrong). The players were all set up to display 30i video at 59.94 fps.

    I looked a little more closely at what ffmpeg does that's different than the other programs: Ffmpeg adds an ODML 2.0 vprp chunk with the field order flags. The other editors don't. This is the first time I've seen an AVI file with a vprp chunk. I don't think many programs create or pay any attention to vprp chunks.

    By the way, to get ffmpeg to include all audio streams when it remuxes use -map 0. If your second audio stream is from a second source file use -map file:stream to indicate which streams you want to include. Something like -map 0:0 -map 0:1 -map 1:1 (include streams 0 and 1 of the first input file, stream 1 of the second input file).

    https://github.com/stoyanovgeorge/ffmpeg/wiki/How-to-Map-Streams-in-FFMPEG
    Quote Quote  
  12. Originally Posted by jagabo View Post
    I compared the output of a DV AVI created by VirtualDub, AviDemux, and ffmpeg. MediaInfo reports

    Code:
    Scan type                                : Interlaced
    Scan order                               : Bottom Field First
    for the VirtualDub, AviDemux, and ffmpeg with -field_order bb videos. But with -field_order tb it reports:

    Code:
    Scan type                                : Interlaced
    Scan order                               : Top Field First
    Original scan order                      : Bottom Field First
    All the files played properly in the media players I tried. Even ffmpeg created videos with -field_order tt and bt (which are definitely wrong). The players were all set up to display 30i video at 59.94 fps.

    I looked a little more closely at what ffmpeg does that's different than the other programs: Ffmpeg adds an ODML 2.0 vprp chunk with the field order flags. The other editors don't. This is the first time I've seen an AVI file with a vprp chunk. I don't think many programs create or pay any attention to vprp chunks.

    By the way, to get ffmpeg to include all audio streams when it remuxes use -map 0. If your second audio stream is from a second source file use -map filetream to indicate which streams you want to include. Something like -map 0:0 -map 0:1 -map 1:1 (include streams 0 and 1 of the first input file, stream 1 of the second input file).

    https://github.com/stoyanovgeorge/ffmpeg/wiki/How-to-Map-Streams-in-FFMPEG
    This answers my question, so the bb switch is correct, and the tb in tis case is incorrect.

    In my case -map 0 -map 1 will suffice, The first file is DV+audio, the othwe is second stereo track in separate WAV, so no need to specify streams inside files, as i want to mx everything together.

    Thank you for the information, so the whole comman will look like this:
    Code:
    ffmpeg -i input_video_with_audio.avi -i new_audio.wav -map 0 -map 1 -codec copy -field_order bb output_video.avi
    I've just oticed that in media info in the general info there is a new line:
    Code:
    Format profile                           : OpenDML
    What is it and why it suddenly appears is beyond me. Any switch to disable it?
    Last edited by SF01; 30th Mar 2020 at 10:13.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!