VideoHelp Forum




+ Reply to Thread
Results 1 to 24 of 24
  1. Anonymous543
    Guest
    hello there i have a movie clip which is in mkv container

    i separated its video with following code
    Code:
    ffmpeg -i input.mkv -c:v copy -an video.mkv
    and also separated its audio with following code
    Code:
    ffmpeg -i input.mkv -vn -c:a copy audio.ac3


    after that i rencoded video with 2 pass rate control mode using this code
    Code:
    ffmpeg -y -i video.mkv -c:v libx264 -vf scale=426:240 -b:v 400k -pass 1 -f null NUL && ^
    ffmpeg -i video.mkv -c:v libx264 -vf scale=426:240 -b:v 400k -pass 2 v.mkv
    and also rencoded audio with this code
    Code:
    ffmpeg -i audio.ac3 -ac 2 -c:a libopus -b:a 128k a.opus





    now i have 2 separated file
    v.mkv = contains only video
    a.opus = contains only audio
    too combine them in mp4 i used this code
    Code:
    ffmpeg -i v.mkv -i a.opus -c copy clip.mp4
    but it gave me this results
    Image
    [Attachment 63598 - Click to enlarge]

    Image
    [Attachment 63599 - Click to enlarge]







    when i combine them in mkv it does not shows any yellow line that track 1: codec frame size is not set

    but i want my final clip in mp4 without that yellow line
    how can i fix this?
    Quote Quote  
  2. Anonymous543
    Guest
    when i done encoding with same settings on my source input.mkv(without separating audio and video) using this code
    Code:
    ffmpeg -y -i input.mkv -vf scale=426:240 -c:v libx264 -preset ultrafast -b:v 400k -pass 1 -an -f null NUL && ^
    ffmpeg -i input.mkv -vf scale=426:240 -c:v libx264 -preset ultrafast -b:v 400k -pass 2 -ac 2 -filter:a "volume=1.2" -c:a libopus -b:a 128k output.mp4
    this was successfull without any yellow lines


    when i watched mediainfo of both encoding outputs..
    1st output.mp4 which i got by separating audio and video then rencoded with yellow line error
    2nd output.mp4 which was directly done to source

    both outputs mediainfo is almost same
    Last edited by Anonymous543; 11th Mar 2022 at 05:48.
    Quote Quote  
  3. try creating the audio inside a mkv container instead of writing it to a raw opus file.
    My guess is the warning happens since ffmpeg isn't totally sure that the .opus stream does not contain just audio.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  4. Anonymous543
    Guest
    Originally Posted by Selur View Post
    try creating the audio inside a mkv container instead of writing it to a raw opus file.
    My guess is the warning happens since ffmpeg isn't totally sure that the .opus stream does not contain just audio.

    Cu Selur
    i created audio in mkv container using this code
    Code:
    ffmpeg -i audio.ac3 -c:a libopus -b:a 128k a.mkv

    then combined with my v.mkv(my video)in mp4 container with this code
    Code:
    ffmpeg -i v.mkv -i a.mkv -c copy clip.mp4
    still its showing same yellow line.
    Quote Quote  
  5. Anonymous543
    Guest
    will that yellow line cause any latency in my audio track or any bad affect on my output any way?
    Quote Quote  
  6. will that yellow line cause any latency in my audio track or any bad affect on my output any way?
    I don't think so.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  7. Anonymous543
    Guest
    still its a mystery, why this problem occurring while combining h264 video stream and opus audio stream in mp4 wrapper
    Quote Quote  
  8. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by kirito View Post
    still its a mystery, why this problem occurring while combining h264 video stream and opus audio stream in mp4 wrapper
    try with ffmpeg -i example.mkv -c copy out.mp4
    Quote Quote  
  9. Anonymous543
    Guest
    Originally Posted by october262 View Post
    Originally Posted by kirito View Post
    still its a mystery, why this problem occurring while combining h264 video stream and opus audio stream in mp4 wrapper
    try with ffmpeg -i example.mkv -c copy out.mp4
    It will be successful..
    But if the
    h264video.mkv(or any wrapper)(only video stream) and
    lipopus.opus(only audio stream)

    Are separated
    Then
    Code:
    ffmpeg -i h264video.mkv -i libopus.opus -c copy output.MP4
    Will not work properly ,it will end with track :1 codec frame size is not set
    Quote Quote  
  10. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by kirito View Post
    Originally Posted by october262 View Post
    Originally Posted by kirito View Post
    still its a mystery, why this problem occurring while combining h264 video stream and opus audio stream in mp4 wrapper
    try with ffmpeg -i example.mkv -c copy out.mp4
    It will be successful..
    But if the
    h264video.mkv(or any wrapper)(only video stream) and
    lipopus.opus(only audio stream)

    Are separated
    Then
    Code:
    ffmpeg -i h264video.mkv -i libopus.opus -c copy output.MP4
    Will not work properly ,it will end with track :1 codec frame size is not set
    this here - https://holtstrom.com/michael/blog/post/517/MKV-to-MP4.html
    says to use -acodec ac3 instead of -acodec copy it should solve your codec frame size is not set error
    Quote Quote  
  11. Anonymous543
    Guest
    But i want my final output in MP4 container with libx264 as my video codec and libopus as my audio codec
    Quote Quote  
  12. Anonymous543
    Guest
    https://askubuntu.com/questions/768762/combine-h-264-video-and-opus-audio-stream-into-...audio%20tracks.

    According to this website MP4 can't have opus audios with h264 video



    After checking that website i readed about opus in Wikipedia
    https://en.m.wikipedia.org/wiki/Opus_(audio_format)

    Opus is Contained by
    Ogg, Matroska, WebM, MPEG-TS

    May be that's why MP4 is having issues with Opus audio track in ffmpeg
    Quote Quote  
  13. You could use mp4box,...
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  14. Anonymous543
    Guest
    Originally Posted by Selur View Post
    You could use mp4box,...
    May be Opus and h264 together in MP4 wrapper isn't a good option or may be there's a some reason that's why ffmpeg is showing yellow line..and gpac mp4box i never used but it's based on ffmpeg i guess
    Quote Quote  
  15. gpac mp4box i never used but it's based on ffmpeg i guess
    No, it's not. (I mainly use MP4Box and rarely use ffmpeg.)
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  16. Anonymous543
    Guest
    No, it's not. (I mainly use MP4Box and rarely use ffmpeg.)
    Thanks for suggestion

    But i still wanna know why ffmpeg is giving yellow line..
    We can combine audio + video streams in mkv wrapper without yellow line ,
    We can also combine them in mp4 wrapper but it gives yellow line ,i think it's ffmpeg bug or something is going wrong may be container issue or something else

    There's one report on same issue on ffmpeg website here
    https://ffmpeg.org/pipermail/ffmpeg-user/2018-February/038999.html

    They suggested to rencode audio stream instead of copying codecs..but why it will need when my audio stream is already encoded in opus
    Quote Quote  
  17. You either need to reade the source code or ask the ffmpeg developers about it.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  18. Anonymous543
    Guest
    I don't know any ffmpeg developer and how to contact them ,but i know that gyan and btbn compiles ffmpeg builds ,may be gyan will know about it
    Quote Quote  
  19. ffmpeg bug tracker (https://trac.ffmpeg.org/) or the mailing list you youself linked to might be a good place to contact the ffmpeg authors.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  20. Anonymous543
    Guest
    ffmpeg bug tracker (https://trac.ffmpeg.org/) or the mailing list you youself linked to might be a good place to contact the ffmpeg authors.
    Thanks✨
    Quote Quote  
  21. The MP4 writer tries to determine if the audio track is VBR, for the purposes of the some of the further metadata it has to write. It checks the encoded audio frame size as part of that. The MKV writer does not do this.

    Since you're remuxing, that data isn't available for Opus, so the writer complains. But there is no deficiency with the file.

    I'll change the log level for that message - not really something for general users to be concerned with.
    Quote Quote  
  22. Anonymous543
    Guest
    Originally Posted by Gyan View Post
    The MP4 writer tries to determine if the audio track is VBR, for the purposes of the some of the further metadata it has to write. It checks the encoded audio frame size as part of that. The MKV writer does not do this.

    Since you're remuxing, that data isn't available for Opus, so the writer complains. But there is no deficiency with the file.

    I'll change the log level for that message - not really something for general users to be concerned with.

    (am not sure)it can be problematic if we change remux audio which is also resampled..then maybe resampled audio framesize will be changed and can cause audio track end before video ends or can cause latency in track in short it cant be sync properly i guess..


    what if sourceaudiovideo is not separated and rencoded together
    Originally Posted by Gyan View Post
    It checks the encoded audio frame size as part of that
    then this data will be available for mp4 writter?
    Quote Quote  
  23. The decoder will pick up the frame size from the stream itself.

    Yes, if there's an Opus encoder running in the process, it will fill out the frame size.
    Quote Quote  
  24. Anonymous543
    Guest
    Thanks for explaination✨
    Quote Quote  



Similar Threads

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