Advertisement: Linux VPS from $4/month - contact support for custom offer.
+ Post New Thread
Results 1 to 2 of 2

Thread: ffmpeg fix video file audio only single channel/speaker played

  1. #1
    Administrator
    Join Date
    Mar 2013
    Posts
    2,727

    ffmpeg fix video file audio only single channel/speaker played

    The video file had wrong audio, i could hear only left channel, so i was wondering how to adjust/recode the audio so it is from left+right channel.

    This worked to use the left channel also as the right channel:

    Code:
    ffmpeg -i "input.avi" -filter_complex "[0:a]channelsplit=channel_layout=stereo:channels=FL[left]" -map 0:0 -map "[left]" -c:v copy "output.avi"
    If you hear only right, try to replace FL by FR and left by right.

  2. #2
    Administrator
    Join Date
    Mar 2013
    Posts
    2,727


    Is this useful / helpfull? Yes | No
    It fails with error:
    Stream mapping:
    Stream #0:1 (aac) -> channelsplit (graph 0)
    Stream #0:1 -> #0:0 (aac (native) -> aac (native))
    channelsplit (graph 0) -> Stream #0:1 (aac)
    Press [q] to stop, [?] for help
    [aac @ 0x5558ec1ceec0] Unsupported channel layout "1 channels (FL)"
    Error initializing output stream 0:1 -- Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
    Conversion failed!
    in case of a file:
    Metadata:
    major_brand : mp42
    minor_version : 0
    compatible_brands: isommp42
    creation_time : 2013-08-24T21:32:24.000000Z
    Duration: 00:42:48.01, start: 0.000000, bitrate: 360 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 320x240, 261 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc (default)
    Metadata:
    handler_name : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)


    After many minutes ChatGPT suggested me correct command that convert video file the way that left audio channel is copied to right channel in resulting file:
    ffmpeg -i input.mp4 -filter_complex "[0:a]pan=stereo|c0=c0|c1=c0[a]" -map "[a]" -c:v copy -map 0:0 output.mp4
    To use input file'sright channel on both output file channels, i would replace =c0 by =c1
    ffmpeg -i input.mp4 -filter_complex "[0:a]pan=stereo|c0=c1|c1=c1[a]" -map "[a]" -c:v copy -map 0:0 output.mp4

+ Post New Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam