VideoHelp Forum




+ Reply to Thread
Results 1 to 27 of 27
  1. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    I've got a few fairly large (1-5GB) .mp4 files from xsplit from an event I recorded. They won't open in VLC or PotPlayer and attempting to reencode them with ffmpeg yields a "unspecified pixel format" error. I really need these recordings and any help would be greatly appreciated.

    I saw a few threads about editing the header of the .mp4 file, but after looking at it in a hex editor, I don't know where the header ends and the body begins.
    Quote Quote  
  2. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    If you're able to throw money instead of time at the problem, try mp4repair.org.
    Quote Quote  
  3. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by JVRaines View Post
    If you're able to throw money instead of time at the problem, try mp4repair.org.
    Unfortunately, that would cost me an absurd amount of money. I'm willing to put in the time.
    Quote Quote  
  4. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    When you run FFmpeg, have you tried specifying the appropriate pixel format? You should be able to glean it from other MP4 files that work (if you have any).
    Quote Quote  
  5. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by JVRaines View Post
    When you run FFmpeg, have you tried specifying the appropriate pixel format? You should be able to glean it from other MP4 files that work (if you have any).
    I'm not sure what the pixel format is, or the syntax to do so in ffmpeg. I've attached a MediaInfo screenshot from a non-corrupt file from the same session. My best guess is yuv420.
    Image Attached Thumbnails Click image for larger version

Name:	Capture.JPG
Views:	650
Size:	107.9 KB
ID:	30782  

    Quote Quote  
  6. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Have you tried run them through ffmpeg?

    Code:
    c:\program\ffmpeg -i c:\video\video.mp4 -vcodec copy -acodec copy c:\video\newvideo.mp4
    And see if you get any errors?


    You could also try video repair tool. Try the trial(repair half video) and see if you get anything at all. You choose a working mp4 and the broken one.
    Quote Quote  
  7. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by Baldrick View Post
    Have you tried run them through ffmpeg?

    Code:
    c:\program\ffmpeg -i c:\video\video.mp4 -vcodec copy -acodec copy c:\video\newvideo.mp4
    And see if you get any errors?


    You could also try video repair tool. Try the trial(repair half video) and see if you get anything at all. You choose a working mp4 and the broken one.
    Yup. Tried that. ffmpeg says there's an unspecified pixel format and I don't know how to specify it.
    Quote Quote  
  8. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Use ffprobe on a known good file to use as a reference of what parameters to use.

    Scott
    Quote Quote  
  9. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by Cornucopia View Post
    Use ffprobe on a known good file to use as a reference of what parameters to use.

    Scott
    ffprobe on a known good video returns:

    Code:
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
     Duration: 01:00:02.17, start: 0.000000, bitrate: 4528 kb/s
       Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 98 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
       Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 4422 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
       Metadata:
         handler_name    : VideoHandler
    So I tried the following command based on this link:

    Code:
    ffmpeg -f rawvideo -vcodec rawvideo -s 1280x720 -r 30 -pix_fmt yuv420p -i inputfile.mp4 -c:v libx264 -preset medium -qp 23 output.mp4
    And got a massive file of only static.
    Quote Quote  
  10. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    What happens if you leave out all the rawvideo stuff and just specify pix_fmt as an input option? I.e.
    ffmpeg -pix_fmt yuv420p -i inputfile.mp4 -c:v libx264 -preset medium -qp 23 output.mp4
    Quote Quote  
  11. Member WazaKrash's Avatar
    Join Date
    Jan 2015
    Location
    in Europe
    Search Comp PM
    Maybe you can use it with File Repair.

    Or when I have that sort of problem, I convert the file in another format (avi, mp4, whatever you want) sometimes you can finally play the video after the conversion.
    Quote Quote  
  12. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by JVRaines View Post
    What happens if you leave out all the rawvideo stuff and just specify pix_fmt as an input option? I.e.
    ffmpeg -pix_fmt yuv420p -i inputfile.mp4 -c:v libx264 -preset medium -qp 23 output.mp4
    I get this error:

    Code:
    Option pixel_format not found.
    Quote Quote  
  13. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by WazaKrash View Post
    Maybe you can use it with File Repair.

    Or when I have that sort of problem, I convert the file in another format (avi, mp4, whatever you want) sometimes you can finally play the video after the conversion.
    File repair says "No data to recover detected" on both the corrupted and healthy files.
    Quote Quote  
  14. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Originally Posted by ttremblay View Post
    Originally Posted by JVRaines View Post
    What happens if you leave out all the rawvideo stuff and just specify pix_fmt as an input option? I.e.
    ffmpeg -pix_fmt yuv420p -i inputfile.mp4 -c:v libx264 -preset medium -qp 23 output.mp4
    I get this error:

    Code:
    Option pixel_format not found.
    The option is pix_fmt, not pixel_fmt. Or is the misspelling in the error message?
    Quote Quote  
  15. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by JVRaines View Post
    Originally Posted by ttremblay View Post
    Originally Posted by JVRaines View Post
    What happens if you leave out all the rawvideo stuff and just specify pix_fmt as an input option? I.e.
    ffmpeg -pix_fmt yuv420p -i inputfile.mp4 -c:v libx264 -preset medium -qp 23 output.mp4
    I get this error:

    Code:
    Option pixel_format not found.
    The option is pix_fmt, not pixel_fmt. Or is the misspelling in the error message?
    It's misspelling the error message, I'm running the command exactly as above.
    Quote Quote  
  16. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Can you post the entire output of ffprobe?
    ffprobe badfile.mp4
    Quote Quote  
  17. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by JVRaines View Post
    Can you post the entire output of ffprobe?
    ffprobe badfile.mp4
    ffprobe won't run on the corrupted file. It just sits there until i press ^C.
    Quote Quote  
  18. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Does adding the -loglevel debug option before the filename produce anything?

    Hate to say it, but your options are looking to be either paying someone else to recover the files, if possible, or studying the MPEG-4 Part 10 and Part 14 specifications until you have learned enough to hack the files in a byte editor.
    Quote Quote  
  19. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by JVRaines View Post
    Does adding the -loglevel debug option before the filename produce anything?

    Hate to say it, but your options are looking to be either paying someone else to recover the files, if possible, or studying the MPEG-4 Part 10 and Part 14 specifications until you have learned enough to hack the files in a byte editor.
    I just tried the tool mentioned in this stackoverflow question: http://stackoverflow.com/questions/23202611/repairing-a-corrupt-mp4-video-file

    I was able to get a .h264 and a .acc file that both play fine in PotPlayer. Now I need to figure out how to combine the two into a .mp4 file with ffmpeg. Any ideas?
    Quote Quote  
  20. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    That's great news! And way quicker than becoming an MP4 expert. Try this:

    ffmpeg -i myvideo.h264 -i myaudio.aac -c copy -map 0:v -map 1:a mynewfile.mp4
    Quote Quote  
  21. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by JVRaines View Post
    That's great news! And way quicker than becoming an MP4 expert. Try this:

    ffmpeg -i myvideo.h264 -i myaudio.aac -c copy -map 0:v -map 1:a mynewfile.mp4
    Code:
    Malformed AAC bitstream detected: use the audio bitstream filter 'aac_adtstoasc' to fix it ('-bsf:a aac_adtstoasc' option with ffmpeg)
    I'm not sure where to put this option.
    Quote Quote  
  22. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    You can put it after the copy option.
    Quote Quote  
  23. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by JVRaines View Post
    You can put it after the copy option.
    Ok. That worked. Except i get an error saying "pts has no value". The file still finished, but the audio and video are drastically offset.
    Quote Quote  
  24. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    You may need to specify -fflags +genpts before the input file (before the -i) that's causing the problem.
    Quote Quote  
  25. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Before the video input or the audio input?
    Quote Quote  
  26. Member
    Join Date
    Mar 2015
    Location
    United States
    Search PM
    Originally Posted by ttremblay View Post
    Before the video input or the audio input?
    Code:
    ffmpeg.exe -fflags +genpts -i "G:\recover tool\recovered.h264" -i "G:\recover tool\recovered.aac" -c copy -bsf:a aac_adtstoasc -map 0:v -map 1:a "G:\NE FIRST UMass District\2015-03-14_075202579_recovered_2.mp4"
    This line still causes the "pts has no value" error.
    Quote Quote  
  27. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    I have no idea because you didn't post the output. I would guess audio because that's where you got the error message.
    Quote Quote  



Similar Threads

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