VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. Hi

    but the cats. However

    I wonder if is possible merge (concatenate) multiple .avi files (encoded in mjpeg) possibly via commandline. FFmpeg do it in concat mode but strangely the output .avi seems 1920X1988 and not as the source 1920X1080

    My .avi source does not have audio inside

    Is there an alternative? thanks
    Quote Quote  
  2. I don't think fmpeg concat changes the resolution.
    Check with mediainfo the resolution of each part.
    Probably only the DAR is changed.
    Quote Quote  
  3. Maybe you are encoding and not just joining. Let's see your command line?
    Quote Quote  
  4. were this is 2 input .avi files:

    https://www.swisstransfer.com/d/b8836e07-0137-4d1c-8467-9ffe0c19ebc7

    I use something like:

    Code:
    ffmpeg.exe -y -v quiet -stats -threads auto -f concat -safe 0 -i AllRemuxConcatList.txt -vcodec copy -an output.avi
    and AllRemuxConcatList.txt is:

    Code:
    file 'C:\Users\Administrator\Desktop\Nuova cartella (12)\AllSingleRemuxed\DJI_0139.MP4.avi'  
    file 'C:\Users\Administrator\Desktop\Nuova cartella (12)\AllSingleRemuxed\DJI_0140.MP4.avi'
    but the final output.avi is 1088 and not 1080:

    Generale
    Nome completo : C:\Users\Administrator\Desktop\Nuova cartella (12)\outputRoutine_7_AVI_MJPG_NO_MASCHERA_BLUR.avi
    Formato : AVI
    Formato/Informazioni : Audio Video Interleave
    Dimensione : 183MiB
    Durata : 7s 80 ms
    Bitrate totale : 217 Mb/s
    Creato con : Lavf59.16.100

    Video
    ID : 0
    Formato : JPEG
    ID codec : MJPG
    Durata : 7s 80 ms
    Bitrate : 217 Mb/s
    Larghezza : 1.920 pixel
    Altezza : 1.088 pixel
    Rapporto aspetto visualizzazione : 16:9
    Frame rate : 25,000 FPS
    Spazio colore : YUV
    Croma subsampling : 4:2:2
    Profondità bit : 8 bit
    Tipo scansione : Interlacciato
    Ordine scansione : Top field first
    Modo compressione : Con perdita
    Bit/(pixel*frame) : 4.150
    Dimensione della traccia : 183MiB (100%)
    Quote Quote  
  5. does exist something like commandline to acorrectly merge the 2 avi?
    Quote Quote  
  6. Yes indeed. I think ProWo on the right track.
    Try merging with mkvmerge instead.
    Image Attached Images  
    Last edited by blud7; 8th Aug 2023 at 22:31.
    Quote Quote  
  7. I believe MJPEG is always mod 16 internally. When a 1080 (mod 8) line video is compressed the encoder internally ads 8 lines to make it 1088 (mod 16) lines. On playback it removes those extra lines. All you're seeing is some confusion about those extra lines. The video stream itself isn't changed by the append operation.

    After appending you can patch the AVI headers to indicate the video is 1080 lines instead of 1088. Or you can crop away the extra 8 lines when you edit the video.
    Quote Quote  
  8. Originally Posted by jagabo View Post

    After appending you can patch the AVI headers to indicate the video is 1080 lines instead of 1088
    ah wow, but in what way?
    Quote Quote  
  9. I used a hex editor to change three values near the start of the AVI file.

    Image
    [Attachment 73083 - Click to enlarge]


    The three red "38" used to be "40". Note that the value following them is 04. When you put the two bytes together into a word in little-endian order you get 0440 and 0438. 0440 hex is 1088 in decimal. 0438 hex is 1080 decimal. Those are the heights of the frame in the headers of the AVI file. So I changed the height of the frame from 1088 to 1080.

    Useful information: https://learn.microsoft.com/en-us/windows/win32/directshow/avi-riff-file-reference
    Image Attached Files
    Last edited by jagabo; 9th Aug 2023 at 19:14.
    Quote Quote  
  10. wondeful, but is there a way to do this operation via batch?
    Quote Quote  
  11. Sure, find or write a program that reads the start of the file, modifies it, then writes it back.
    Quote Quote  
  12. yes oh my poor cat. However I need to open another tread
    Quote Quote  
  13. PowerShell has the ability to patch binary files.
    Quote Quote  



Similar Threads

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